www.pudn.com > Paper_Rock_Scissors.rar > p_r_s.h


/* The game of paper rock and scissors*/ 
#include   // for isspace() 
#include   // for printf().etc  
#include  // for rand() and srand() 
#include    // for time() 
#include  // for strcpy() 
 
/* some command of this game */ 
enum p_r_s 
{ 
    paper,rock,scissors,game,help,instruction,quit     
}; 
 
/* the result of this game */ 
enum outcome 
{ 
    win,lose,tie,error 
}; 
 
typedef enum p_r_s p_r_s; 
typedef enum outcome outcome; 
 
/* compare the choice of player and the machine*/ 
outcome compare(p_r_s player_choice,p_r_s machine_choice); 
 
/* Get the final result of this game*/ 
void prf_final_status(int win_cnt,int lose_cut); 
 
/* Get the result of this game*/ 
void prf_game_status(int win_cnt,int lose_cnt,int tie_cnt); 
 
/* Get the help of this game */ 
void prf_help(void); 
 
/*Get the Instruction of this Game*/ 
void prf_instruction(void); 
 
/*change the choice to string type*/ 
char *prf_string_choice(p_r_s choice); 
 
/* To tabulate result*/ 
void report_and_rabulate(outcome result, 
                       int *win_cnt_ptr, 
                      int *lose_cnt_ptr, 
                       int *tie_cnt_ptr); 
 
/* selection by machine (paper rock and scissors)*/ 
p_r_s selection_by_machine(void); 
 
/* selection by player (paper rock and scissors)*/ 
p_r_s selection_by_player(void);