#include <iostream>
using namespace std;
int main()
{
int x = 5;
int y = 5;
string move;
string room[5][5] =
{
{"- ","* ","* ","* ","* "},
{"* ","* ","* ","* ","* "},
{"* ","* ","* ","* ","* "},
{"* ","* ","* ","* ","* "},
{"* ","* ","* ","* ","@ "}
};
while (move != room[0][0])
{
cout << "Hello World\n\n" << endl;
for (int i = 0; i < 5; i++)
{
for (int j = 0; j < 5; j++)
{
cout << room[i][j];
}
cout << endl;
}
cout << "Move: ";
cin >> move;
if (move == "up")
{
room[5][y] = "* ";
room[x][5] = "* ";
y = y - 1;
room[x][y] = "@ ";
break;
}
}
return 0;
} |