亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? shadow.cpp

?? 一本外國人寫的關于3D游戲編程的書的源碼
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
{'k',"by the cooling fans.                                                       "},

{'w',"You hear nothing but a slight echo in the heating ducts."},

{'h',"You hear the sounds of music, but you can't make out any of the words or"},
{'h',"melodies.                                                               "},

{'r',"You hear the sound of driping water and the whispers of a femal voice"},
{'r',"ever so faintly in the background.                                   "},

{'e',"You hear the noises of the outside world muffled by the closed door to the"},
{'e',"South.                                                                    "},

{'o',"You hear nothing but the perpetual hum of all the cooling fans within the"},
{'o',"electronic equipment.                                                    "},
{'X',""},

};

int sentence[8];               // this array holds the current sentence
int num_tokens;                // number of words in current sentecne

// this is the player

player you={"Andre'",10,29,NORTH,{' ',' ',' ',' ',' ',' ',' ',' '},0};

int global_exit=0;             // global exit flag

char global_input[128],        // input string
     global_output[128];       // output string

// F U N C T I O N S //////////////////////////////////////////////////////////

char *Get_Line(char *buffer)
{
// this function gets a single line of input and tolerates white space

int c,index=0;

// loop while user hasn't hit return

while((c=getch())!=13)
     {

// implement backspace

     if (c==8 && index>0)
        {

        buffer[--index] = ' ';
        printf("%c %c",8,8);

        } // end if backspace
     else
     if (c>=32 && c<=122)
        {
        buffer[index++] = c;
        printf("%c",c);

        } // end if in printable range

     } // end while

// terminate string

buffer[index] = 0;

// return pointer to buffer or NULL

if (strlen(buffer)==0)
   return(NULL);
else
return(buffer);

} // end Get_Line

////////////////////////////////////////////////////////////////////////////////

int Get_Token(char *input,char *output,int *current_pos)
{

int index,   // loop index and working index
    start,   // points to start of token
    end;     // points to end of token

// set current positions

index=start=end=*current_pos;

// eat white space

while(isspace(input[index]) || ispunct(input[index]))
     {

     index++;

     } // end while

// test if end of string found

if (input[index]==NULL)
   {
   // emit nothing

   strcpy(output,"");
   return(0);

   } // end if no more tokens

// at this point, we must have a token of some kind, so find the end of it

start = index; // mark front of it
end   = index;

// find end of Token

while(!isspace(input[end]) && !ispunct(input[end]) && input[end]!=NULL)
     {

     end++;

     } // end while

// build up output string

for (index=start; index<end; index++)
    {

    output[index-start] = toupper(input[index]);

    } // end copy string

// place terminator

output[index-start] = 0;

// update current string position

*current_pos  = end;

return(end);

} // end Get_Token

///////////////////////////////////////////////////////////////////////////////

int Extract_Tokens(char *string)
{
// this function breaks the input string down into tokens and fills up
// the global sentence array with the tokens so that it can be processed

int curr_pos=0,      // current position in string
    curr_token=0,    // current token number
    found,           // used to flag if the token is valid in language
    index;           // loop index

char output[16];

// reset number of tokens and clear the sentence out

num_tokens=0;

for (index=0; index<8; index++)
    sentence[index]=0;

// extract all the words in the sentence (tokens)

while(Get_Token(string,output,&curr_pos))
     {

     // test to see if this is a valid token

     for (index=0,found=0; index<NUM_TOKENS; index++)
         {

         // do we have a match?

         if (strcmp(output,language[index].symbol)==0)
            {
            // set found flag

            found=1;

            // enter token into sentence

            sentence[curr_token++] = language[index].value;
        //    printf("\nEntering %s, %d in sentence",
        //                               output,language[index].value);

            break;

            } // end if

         } // end for index

         // test if token was part of language (grammar)

         if (!found)
            {
            printf("\n%s, I don't know what \"%s\" means.",you.name
                                                          ,output);

            // failure

            return(0);

            } // end if not found

         // else

         num_tokens++;

     } // end while

return(1);

} // end Extract_Tokens

///////////////////////////////////////////////////////////////////////////////

void Verb_Parser(void)
{
// this function breaks down the sentence and based on the verb calls the
// appropriate "method" or function to apply that verb
// note: syntactic analysis could be done here, but I decided to place it
// in the action verb functions, so that you can see the way the errors are
// detected for each verb (even though there is a a lot of redundancy)

// what is the verb?

switch(sentence[FIRST_WORD])
      {

      case ACTION_MOVE:
           {
           // call the appropriate function

           Verb_MOVE();

           } break;

      case ACTION_TURN:
           {
           // call the appropriate function

           Verb_TURN();

           } break;

      case ACTION_SMELL:
           {
           // call the appropriate function

           Verb_SMELL();

           } break;

      case ACTION_LOOK:
           {
           // call the appropriate function

           Verb_LOOK();

           } break;

      case ACTION_LISTEN:
           {
           // call the appropriate function

           Verb_LISTEN();

           } break;

      case ACTION_PUT:
           {
           // call the appropriate function

           Verb_PUT();

           } break;

      case ACTION_GET:
           {
           // call the appropriate function

           Verb_GET();

           } break;

      case ACTION_EAT:
           {
           // call the appropriate function

           Verb_EAT();

           } break;

      case ACTION_WHERE:
           {
           // call the appropriate function

           Verb_WHERE();

           } break;

      case ACTION_INVENTORY:
           {
           // call the appropriate function

           Verb_INVENTORY();

           } break;

      case ACTION_EXIT:
           {
           // call the appropriate function

           Verb_EXIT();

           } break;

      default:
             {
             printf("\n%s, you must start a sentence with an action verb!",
                    you.name);

             return;

             } break;

      } // end switch

} // end Verb_Parser

// THE ACTION VERBS ///////////////////////////////////////////////////////////

int Verb_MOVE(void)
{
// this function will figure out which way the player wants to move,
// then move the player and test for syntax errors

int token_index,   // current token being processed
    dx,dy;         // ised to hold translation factors

// these look up tables are used to compute the translation factors
// needed to move the player in the requested direction based on the
// current direction, the problem occurs since the directives are not
// absolute directions, they are relative to the direction the player
// is facing

static int forward_x[]={1,-1,0,0};
static int forward_y[]={0,0,-1,1};

static int backward_x[]={-1,1,0,0};
static int backward_y[]={0,0,1,-1};

static int left_x[]={0, 0,-1,1};
static int left_y[]={-1,1,0,0};

static int right_x[]={0,0,1,-1};
static int right_y[]={1,-1,0,0};

// test if player didn't say which way, if so just move forward
// this functionality was added after the fact so is a slight cludge
// it is accomplished by synthetically inserting the direction "forward" into
// the sentence

if (num_tokens==1)
   {
   // no direction given so assume forward

   sentence[SECOND_WORD] = DIR_2_FORWARD;

   num_tokens++;

   } // end if no direction

   // begin further processing to figure out direction

   // check if the next word is a direction and if so move in that
   // direction

   // first test if the words 'to' or 'to the' are inserted bewteen action
   // verb and noun (object).  In this case the phrase "move to the right"
   // sounds ok and should be passed, but "move to the forward" will also
   // be passed even though it is grammatically incorrent, but that's life

   token_index=1;

   if (Check_For_Phrase(PHRASE_TO_THE,token_index))
      {
      // consume preposition since it has to bearing on the final
      // meaning sentence

      // index token scan to directon

      token_index=3;

      } // end if prep and article
   else
   if (Check_For_Phrase(PHRASE_TO,token_index))
      {
      // consume preposition since it has to bearing on the final
      // meaning sentence

      // index token scan to directon

      token_index=2;

      } // end if prep

   // at this point the token_index is pointing to the direction

   if (sentence[token_index] >= DIR_2_START &&
       sentence[token_index] <= DIR_2_END)
      {
      // at this point we finally know what the user is asking for, so
      // let's do it

      // based on direction asked for do movement and collision detection
      // note: the use of look up tables to decrease the complexity of the
      // conditional logic

      dx=dy=0;

      switch(sentence[token_index])
            {

            case DIR_2_FORWARD:  // move player forward
                 {
                 // compute translation factors using look up tables

                 dx = forward_x[you.direction];
                 dy = forward_y[you.direction];

                 } break;

            case DIR_2_BACKWARD: // move player backward
                 {
                 // compute translation factors using look up tables

                 dx = backward_x[you.direction];
                 dy = backward_y[you.direction];

                 } break;

            case DIR_2_RIGHT:    // parry right
                 {
                 // compute translation factors using look up tables

                 dx = right_x[you.direction];
                 dy = right_y[you.direction];

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩专区在线| 老司机精品视频在线| 国产欧美一区二区三区在线老狼| 欧美一三区三区四区免费在线看 | 一区二区三区日韩欧美精品| 中文字幕欧美激情| 中文字幕一区二| 一区二区三区中文字幕电影| 亚洲第一av色| 麻豆国产精品一区二区三区| 久草精品在线观看| 国产福利精品一区| 欧美一区二区三区不卡| 欧美videos大乳护士334| www国产精品av| 国产精品视频一区二区三区不卡| 国产精品久久久久aaaa樱花| 亚洲欧美激情在线| 免费在线看成人av| 国产精品99久久久久久宅男| 97aⅴ精品视频一二三区| 欧美这里有精品| 日韩欧美成人一区| 日韩一区在线播放| 日韩高清一区二区| 粉嫩一区二区三区性色av| 91小宝寻花一区二区三区| 欧美日韩成人高清| 久久精品一级爱片| 亚洲国产一区二区三区青草影视| 另类中文字幕网| 91一区在线观看| 欧美va亚洲va香蕉在线| 亚洲视频精选在线| 精品一区二区三区的国产在线播放 | 91视频免费看| 精品国产一区二区三区不卡| 亚洲精品视频在线| 国产高清一区日本| 538prom精品视频线放| 中文字幕第一页久久| 免费人成在线不卡| 色视频成人在线观看免| 国产日韩欧美一区二区三区乱码| 亚洲高清久久久| 91视频.com| 中文字幕巨乱亚洲| 国产在线不卡一卡二卡三卡四卡| 欧日韩精品视频| 中文字幕一区二区三中文字幕| 日本aⅴ亚洲精品中文乱码| 色欧美乱欧美15图片| 国产精品久久久久久久久免费相片 | 欧美日韩精品系列| 国产精品高潮呻吟| 国产精品亚洲专一区二区三区 | 成人欧美一区二区三区白人| 麻豆精品国产传媒mv男同| 欧美午夜精品电影| 中文字幕在线不卡一区| 国产成人综合精品三级| 精品久久久久av影院| 日本伊人午夜精品| 欧美日韩一卡二卡三卡| 夜夜嗨av一区二区三区网页| 成人精品免费看| 日韩和的一区二区| 欧美视频一区二区三区四区| 亚洲精品日韩专区silk| 色综合久久久久综合体 | 在线观看视频欧美| 综合欧美一区二区三区| 99精品视频在线观看免费| 国产精品久久三区| 91美女视频网站| 亚洲天堂精品视频| 日本韩国欧美在线| 亚洲综合视频在线| 精品视频资源站| 五月婷婷综合在线| 91精品久久久久久久久99蜜臂| 日韩精品一级二级 | 亚洲品质自拍视频网站| 色婷婷精品久久二区二区蜜臂av| 亚洲人吸女人奶水| 3atv在线一区二区三区| 久久成人免费电影| 国产精品污污网站在线观看| 91蝌蚪porny九色| 亚洲3atv精品一区二区三区| 欧美一区二区视频在线观看2020 | 日韩精品一区二区三区swag | 亚洲影视资源网| 欧美精品久久99| 国内精品久久久久影院一蜜桃| 欧美精品一区二区三区久久久 | 日韩欧美在线观看一区二区三区| 久久国产精品99久久人人澡| 欧美国产欧美综合| 欧美日韩在线播| 久久99精品国产91久久来源| 欧美国产禁国产网站cc| 欧美在线观看18| 国产精品69毛片高清亚洲| 一区二区在线观看免费视频播放| 欧美一区二区三区公司| av亚洲精华国产精华| 三级一区在线视频先锋 | 99久久精品国产一区二区三区 | 午夜亚洲福利老司机| 久久久久久久网| 欧美三级电影在线观看| 国产馆精品极品| 日本亚洲天堂网| 亚洲精品视频在线看| 久久一二三国产| 欧美日韩另类一区| 成人视屏免费看| 精品一区二区免费看| 亚洲高清免费在线| 国产精品美女久久久久久久久久久| 欧美日韩一区二区欧美激情| 国产91在线看| 久久电影网站中文字幕| 香蕉久久夜色精品国产使用方法| 日本一区二区视频在线| 日韩欧美中文一区| 欧美日韩国产大片| 91猫先生在线| 波多野结衣精品在线| 国产欧美精品一区| 91蜜桃免费观看视频| 亚洲一区二区三区四区的| 成人国产一区二区三区精品| 亚洲自拍偷拍九九九| 午夜精品久久久久影视| 91国偷自产一区二区使用方法| 天天免费综合色| 亚洲免费观看在线观看| 中文字幕在线不卡一区二区三区| 久久久综合视频| 精品国产免费人成电影在线观看四季| 欧美片在线播放| 欧美精品久久99久久在免费线| 欧美日韩在线电影| 欧美色综合网站| 欧美日高清视频| 欧美日产在线观看| 欧美精品丝袜中出| 91精品国产麻豆国产自产在线| 欧美日韩一级片网站| 在线91免费看| 精品久久五月天| 久久精品一级爱片| 国产精品理论在线观看| 国产女人aaa级久久久级| 国产精品私人影院| 亚洲欧洲三级电影| 亚洲卡通动漫在线| 丝袜脚交一区二区| 亚洲国产精品尤物yw在线观看| 一片黄亚洲嫩模| 亚洲国产欧美一区二区三区丁香婷| 中文字幕一区二区三区不卡在线 | 韩国女主播成人在线| 国产乱码精品一区二区三 | 午夜成人免费电影| 久久精品999| 成人性生交大合| 日本韩国欧美一区二区三区| 欧美日韩一区二区不卡| 欧美成人aa大片| 国产精品成人一区二区三区夜夜夜 | 国产呦萝稀缺另类资源| 成人18精品视频| 欧美精品亚洲二区| 国产日本欧美一区二区| 亚洲丰满少妇videoshd| 国产美女久久久久| 色综合久久99| 精品女同一区二区| 亚洲欧美日韩在线| 久久精品国产亚洲aⅴ| eeuss鲁一区二区三区| 欧美肥妇free| 中文字幕亚洲一区二区av在线| 一区二区三区四区激情| 国产专区综合网| 欧美日韩日本视频| 国产精品区一区二区三区| 五月激情综合网| 99久久婷婷国产综合精品电影| 欧美日韩精品久久久| 欧美激情一区二区| 久久精品国产99| 欧洲色大大久久| 中文在线一区二区| 极品少妇xxxx偷拍精品少妇| 色综合久久久久综合99| 日本一区二区电影|