Welcome! Log In Create A New Profile

Advanced

procrastination...

Posted by algo 
algo
procrastination...
November 22, 2004 03:06AM
so here I sit folks, procrastinating from this assignment I am suppossed to be working on that's due tomorrow. What are you procrastinating from?
Re: procrastination...
November 22, 2004 03:36AM
having a life outside this board. it's rough...
algo
Re: procrastination...
November 22, 2004 03:41AM
Here's an example of the exciting joy I'm avoiding...

if( argc > 1 )
{
maxspuds = atoi(argv[1]);
}

msgid = msgget((key_t) 73707564, 0666 | IPC_CREAT);
if( msgid == -1 )
{
fprintf(stderr, "msgget failed\n"winking smiley;
exit(EXIT_FAILURE);
}

time(&t);
srand(t);
printf("initializing seed to %d\n",t);
sleep(5);
for( x = 0; x < maxspuds; x++ )
{
spud.msg_type = 1;
randval = rand();
if ( randval == 0 )
randval++;
if( (randval % 5) == 0 )
{
spud.type = ROTTEN;
spud.name = "rotten";
rotten++;
}
else if( (randval % 2) == 0 )
{
spud.type = WHITE;
spud.name = "white";
white++;
}
else
{
spud.type = RED;
spud.name = "red";
red++;
}
Re: procrastination...
November 22, 2004 03:46AM
you don't find spuds interesting ?
shame on you
Fish
Re: procrastination...
November 22, 2004 03:59AM
Is there any particular reason you're counting randomly generated potatos?
Fish
Re: procrastination...
November 22, 2004 03:59AM
I guess that's probably "potatoes."
Sorry, only registered users may post in this forum.

Click here to login