home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / info / c_tutorg / words.h < prev   
Encoding:
C/C++ Source or Header  |  1992-05-24  |  1016 b   |  35 lines

  1. // This class reads and parses the user input, checks that a valid
  2. //  verb has been input, and checks for a valid noun.
  3.  
  4. #ifndef WORDS_H
  5. #define WORDS_H
  6.  
  7. #include "flyaway.h"
  8.  
  9. class words @{
  10.  
  11.    enum word verb;
  12.    enum word noun;
  13.    void read_a_line(word &wd1, word &wd2);
  14.    int get_an_ASCII_word(char in_string[]);
  15.    int find_in_dictionary(char in_string[]);
  16.    int is_a_verb(enum word input_word);
  17.    int is_a_noun(enum word input_word);
  18.    int is_a_direction(enum word input_word);
  19.    int is_an_operation(enum word input_word);
  20.  
  21. public:
  22.  
  23.    void get_command(void);
  24.    enum word get_verb(void)  @{ return verb; @};
  25.    enum word get_noun(void)  @{ return noun; @};
  26.    int is_a_verb(void)       @{ return is_a_verb(verb); @};
  27.    int is_a_noun(void)       @{ return is_a_noun(noun); @};
  28.    int is_a_direction(void)  @{ return is_a_direction(verb); @};
  29.    int is_an_operation(void) @{ return is_an_operation(verb); @};
  30.    void stop_game(void)      @{ verb = quit; @};
  31.  
  32. @};
  33.  
  34. #endif
  35.