各位好久不见!!!
今天在家中接待客人,客人表态说自己太过无聊,我也没什么存货,决定造一个简易的小游戏,结果出现大BUG,我苦思冥想改了又改,找不到什么门路,只得询问个位大能的意见,没多难,也就这样:
- #include <stdio.h>
- #include <conio.h>
- #include <mycon.h>
- #include <windows.h>
- #include <time.h>
- int main(void)
- {
- int goted[9][9];
- int bac;
- int red;
- int cht;
- srand((unsigned)time(NULL));
- for(int a; a++; a <= 9)
- {
- for(int b; b++; b <= 9)
- {
- goted[b][a] = bac % 2;
- bac = rand();
- }
- }
- for(int x = 0;x++;x <= 9)
- {
- for(int y = 0;y++;y <= 9)
- {
- gotoxy(0,0);
- red = 0;
- for(int m = x;m++;m <= 9)
- {
- for(int l = y;l++;l <= 9)
- {
- printf("%d", goted[l][m]);
- red++;
- if(red == 10)
- goto L1;
- }
- }
- L1:
- for(int gag = 0;gag++;gag <= 10 && cht != 1)
- {
- cht = kbhit();
- Sleep(25);
- }
- if(goted[y][x] != cht)
- return 0;
- }
- }
- }
复制代码 谢谢各位帮忙!!!
|