C++#include <iostream>
#include <windows.h>
#include <conio.h>
#include <bits/stdc++.h>
using namespace std;
void print(char a[10][10]){
system("cls");
for(int i=0;i<5;i++)
cout<<a[i]<<endl;
}
int main(){
int x=1,y=1;
int ch;
char a[10][10] = {
"######",
"#0 # #",
"# #",
"# # ",
"######"
};
print(a);
while(x != 3 || y != 5){
if (_kbhit()){
ch = _getch();
if (ch == 27){ break; }
if (ch == 97 && a[x][y-1] == ' '){
a[x][y] = ' ';
y--;
a[x][y] = '0';
print(a);
}
if (ch == 100 && a[x][y+1] == ' '){
a[x][y] = ' ';
y++;
a[x][y] = '0';
print(a);
}
if (ch == 115 && a[x+1][y] == ' '){
a[x][y] = ' ';
x++;
a[x][y] = '0';
print(a);
}
if (ch == 119 && a[x-1][y] == ' '){
a[x][y] = ' ';
x--;
a[x][y] = '0';
print(a);
}
}
}
system("cls");
cout<<"you win";
for( ; ; ) ;
return 0;
}