FidoNet Echomail Archive
c_echo

<<< Previous Index Next >>>

From: Kurt Kuzba
To: All
Date: 2004-09-20 12:52:52
Subject: [C] numdrop4 v4.4 - [6 of 6]

From: "Kurt Kuzba" <kkuzba{at}centurytel.net>

/*_|_|  numdrop4.c  v4.4  PUBLIC DOMAIN 9/20/2004 by Kurt Kuzba
_|_|_|  Part 6 of 6
_|_|*/
void* gameplay(void)
{
  sGameHistory*  GBs;
 /* pointer to game grid array */
  int replay, raw_score;
 /* replay status and score variable */
  long final;
 /* long integer to calculate final score */
  srand((unsigned)time(NULL));
 /* initialize pseudorandom number generator */
  GBs = malloc(sizeof(sGameHistory));
 /* allocate space for game grid array */
  if(NULL != GBs)
 /* if the space is successfully allocated */
  {
    do{
      raw_score = play(GBs);
   /* raw score returned by playing game */
      final = ((long)raw_score * 100 * ((long)(GBs->Move + 3) / 4))
        / 455;
   /* final score = (raw score * ((moves + 3) / 4)) / 455 */
   /* perfect score = 1000 */
      printf("\n\nFinal Score: %ld\n\n", final);
      replay = high_scores(final);
      printf("%c\n", replay);
   /* visit high scores screen and get replay value */
    } while(replay == 'y');
  /* continue while user wants to play again */
   free(GBs);
  /* free game grid array */
 }
  return (void*)GBs;
 /* return value of game grid array pointer */
}
int main(void)
{
  if(NULL == gameplay()) puts("Unable to allocate memory for game.");
 /* notify player if allocation was not successful */
  return 0;
}
/*_|_|  end numdrop4.c  v4.4  Part 6 of 6  _|_|*/

--- BBBS/LiI v4.01 Flag-5
 * Origin: Prism's_Point (1:261/38.1)
SEEN-BY: 633/267 270
@PATH: 261/38 123/500 106/2000 633/267


<<< Previous Index Next >>>