-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathx.cpp
More file actions
45 lines (43 loc) · 672 Bytes
/
x.cpp
File metadata and controls
45 lines (43 loc) · 672 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include <cstdlib>
using namespace std;
int high,width; //页面大小
int position_x,position_y; //飞机位置
void startup() //数据初始化
{
high=18;
width=30;
position_x=high/2;
position_y=width/2;
}
void show() //显示画面
{
system("cls");
int i,j;
for(i=0;i<high;i++)
{
for(j=0;j<width;j++)
{
if((i==position_x)&&(j==position_y))
cout<<"*"; //输出飞机
else cout<<" "; //输出空格
}
}
}
void updateWithoutInput() //与用户输入无关的更新
{
}
void updateWithInput() //与用户输入有关的更新
{
}
int main()
{
startup();
while(1)
{
show();
updateWithoutInput();
updateWithInput();
_sleep(1000);
}
}