⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 parser.h

📁 焰火演示
💻 H
字号:
/*--------------------------------------------------------------------------*\
| PARSER.H                                                                   |
\*--------------------------------------------------------------------------*/

/*
   Adventure Parser
*/

#define v_sig 4               /* 1st 4 letters of vocab words significant */

#define max_cmd_size 64                /* at most 63 chars per command */
#define max_cmd_len max_cmd_size-1

#define max_word_size 16               /* at most 15 chars per word in input */
#define max_word_len max_word_size-1

typedef char v_cmd [max_cmd_size ];
typedef char v_word [max_word_size ];  /* a vocabulary (normal) word */


typedef struct        /* a command */
{
  v_cmd
    cm;               /* command entered */

  v_word
    verb,             /* verb part */
    noun,             /* noun part */
    sh_verb,          /* short form of verb and noun for comparison */
    sh_noun;

  int
    vn,               /* verb # in vocab */
    nn;               /* noun # in vocab */
}
CmdRec;


ParseCommand( char *cm, char *verb, char *noun );
resize_word( char *s );
int GetWordNum( char *w,   vocab_type *voc );
int GetVerbNum( char *verb );
int GetNounNum( char *noun );
AnalyseCommand( CmdRec *cmd );


extern
  CmdRec cmd;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -