AquaRank.com

FishProfiles.com Message Forums

faq | etiquette | register | my account | search | mailbox
# FishProfiles.com Message Forums
L# Off Topic
 L# The Recovery Room
  L# The Daily GEEK Challenge!!!
   L# Pages: 1, 2, 3
 Post Reply  New Topic
SubscribeThe Daily GEEK Challenge!!!
eogle
*****
-----
Hobbyist
Posts: 58
Kudos: 24
Votes: 56
Registered: 28-Feb-2006
male usa
do I have to include the commas?
... I guess I will

-Eric
"He is no fool who gives what he cannot keep to gain what he cannot lose."
Post InfoPosted 13-Apr-2006 07:12Profile PM Edit Delete Report 
eogle
*****
-----
Hobbyist
Posts: 58
Kudos: 24
Votes: 56
Registered: 28-Feb-2006
male usa
EditedEdited by eogle
wow, I just realized its a lot harder to do it with the commas in there. Im gonna do it without and see what you say. If it doesnt count, Ill edit it.


Edit: We haven't leanred formatted print statements yet (I'm a freshman)

-Eric
"He is no fool who gives what he cannot keep to gain what he cannot lose."
Post InfoPosted 13-Apr-2006 07:25Profile PM Edit Delete Report 
eogle
*****
-----
Hobbyist
Posts: 58
Kudos: 24
Votes: 56
Registered: 28-Feb-2006
male usa
i got it, and if I let it run, it would take FOREVER

here's the code:




#include <stdio.h>
#include <math.h>

int main(void)
{
int I;
I = 2000000000;
printf("%d bottles of beer on the wall\n", I);
printf("%d bottles of beer\n", I);
printf("Take one down pass it around\n";
for (I = 1999999999; I > 0; I -= 1)
{
printf("%d bottles of beer on the wall\n", I);
printf("%d bottles of beer on the wall\n", I);
printf("%d bottles of beer\n", I);
printf("Take one down pass it around\n";
}
printf ("No bottles of beer on the wall\n";
return 0;
}


-Eric
"He is no fool who gives what he cannot keep to gain what he cannot lose."
Post InfoPosted 13-Apr-2006 08:10Profile PM Edit Delete Report 
DeletedPosted 13-Apr-2006 14:28
This post has been deleted
NewBreeder16
*******
-----
Hobbyist
Posts: 149
Kudos: 94
Votes: 16
Registered: 11-Feb-2005
male usa
you have too much time on your hands, eric.
-NewBreeder16

_______________________________________________
You can call me Newb too, since I'm not nere new any more.
Post InfoPosted 13-Apr-2006 14:28Profile PM Edit Delete Report 
eogle
*****
-----
Hobbyist
Posts: 58
Kudos: 24
Votes: 56
Registered: 28-Feb-2006
male usa


It only took me like 30 minutes....

It was fun.... sort of....

-Eric
"He is no fool who gives what he cannot keep to gain what he cannot lose."
Post InfoPosted 13-Apr-2006 17:17Profile PM Edit Delete Report 
eogle
*****
-----
Hobbyist
Posts: 58
Kudos: 24
Votes: 56
Registered: 28-Feb-2006
male usa
It prints about 2,000 verses per second. At this rate, it will print the entire song in about 11.57 days!

-Eric
"He is no fool who gives what he cannot keep to gain what he cannot lose."
Post InfoPosted 13-Apr-2006 18:41Profile PM Edit Delete Report 
poisonwaffle
 
----------
Mega Fish
Posts: 1397
Kudos: 591
Registered: 11-Feb-2003
male usa
Wow, Eric, you either have a really slow computer, or C is really slow

It only took about 6 hours for my school computer to run the program when I wrote it in Java

I'm giving this one to Eric tho... Excel isn't really a programming language, lion

Next challenge will be up in ~10 hours
Post InfoPosted 13-Apr-2006 18:50Profile PM Edit Delete Report 
eogle
*****
-----
Hobbyist
Posts: 58
Kudos: 24
Votes: 56
Registered: 28-Feb-2006
male usa
Well, it was on Purdue's computer that I ran it, and they are really slow. I have a feeling that if I ran it on my laptop, it would be faster.

-Eric
"He is no fool who gives what he cannot keep to gain what he cannot lose."
Post InfoPosted 13-Apr-2006 20:17Profile PM Edit Delete Report 
DeletedPosted 13-Apr-2006 20:58
This post has been deleted
superlion
 
----------
Mega Fish
Posts: 1246
Kudos: 673
Votes: 339
Registered: 27-Sep-2003
female usa
It's the closest to programming I know...

><>
Post InfoPosted 13-Apr-2006 21:41Profile Homepage PM Edit Delete Report 
eogle
*****
-----
Hobbyist
Posts: 58
Kudos: 24
Votes: 56
Registered: 28-Feb-2006
male usa
well, its been 10 hours....

-Eric
"He is no fool who gives what he cannot keep to gain what he cannot lose."
Post InfoPosted 14-Apr-2006 16:35Profile PM Edit Delete Report 
moondog
 
**********
---------------
---------------
Moderator
The Hobnob-lin
Posts: 2676
Kudos: 1038
Votes: 4366
Registered: 30-Sep-2002
male usa
not sure why you include math.h?? you're not using any math functions there...

and it seems like this would be a little more efficient:

#include <stdio.h>

int main(void)
{
int I;
I = 2000000000;
while (I > 0) {
printf("%d bottles of beer on the wall\n", I);
printf("%d bottles of beer\n", I);
printf("Take one down pass it around\n";
I -= 1;
printf("%d bottles of beer on the wall\n", I);
}
printf ("No bottles of beer on the wall\n";
return 0;
}




"That's the trouble with political jokes in this country... they get elected!" -- Dave Lippman
Post InfoPosted 14-Apr-2006 16:42Profile PM Edit Delete Report 
eogle
*****
-----
Hobbyist
Posts: 58
Kudos: 24
Votes: 56
Registered: 28-Feb-2006
male usa
Yea, it's just a habbit to include math.h.

You know, in yours, when I = 1, you will do:

printf("%d bottles of beer on the wall\n", I);
printf("%d bottles of beer\n", I);
printf("Take one down pass it around\n";
I -= 1;
printf("%d bottles of beer on the wall\n", I);
}
printf ("No bottles of beer on the wall\n";

which will print:

1 bottles of beer on the wall
1 bottles of beer
Take one down pass it around
0 bottles of beer on the wall
No bottles of beer on the wall


This declares that there exists no bottles of beer on the wall twice and it does not match up to the last verse of the song. An if statement to break the loop would be helpful there. Also, yours made me realize that when there is 1 bottles of beer left, the word bottles should be singular, not plural. We both messed that up.

Anyway, its no big deal.

-Eric
"He is no fool who gives what he cannot keep to gain what he cannot lose."
Post InfoPosted 14-Apr-2006 17:33Profile PM Edit Delete Report 
poisonwaffle
 
----------
Mega Fish
Posts: 1397
Kudos: 591
Registered: 11-Feb-2003
male usa
Sorry, I've missed the last 2 days

I'm 2 hours late on this one, I'm dead tired, and I can't think up another one... I'll try to have one up sometime tomarrow afternoon, but I dunno...

I was out biking 'till 11:30pm tonight, gimme a break
Post InfoPosted 15-Apr-2006 07:16Profile PM Edit Delete Report 
moondog
 
**********
---------------
---------------
Moderator
The Hobnob-lin
Posts: 2676
Kudos: 1038
Votes: 4366
Registered: 30-Sep-2002
male usa
eogle, that's what testing is for



"That's the trouble with political jokes in this country... they get elected!" -- Dave Lippman
Post InfoPosted 15-Apr-2006 22:04Profile PM Edit Delete Report 
DeletedPosted 17-Apr-2006 03:14
This post has been deleted
eogle
*****
-----
Hobbyist
Posts: 58
Kudos: 24
Votes: 56
Registered: 28-Feb-2006
male usa
So are we not doing this thing anymore or what?

-Eric
"He is no fool who gives what he cannot keep to gain what he cannot lose."
Post InfoPosted 18-Apr-2006 00:29Profile PM Edit Delete Report 
eogle
*****
-----
Hobbyist
Posts: 58
Kudos: 24
Votes: 56
Registered: 28-Feb-2006
male usa
When is this thing gonna happen again?

-Eric
"He is no fool who gives what he cannot keep to gain what he cannot lose."
Post InfoPosted 20-Apr-2006 16:06Profile PM Edit Delete Report 
superlion
 
----------
Mega Fish
Posts: 1246
Kudos: 673
Votes: 339
Registered: 27-Sep-2003
female usa
When Scott comes up with a new callenge

><>
Post InfoPosted 20-Apr-2006 17:16Profile Homepage PM Edit Delete Report 
poisonwaffle
 
----------
Mega Fish
Posts: 1397
Kudos: 591
Registered: 11-Feb-2003
male usa
The only other challenges I can think of would be random simple programming challenges

And I don't know C yet (doubt I ever will...not a big fan of programming)...all I know is Java

How 'bout this for a challenge: fix my laptop (j/k)

I'll just turn it over to you guys... if you can come up with a challenge, post it up
Post InfoPosted 21-Apr-2006 04:08Profile PM Edit Delete Report 
eogle
*****
-----
Hobbyist
Posts: 58
Kudos: 24
Votes: 56
Registered: 28-Feb-2006
male usa
That's cool, if I think of any I will post them.

-Eric
"He is no fool who gives what he cannot keep to gain what he cannot lose."
Post InfoPosted 21-Apr-2006 05:41Profile PM Edit Delete Report 
# Pages: 1, 2, 3
Post Reply  New Topic
Jump to: 

The views expressed on this page are the implied opinions of their respective authors.
Under no circumstances do the comments on this page represent the opinions of the staff of FishProfiles.com.

FishProfiles.com Forums, version 11.0
Mazeguy Smilies