不想写注释
代码:
#include <iostream>
using namespace std;
int main()
{
cout << "wsad = 上下左右" << endl;
char a[10][10] =
{
{'#','#','#','#','#','#','#','#','#','#'},
{'#',' ',' ','#','#',' ','#','#',' ',' '},
{'#',' ','#',' ',' ',' ',' ','#',' ','#'},
{'#',' ',' ',' ','#','#',' ','#',' ','#'},
{'#','O',' ','#','#',' ',' ','#',' ','#'},
{'#',' ','#',' ',' ','#',' ',' ',' ','#'},
{'#',' ','#',' ',' ','#',' ','#',' ','#'},
{'#',' ',' ','#','#',' ',' ',' ',' ','#'},
{'#','#',' ',' ',' ',' ','#','#',' ','#'},
{'#','#','#','#','#','#','#','#','#','#'},
};
for(int i = 0; i < 10; i++)
{
for(int j = 0; j < 10; j++)
{
cout << a[i][j] << " ";
}
cout << endl;
}
char ch;
int x = 4, y = 1;
int q = 1, p = 9;
while(cin >> ch)
{
system("cls");
if(ch == 'w' && a[x - 1][y] != '#')
{
a[x][y] = ' ';
x--;
a[x][y] = 'O';
}
else if(ch == 's' &&