home *** CD-ROM | disk | FTP | other *** search
- /* clairvoy.c -- clairvoyance function for Targ-Hurt ESP Trainer
-
- History: rhs 14-mar-87
- */
-
- #include "mancon.h"
- #include "declares.h"
-
- void mode_clairvoyance()
- { int keypress, machine_sel, dummy;
-
- disp_cls();
- disp_top("Clairvoyance");
- disp_cbot();
- srand( (unsigned)readclock(&dummy) ); /* Randomize first random number */
- /* readclock is a function which
- reads the system clock. In this
- application, its output is
- suitable for seeding a random
- number generator because it
- seldom returns the same value. */
- disp_cursor(OFF); /* Make the cursor invisible. */
- keypress = START;
- while(keypress != QUIT)
- { machine_sel = rand()%4; /* Get random number from 0 to 3 */
-
- keypress = pf_getcode();
- switch(keypress)
- { case PASS: thud();
- pf_newdirec(machine_sel);
- pf_display();
- break;
- case QUIT: pf_resetscore();
- disp_cls();
- disp_cursor(ON);
- break;
- case RESET: pf_resetscore();
- pf_display();
- break;
- case CHANGE:break;
- default: thud();
- pf_newscore(keypress, machine_sel);
- pf_display();
- break;
- }
- }
- } /* end mode_clairvoyance() */
-
-
-
-
-