Code:
...
int board[5][5] = {
0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,0,};
char choice;
int player[x][y];
char Player = 1;
void PlayerMove()
{
cin<<choice;
choice=tolower(getch());
switch(choice)
case 'y':
x++;
break;
case 'h':
x--;
break;
case 'j':
y--;
break;
case 'g':
y++;
break;
system("cls");
Board();
}
...
void Board()
{
playermove();
board[x][y]=player;
for(int i = 0; i <= 5; i++)
for(int j = 0; j<= 5; j++)
cout<<" ";
}
is this any better??
im more conserned about displaying the map and the player than anything else because switch statements arent that hard to figure out. so does the "void Board();" work or do i still need to change one or two things?