亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 編程 > C > 正文

2048小游戲C語言實現代碼

2020-01-26 13:43:06
字體:
來源:轉載
供稿:網友

本文實例為大家分享了C語言實現2048游戲的具體代碼,供大家參考,具體內容如下

大一時學c語言寫的,寫的不好但當時感覺還行。

環境運行 vc6.0 ,cpp文件。

基本上是c寫的,但是改變字體顏色,在控制臺移動光標等等好像不是c中的。

代碼:

#include<time.h> #include<stdlib.h> #include<conio.h> #include<stdio.h> #include<windows.h> #define x0 26 #define y0 1 HANDLE hOutput=GetStdHandle(STD_OUTPUT_HANDLE); /*顯示聲明*/ void p(int*a,int i,int x,int y); /*部分刷新聲明*/ void shua(void); /*勝利畫面測試函數聲明*/ int test(void); /*字體空格聲明*/ void kg(int*a); /*畫長條函數的聲明*/ void ct(int x,int y,int l,int k,int c); /*標題字幕2048*/ void p2048(int x,int y); /*單個顏色返回值聲明*/ int col(int*a); /*移動光標*/ void gotoxy(int x,int y) {  COORD coordScreen={0,0};  coordScreen.X=x;  coordScreen.Y=y;  SetConsoleCursorPosition(hOutput,coordScreen); } /*字體顏色*/ void textcolor(int color) {  SetConsoleTextAttribute(hOutput,color); } /*顯示函數*/ void prin(int*a,int*score,int*scoremax) {  int i;  for (i = 0; i < 16; i++)  {   p(a,i,x0,y0);  }  printf("/n/n       score=%d MAXscore=%d     /n", *score, *scoremax); } /* 產生隨機數 */ int shu(void) {  int s = 0;  s = 1 + (int)(12.0 * rand() / (RAND_MAX + 1.0));  if (s == 12)   return 4;  else   return 2; }  /* 決定位置 */ int rands(void) {  return (int)(16.0 * rand() / (RAND_MAX + 1.0)); } /* 主函數*/ int main(void) {  int flag = 0, c = 0, pd = 1, n = 0, i = 0, m = 0, j =   0, sj, sj1, sj2, a[16] = { 0 }, b[16] ={0}, x = 0, score = 0, t = 0, jx = 0, scoremax = 0,ks=1,yx=0;   char sr,an;   //開始畫面   p2048(17,1);   textcolor(255);   gotoxy(35,15);   for(;;)   {    an=getch();   switch(an)   {   case 72:    if(ks==1)     ks=0;    else     ks=1;   break;   case 80:    if(ks==1)     ks=0;    else     ks=1;   break;   case '/r':    yx=1;    break;   default:   break;   }   if(ks==1)    gotoxy(35,15);   else    gotoxy(34,18);   if(ks==1&&yx==1)    break;   else if(ks==0&&yx==1)   {   textcolor(240);   gotoxy(0,0);   for(i=0;i<=500;i++)   {    printf("  ");   }   gotoxy(0,0);   ct(12,5,58,10,223);   gotoxy(13,6);   printf("      2048游戲說明");   gotoxy(13,8);   printf(" 通過按數字鍵移動數字,合并相同的數字來的取得更大的數。");   gotoxy(13,9);   printf(" 得到2048時游戲即勝利,當然您也可以選擇繼續挑戰。");   gotoxy(13,11);   printf(" 按鍵操作:");   gotoxy(13,13);   printf(" 上:↑ 下:↓ 左:← 右:→ 重新開始:r 退出游戲:e");   textcolor(240);   printf("/n/n/n/n/n               I know ");   getch();   p2048(17,1);   textcolor(255);   gotoxy(34,18);   }   yx=0;   }   //隱藏光標   HANDLE hOut=GetStdHandle(STD_OUTPUT_HANDLE);   CONSOLE_CURSOR_INFO cci;   GetConsoleCursorInfo(hOut,&cci);   cci.bVisible=FALSE;   SetConsoleCursorInfo(hOut,&cci);   //刷新畫面   textcolor(240);   gotoxy(0,0);   for(i=0;i<=500;i++)   {    printf("  ");   }   gotoxy(0,0);   /*設置時間種子*/   srand((int)time(0));   /* 設置初始值 */   sj = rands();   sj1 = rands();   sj2 = rands();   for (;;)   {    if (sj == sj1 || sj == sj2 || sj1 == sj2)    {     sj1 = rands();     sj2 = rands();    }    else     break;   }   a[sj] = shu();   a[sj1] = shu();   a[sj2] = shu();   /*顯示*/   prin(a,&score,&scoremax);   for (;;)   {    /* 無回顯輸入 */    sr = getch();    /* scanf("%d",&n); *//* 記錄之前的位置,將用以比較移動是否有效 */    for (j = 0; j < 16; j++)     b[j] = a[j];    switch (sr)    {     /* 向上移動 */    case 72:     /* 全部移到上邊 */     for (j = 0; j < 4; j++)     {      for (c = 0; c < 3; c++)      {       if (a[j] == 0)       {        a[j] = a[j + 4];        a[j + 4] = 0;       }       if (a[j + 4] == 0)       {        a[j + 4] = a[j + 8];        a[j + 8] = 0;       }       if (a[j + 8] == 0)       {        a[j + 8] = a[j + 12];        a[j + 12] = 0;       }      }      /* 移到上面后的合并操作 */      if (a[j] == a[j + 4])      {       a[j] = a[j] * 2;       score = score + a[j];       a[j + 4] = a[j + 8];       a[j + 8] = a[j + 12];       a[j + 12] = 0;       if (a[j + 4] == a[j + 8])       {        a[j + 4] = 2 * a[j + 4];        score = score + a[j + 4];        a[j + 8] = 0;       }      }      else if (a[j + 4] == a[j + 8])      {       a[j + 4] = 2 * a[j + 4];       score = score + a[j + 4];       a[j + 8] = a[j + 12];       a[j + 12] = 0;      }      else if (a[j + 8] == a[j + 12])      {       a[j + 8] = 2 * a[j + 8];       score = score + a[j + 8];       a[j + 12] = 0;      }      else;     }     break;     /* 向下移動 */    case 80:     /* 全部移動到下面 */     for (j = 12; j < 16; j++)     {      for (c = 0; c < 3; c++)      {       if (a[j] == 0)       {        a[j] = a[j - 4];        a[j - 4] = 0;       }       if (a[j - 4] == 0)       {        a[j - 4] = a[j - 8];        a[j - 8] = 0;       }       if (a[j - 8] == 0)       {        a[j - 8] = a[j - 12];        a[j - 12] = 0;       }      }      /* 移到下面后的合并操作 */      if (a[j] == a[j - 4])      {       a[j] = a[j] * 2;       score = score + a[j];       a[j - 4] = a[j - 8];       a[j - 8] = a[j - 12];       a[j - 12] = 0;       if (a[j - 4] == a[j - 8])       {        a[j - 4] = 2 * a[j - 4];        score = score + a[j - 4];        a[j - 8] = 0;       }      }      else if (a[j - 4] == a[j - 8])      {       a[j - 4] = 2 * a[j - 4];       score = score + a[j - 4];       a[j - 8] = a[j - 12];       a[j - 12] = 0;      }      else if (a[j - 8] == a[j - 12])      {       a[j - 8] = 2 * a[j - 8];       score = score + a[j - 8];       a[j - 12] = 0;      }      else;     }     break;     /* 向左移動 */    case 75:     /* 全部移動到左面 */     for (j = 0; j <= 12; j = j + 4)     {      for (c = 0; c < 3; c++)      {       if (a[j] == 0)       {        a[j] = a[j + 1];        a[j + 1] = 0;       }       if (a[j + 1] == 0)       {        a[j + 1] = a[j + 2];        a[j + 2] = 0;       }       if (a[j + 2] == 0)       {        a[j + 2] = a[j + 3];        a[j + 3] = 0;       }      }      /* 移到左面后的合并操作 */      if (a[j] == a[j + 1])      {       a[j] = a[j] * 2;       score = score + a[j];       a[j + 1] = a[j + 2];       a[j + 2] = a[j + 3];       a[j + 3] = 0;       if (a[j + 1] == a[j + 2])       {        a[j + 1] = 2 * a[j + 1];        score = score + a[j + 1];        a[j + 2] = 0;       }      }      else if (a[j + 1] == a[j + 2])      {       a[j + 1] = 2 * a[j + 1];       score = score + a[j + 1];       a[j + 2] = a[j + 3];       a[j + 3] = 0;      }      else if (a[j + 2] == a[j + 3])      {       a[j + 2] = 2 * a[j + 2];       score = score + a[j + 2];       a[j + 3] = 0;      }      else;     }     break;     /* 向右移動 */    case 77:     /* 全部移動到右面 */     for (j = 3; j <= 16; j = j + 4)     {      for (c = 0; c < 3; c++)      {       if (a[j] == 0)       {        a[j] = a[j - 1];        a[j - 1] = 0;       }       if (a[j - 1] == 0)       {        a[j - 1] = a[j - 2];        a[j - 2] = 0;       }       if (a[j - 2] == 0)       {        a[j - 2] = a[j - 3];        a[j - 3] = 0;       }      }      /* 移到右面后的合并操作 */      if (a[j] == a[j - 1])      {       a[j] = a[j] * 2;       score = score + a[j];       a[j - 1] = a[j - 2];       a[j - 2] = a[j - 3];       a[j - 3] = 0;       if (a[j - 1] == a[j - 2])       {        a[j - 1] = 2 * a[j - 1];        score = score + a[j - 1];        a[j - 2] = 0;       }      }      else if (a[j - 1] == a[j - 2])      {       a[j - 1] = 2 * a[j - 1];       score = score + a[j - 1];       a[j - 2] = a[j - 3];       a[j - 3] = 0;      }      else if (a[j - 2] == a[j - 3])      {       a[j - 2] = 2 * a[j - 2];       score = score + a[j - 2];       a[j - 3] = 0;      }      else;     }     break;     /* 重新開始 */    case 'r':     for (j = 0; j < 16; j++)      a[j] = 0;     sj1 = rands();     sj2 = rands();     for (;;)     {      if (sj1 == sj2)      {       sj1 = rands();       sj2 = rands();      }      else       break;     }     a[sj1] = shu();     a[sj2] = shu();     flag = 0;     score = 0;     jx = 0;     break;     /* 退出 */    case 'e':     shua();     ct(32,19,15,3,207);     printf(" 游戲已退出!");     textcolor(255);     gotoxy(0,0);     getch();     return 0;     break;     /* 其他情況(刷新) */    default:     ;     break;   }         /*windows下的系統清屏函數*/   //system ("cls");   /* 判斷最高分 */   if (score > scoremax)    scoremax = score;   /* 判斷是否勝利(是否含有2048) */   for (j = 0; j < 16; j++)   {    if (a[j] == 2048 && jx == 0)    {     /* 勝利時輸出游戲結果 */     /*顯示*/     prin(a,&score,&scoremax);     shua();     ct(20,19,15,3,207);     printf(" 游戲勝利!");     textcolor(159);     gotoxy(38,19);     printf(" Continue    ");     textcolor(239);     gotoxy(49,20);     printf(" Restart ");     textcolor(175);     gotoxy(49,21);     printf(" Exit  ");     t=2;     an=75;     yx=0;     for(;;)     {      an=getch();      switch(an)      {      case 72:       if(t==2)       {        t=3;      textcolor(240);      gotoxy(36,21);      printf("       ");      textcolor(175);      gotoxy(38,21);      printf(" Exit     ");      textcolor(240);      gotoxy(36,19);      printf("       ");      textcolor(159);      gotoxy(47,19);      printf("  Continue ");      textcolor(240);      gotoxy(36,20);      printf("       ");      textcolor(239);      gotoxy(49,20);      printf(" Restart ");       }       else if(t==1)       {        t=2;        textcolor(240);      gotoxy(36,19);      printf("       ");      textcolor(159);      gotoxy(38,19);      printf(" Continue    ");      textcolor(240);      gotoxy(36,20);      printf("       ");      textcolor(239);      gotoxy(47,20);      printf("  Restart ");      textcolor(240);      gotoxy(36,21);      printf("       ");      textcolor(175);      gotoxy(49,21);      printf(" Exit  ");       }       else       {        t=1;        textcolor(240);      gotoxy(36,20);      printf("       ");      textcolor(239);      gotoxy(38,20);      printf(" Restart     ");      textcolor(240);      gotoxy(36,21);      printf("       ");      textcolor(175);      gotoxy(47,21);      printf("  Exit  ");       textcolor(240);      gotoxy(36,19);      printf("       ");      textcolor(159);      gotoxy(49,19);      printf(" Continue ");       }       break;      case 80:       if(t==2)       {        t=1;         textcolor(240);      gotoxy(36,20);      printf("       ");      textcolor(239);      gotoxy(38,20);      printf(" Restart     ");      textcolor(240);      gotoxy(36,19);      printf("       ");      textcolor(159);      gotoxy(47,19);      printf("  Continue ");      textcolor(240);      gotoxy(36,21);      printf("       ");      textcolor(175);      gotoxy(49,21);      printf(" Exit  ");       }       else if(t==1)       {        t=3;        textcolor(240);      gotoxy(36,21);      printf("       ");      textcolor(175);      gotoxy(38,21);      printf(" Exit     ");      textcolor(240);      gotoxy(36,20);      printf("       ");      textcolor(239);      gotoxy(47,20);      printf("  Restart ");      textcolor(240);      gotoxy(36,19);      printf("       ");      textcolor(159);      gotoxy(49,19);      printf(" Continue ");       }       else       {       t=2;       textcolor(240);      gotoxy(36,19);      printf("       ");      textcolor(159);      gotoxy(38,19);      printf(" Continue    ");      textcolor(240);      gotoxy(36,21);      printf("       ");      textcolor(175);      gotoxy(47,21);      printf("  Exit  ");       textcolor(240);      gotoxy(36,20);      printf("       ");      textcolor(239);      gotoxy(49,20);      printf(" Restart ");       }       break;      case '/r':       yx=1;       break;      }      if(yx==1)      {       yx=0;       break;      }     }     shua();     textcolor(255);     gotoxy(0,0);     /* 重新開始游戲 */     if (t == 1)     {      shua();      pd = 1;      x = 0;      for (j = 0; j < 16; j++)       a[j] = 0;      sj1 = rands();      sj2 = rands();      for (;;)      {       if (sj1 == sj2)       {        sj1 = rands();        sj2 = rands();       }       else        break;      }      a[sj1] = shu();      a[sj2] = shu();      for (j = 0; j < 16; j++)       b[j] = a[j];      flag = 0;      score = 0;      break;     }     /* 繼續游戲 */     else if (t == 2)     {      jx = 1;      shua();     }     else     {      shua();      ct(32,19,15,3,207);      printf(" 游戲已退出!");      textcolor(255);      gotoxy(0,0);      getch();      return 0;     }    }   }         /* 決定是否產生新的數及其位置以及游戲是否失敗 */   /* flag,pd,x賦初值 */   flag = 0;   pd = 1;   x = 0;   /* 判斷移動后是否有空位:pd=0為有空位,pd=1為無空位 */   for (j = 0; j < 16; j++)   {    if (a[j] == 0)     pd = 0;   }   /* 移動是否有效:x=1有效,x=0無效 */   for (j = 0; j < 16; j++)   {    if (a[j] != b[j])    {     x = 1;     break;    }   }   /* 移動有效時且有空位時產生新數 */   if (pd == 0 && x == 1)   {    for (;;)    {     sj = rands();     if (a[sj] == 0)     {      a[sj] = shu();      break;     }     else;    }   }   /* 游戲是否失敗的判定 */   /* 移動后無空位 */   else if (pd != 0)   {    /* 判斷是否還有可合并的項 */    for (j = 0; j < 16; j++)    {     if (j != 3 && j != 7 && j != 11 && j != 15 && a[j] == a[j + 1])     {      flag = flag + 1;     }     if (j != 12 && j != 13 && j != 14 && j != 15      && a[j] == a[j + 4])     {      flag = flag + 1;     }     if (j != 0 && j != 4 && j != 8 && j != 12 && a[j] == a[j - 1])     {      flag = flag + 1;     }     if (j != 0 && j != 1 && j != 2 && j != 3 && a[j] == a[j - 4])     {      flag = flag + 1;     }    }         /* 無空位且沒有可合并的項時游戲失敗 */    if (flag == 0)    {     /* 失敗時輸出游戲結果 */     /*顯示*/     prin(a,&score,&scoremax);     shua();     ct(20,19,15,3,271);     printf(" 游戲結束!");     textcolor(240);     gotoxy(38,19);     printf("Whether continue the game ?");     gotoxy(44,21);     printf("@Yes  No");     gotoxy(44,21);     t=1;     an=75;     yx=0;     for(;;)     {      an=getch();      switch(an)      {      case 75:       if(t==1)       {        t=0;        gotoxy(53,21);        printf("@");        gotoxy(44,21);        printf(" ");       }       else       {        t=1;        gotoxy(44,21);        printf("@");        gotoxy(53,21);        printf(" ");       }       break;      case 77:       if(t==1)       {        t=0;        gotoxy(53,21);        printf("@");        gotoxy(44,21);        printf(" ");        }       else       {        t=1;        gotoxy(44,21);        printf("@");        gotoxy(53,21);        printf(" ");       }       break;      case '/r':       yx=1;       break;      }      if(yx==1)      {       yx=0;       break;      }     }     shua();     textcolor(255);     gotoxy(0,0);     if (t == 1)     {      for (j = 0; j < 16; j++)       a[j] = 0;      sj=rands();      sj1 = rands();      sj2 = rands();      for (;;)      {       if (sj1 ==sj2||sj1==sj||sj2==sj)       {        sj1 = rands();        sj2 = rands();       }       else        break;      }      a[sj]=shu();      a[sj1] = shu();      a[sj2] = shu();      score = 0;      jx = 0;     }     else     {      shua();      ct(32,19,15,3,207);      printf(" 游戲已退出!");      textcolor(255);      gotoxy(0,0);      getch();      return 0;     }    }   }   else;   /* 顯示結果 */   prin(a,&score,&scoremax);  }  return 0; } /*顯示函數*/ void p(int*a,int i,int x,int y) {  int x1=x,y1=y;  textcolor(col(a+i));  x1=x+(i%4)*7;  y1=y+(i/4)*4;  gotoxy(x1,y1);  printf("  ");  gotoxy(x1,y1+1);  kg(a+i);  gotoxy(x1,y1+2);  printf("  ");  textcolor(240); } /*字體空格聲明*/ void kg(int*a) {  if(*a==0)   printf("  ",*a);  else if(*a<10)   printf(" %d ",*a);  else if(*a<100)   printf(" %d ",*a);  else if(*a<1000)   printf(" %d ",*a);  else if(*a<10000)   printf("%d ",*a);  else   printf("%d",*a); } /*單個顏色返回值*/ int col(int*a) { int co=127; if(*(a)==0) co=127; else if(*(a)==2) co=143; else if(*(a)==4) co=191; else if(*(a)==8) co=175; else if(*(a)==16) co=239; else if(*(a)==32) co=223; else if(*(a)==64) co=207; else if(*(a)==128) co=95; else if(*(a)==256) co=159; else if(*(a)==512) co=63; else if(*(a)==1024) co=111; else if(*(a)==2048) co=79; else if(*(a)==4096) co=287; else co=271; return co; } /*標題字幕2048*/ void p2048(int x,int y) {  int i;  textcolor(240);  gotoxy(0,0);  for(i=0;i<=500;i++)   {    printf("  ");   }  //2  textcolor(207);  gotoxy(x,y);  printf("   ");  gotoxy(x,y+1);  printf("   ");  gotoxy(x+7,y+2);  printf(" ");  gotoxy(x+7,y+3);  printf(" ");  gotoxy(x,y+4);  printf("   ");  gotoxy(x,y+5);  printf("   ");  gotoxy(x,y+6);  printf(" ");  gotoxy(x,y+7);  printf(" ");  gotoxy(x,y+8);  printf("   ");  gotoxy(x,y+9);  printf("   ");  //0  textcolor(239);  gotoxy(x+13,y);  printf("   ");  gotoxy(x+13,y+1);  printf("   ");  gotoxy(x+13,y+2);  printf(" ");  gotoxy(x+13+7,y+2);  printf(" ");  gotoxy(x+13,y+3);  printf(" ");  gotoxy(x+13+7,y+3);  printf(" ");  gotoxy(x+13,y+4);  printf(" ");  gotoxy(x+13+7,y+4);  printf(" ");  gotoxy(x+13,y+5);  printf(" ");  gotoxy(x+13+7,y+5);  printf(" ");  gotoxy(x+13,y+6);  printf(" ");  gotoxy(x+13+7,y+6);  printf(" ");  gotoxy(x+13,y+7);  printf(" ");  gotoxy(x+13+7,y+7);  printf(" ");  gotoxy(x+13,y+8);  printf("   ");  gotoxy(x+13,y+9);  printf("   ");  //4  textcolor(159);  gotoxy(x+26,y);  printf(" ");  gotoxy(x+26+7,y);  printf(" ");  gotoxy(x+26,y+1);  printf(" ");  gotoxy(x+26+7,y+1);  printf(" ");  gotoxy(x+26,y+2);  printf(" ");  gotoxy(x+26+7,y+2);  printf(" ");  gotoxy(x+26,y+3);  printf(" ");  gotoxy(x+26+7,y+3);  printf(" ");  gotoxy(x+26,y+4);  printf("   ");  gotoxy(x+26,y+5);  printf("   ");  gotoxy(x+26,y+6);  printf(" ");  gotoxy(x+26,y+7);  printf(" ");  gotoxy(x+26,y+8);  printf(" ");  gotoxy(x+26,y+9);  printf(" ");  //8  textcolor(175);  for(i=0;i<10;i++)  {  gotoxy(x+39,y+i);  printf("   ");  }  textcolor(240);  gotoxy(x+42,y+2);  printf(" ");  gotoxy(x+42,y+3);  printf(" ");  gotoxy(x+42,y+6);  printf(" ");  gotoxy(x+42,y+7);  printf(" ");  //長條   ct(35,15,20,1,240);   printf(" Game Sart");   ct(35,18,20,1,240);   printf("How to play");   printf("/n");   printf("/n/n/n               Made by Mr Yan");   gotoxy(35-25,15);   textcolor(255);   gotoxy(0,0); } /*畫長條函數*/ void ct(int x,int y,int l,int k,int c) {  int i=0,j=0;  textcolor(c);  gotoxy(x,y);  for(i=0;i<k;i++)  {  gotoxy(x,y+i);  for(j=0;j<l;j++)  {  printf(" ");  }  }  gotoxy(x+1,y+k/2); } void shua(void) {  gotoxy(0,18);  textcolor(255);  printf("                 /n");  printf("                 /n");  printf("                 /n");  printf("                 /n");  printf("                 /n");  printf("                 /n");  gotoxy(0,0); } /*勝利畫面測試函數*/ int test(void) {  int i,t,yx;  char an;   textcolor(240);   gotoxy(0,0);   for(i=0;i<=500;i++)   {    printf("  ");   }   gotoxy(0,0);   HANDLE hOut=GetStdHandle(STD_OUTPUT_HANDLE);   CONSOLE_CURSOR_INFO cci;   GetConsoleCursorInfo(hOut,&cci);   cci.bVisible=FALSE;   SetConsoleCursorInfo(hOut,&cci);     //printf("/n游戲勝利!t/n重新開始游戲請按1/n繼續游戲請按2/n退出請按其他鍵3/n"); 2 1 3                       /*  2 繼續選中 textcolor(240);      gotoxy(36,19);      printf("       ");      textcolor(159);      gotoxy(38,19);      printf(" Continue    ");   2 繼續平常 textcolor(240);      gotoxy(36,19);      printf("       ");      textcolor(159);      gotoxy(49,19);      printf(" Continue ");   1 重新選中 textcolor(240);      gotoxy(36,20);      printf("       ");      textcolor(239);      gotoxy(38,20);      printf(" Restart     ");   1 重新平常 textcolor(240);      gotoxy(36,20);      printf("       ");      textcolor(239);      gotoxy(49,20);      printf(" Restart ");   3 退出選中 textcolor(240);      gotoxy(36,21);      printf("       ");      textcolor(175);      gotoxy(38,21);      printf(" Exit     ");   3 退出平常 textcolor(240);      gotoxy(36,21);      printf("       ");      textcolor(175);      gotoxy(49,21);      printf(" Exit  ");    //  0000000000000000000000000 24    */     shua();     ct(20,19,15,3,207);     printf(" 游戲勝利!");     textcolor(159);     gotoxy(38,19);     printf(" Continue    ");      textcolor(239);     gotoxy(49,20);     printf(" Restart ");     textcolor(175);     gotoxy(49,21);     printf(" Exit  ");     t=2;     an=75;     yx=0;     for(;;)     {      an=getch();      switch(an)      {      case 72:       if(t==2)       {        t=3;      textcolor(240);      gotoxy(36,21);      printf("       ");      textcolor(175);      gotoxy(38,21);      printf(" Exit     ");      textcolor(240);      gotoxy(36,19);      printf("       ");      textcolor(159);      gotoxy(47,19);      printf("  Continue ");      textcolor(240);      gotoxy(36,20);      printf("       ");      textcolor(239);      gotoxy(49,20);      printf(" Restart ");       }       else if(t==1)       {        t=2;        textcolor(240);      gotoxy(36,19);      printf("       ");      textcolor(159);      gotoxy(38,19);      printf(" Continue    ");      textcolor(240);      gotoxy(36,20);      printf("       ");      textcolor(239);      gotoxy(47,20);      printf("  Restart ");      textcolor(240);      gotoxy(36,21);      printf("       ");      textcolor(175);      gotoxy(49,21);      printf(" Exit  ");       }       else       {        t=1;        textcolor(240);      gotoxy(36,20);      printf("       ");      textcolor(239);      gotoxy(38,20);      printf(" Restart     ");      textcolor(240);      gotoxy(36,21);      printf("       ");      textcolor(175);      gotoxy(47,21);      printf("  Exit  ");       textcolor(240);      gotoxy(36,19);      printf("       ");      textcolor(159);      gotoxy(49,19);      printf(" Continue ");       }       break;      case 80:       if(t==2)       {        t=1;         textcolor(240);      gotoxy(36,20);      printf("       ");      textcolor(239);      gotoxy(38,20);      printf(" Restart     ");      textcolor(240);      gotoxy(36,19);      printf("       ");      textcolor(159);      gotoxy(47,19);      printf("  Continue ");      textcolor(240);      gotoxy(36,21);      printf("       ");      textcolor(175);      gotoxy(49,21);      printf(" Exit  ");       }       else if(t==1)       {        t=3;        textcolor(240);      gotoxy(36,21);      printf("       ");      textcolor(175);      gotoxy(38,21);      printf(" Exit     ");      textcolor(240);      gotoxy(36,20);      printf("       ");      textcolor(239);      gotoxy(47,20);      printf("  Restart ");      textcolor(240);      gotoxy(36,19);      printf("       ");      textcolor(159);      gotoxy(49,19);      printf(" Continue ");       }       else       {       t=2;       textcolor(240);      gotoxy(36,19);      printf("       ");      textcolor(159);      gotoxy(38,19);      printf(" Continue    ");      textcolor(240);      gotoxy(36,21);      printf("       ");      textcolor(175);      gotoxy(47,21);      printf("  Exit  ");       textcolor(240);      gotoxy(36,20);      printf("       ");      textcolor(239);      gotoxy(49,20);      printf(" Restart ");       }       break;      case '/r':       yx=1;       break;      }      if(yx==1)      {       yx=0;       break;      }     }     shua();     textcolor(255);     gotoxy(0,0);     textcolor(240);     if(t==2)      printf("Continue  ");     else if(t==1)      printf("Restart  ");     else      printf("Exit   ");     return 0; } 

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持武林網。

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
社区色欧美激情 | 日韩欧美在线视频| 国产在线a不卡| 亚洲人成毛片在线播放| 国产美女精彩久久| 欧美第一淫aaasss性| 成人性教育视频在线观看| 国产欧美久久久久久| 国产精品白丝jk喷水视频一区| 久久国产精品久久国产精品| 久久综合国产精品台湾中文娱乐网| 黑人巨大精品欧美一区免费视频| 主播福利视频一区| 国产精品女人久久久久久| 国产成人精品电影久久久| 日韩毛片中文字幕| 日韩av在线高清| 国内精品久久久久久久久| 色综合伊人色综合网| 亚洲国产日韩欧美在线动漫| 精品久久久久久久中文字幕| 色与欲影视天天看综合网| 欧美激情成人在线视频| 国产成人在线播放| 亚洲美女动态图120秒| 亚洲美女性视频| 亚洲www在线| 91精品久久久久久久久青青| 亚洲国产97在线精品一区| 欧美激情在线狂野欧美精品| 欧美大尺度在线观看| 欧美日韩国产精品| 久久69精品久久久久久国产越南| 国产视频精品在线| 精品夜色国产国偷在线| 在线视频免费一区二区| 欧美性资源免费| 中文字幕不卡av| 中文字幕日韩电影| 日韩av在线精品| 欧美超级乱淫片喷水| 欧美视频专区一二在线观看| 亚洲大胆人体视频| 91精品国产高清久久久久久| 欧美主播福利视频| 国内精品久久久久影院 日本资源| 久久久97精品| 黑人巨大精品欧美一区二区免费| 91香蕉嫩草神马影院在线观看| 日日摸夜夜添一区| 久久精品中文字幕一区| 26uuu国产精品视频| 久久久久久久久久久国产| 性欧美暴力猛交69hd| 国产精品久久久久久久久久东京| 欧美激情一区二区三区成人| 亚洲精品资源美女情侣酒店| 7777精品久久久久久| 欧美激情网站在线观看| 欧美野外猛男的大粗鳮| 欧美性xxxxx极品| 亚洲色图国产精品| 欧美精品一本久久男人的天堂| 91sao在线观看国产| 日本高清+成人网在线观看| 激情久久av一区av二区av三区| 欧美肥婆姓交大片| 高清亚洲成在人网站天堂| 亚洲男人天天操| 亚洲欧美日韩图片| 国产精品18久久久久久首页狼| 在线播放亚洲激情| 日韩综合视频在线观看| 亚洲大胆人体在线| 在线播放国产一区中文字幕剧情欧美| 不卡在线观看电视剧完整版| 97高清免费视频| 久久99热精品这里久久精品| 亚洲aⅴ男人的天堂在线观看| 欧美一乱一性一交一视频| 国产亚洲视频在线观看| 性欧美xxxx交| 色噜噜狠狠狠综合曰曰曰88av| 成人精品在线视频| 国产精品高清在线| 久久亚洲私人国产精品va| 成人久久18免费网站图片| 国产日韩欧美视频在线| 色老头一区二区三区在线观看| 黑人巨大精品欧美一区二区三区| 日韩美女在线观看一区| 91视频免费网站| 欧美性猛交99久久久久99按摩| 91九色国产社区在线观看| 国产亚洲一区精品| 亲爱的老师9免费观看全集电视剧| 亚洲成人黄色在线观看| 亚洲欧美中文字幕| 日韩在线视频导航| 久久久最新网址| 69久久夜色精品国产69乱青草| 国产欧美日韩精品丝袜高跟鞋| 国产91精品久久久久久| 国产精品一区二区三区在线播放| 国产成人一区二区在线| 国产精品高清免费在线观看| 欧美精品免费播放| 欧美激情a∨在线视频播放| 亚洲精品国产精品国自产观看浪潮| 日韩av第一页| 久久久国产精彩视频美女艺术照福利| 亚洲成人黄色在线| 欧美大胆在线视频| 欧美日本啪啪无遮挡网站| 亚洲伊人成综合成人网| 91精品在线影院| 午夜精品一区二区三区在线视| 久久久成人精品| 亚洲国产高清高潮精品美女| 蜜月aⅴ免费一区二区三区| 亚洲色图偷窥自拍| 国自产精品手机在线观看视频| 欧美电影第一页| 黄色精品在线看| 久久视频免费观看| 清纯唯美亚洲激情| 日韩精品福利在线| 欧美精品做受xxx性少妇| 中文字幕在线看视频国产欧美| 欧美成人精品三级在线观看| 欧美日韩国产精品一区二区三区四区| 韩国视频理论视频久久| 国产精品v片在线观看不卡| 欧美性xxxx18| 国产精品成人一区二区三区吃奶| 69av视频在线播放| 日韩中文字幕在线视频播放| 国产日本欧美在线观看| 色综合久久精品亚洲国产| 日韩av电影在线免费播放| 日韩在线观看免费全集电视剧网站| 日韩国产精品一区| 亚洲自拍偷拍在线| 日韩av电影手机在线| 国产精品久久国产精品99gif| 欧美午夜宅男影院在线观看| 美女视频黄免费的亚洲男人天堂| 久久综合免费视频影院| 亚洲美女视频网站| 国产精品白嫩美女在线观看| 久久久电影免费观看完整版| 精品调教chinesegay| 日韩中文字幕视频| 亚洲成人久久一区| 97av在线视频免费播放| 日韩欧美成人精品| 亚洲天堂男人天堂女人天堂| 亚洲最新av在线| 精品久久香蕉国产线看观看亚洲| 欧美日韩免费网站| 午夜精品久久久久久久男人的天堂| 欧美日韩精品在线观看| 精品视频一区在线视频| 欧美精品在线看|