啊哈磊_编程从这里起步

标题: 求告知为什么运行画面一片空白什么都没有。。。没有出现字符A [打印本页]

作者: 花鸟风月    时间: 2020-10-5 22:27
标题: 求告知为什么运行画面一片空白什么都没有。。。没有出现字符A
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <conio.h>
  4. #include <windows.h>
  5. int main()
  6. {
  7.     int plane_x,plane_y;
  8.     int enemy_x,enemy_y;
  9.     int zidan_x,zidan_y;
  10.     int bottom,right;
  11.     int x,y,a,b;
  12.     char zifu;
  13.     void startup()//初始化
  14.     {
  15.         plane_x=10;
  16.         plane_y=10;
  17.         right=80;
  18.         bottom=40;
  19.     }
  20.     while(666)//游戏循环
  21.     {
  22.         void show()//显示画面
  23.         {
  24.             system("cls");
  25.             for(b=0;b<=bottom;b++)
  26.             {
  27.                 for(a=0;a<=right;a++)
  28.                 {
  29.                    if((a==plane_x)&&(b==plane_y))
  30.                    printf("A");
  31.                    else
  32.                    printf(" ");
  33.                 }
  34.                 printf("");
  35.                 Sleep(100);
  36.                 system("pause");
  37.             }
  38.         }
  39.         void updatewithoutinput()
  40.         {
  41.             
  42.         }
  43.         void updatewithinput()
  44.         {
  45.             zifu=getch();
  46.             if(zifu=='w'&&plane_y>0)
  47.             plane_y--;
  48.         }
  49.     }
  50.        system("pause");
  51.         return 0;
  52. }






复制代码





欢迎光临 啊哈磊_编程从这里起步 (https://bbs.codeaha.com/) Powered by Discuz! X3.2