// simple_game.cpp - simple game that allows the user to moves a character around.
#include <iostream>
using namespace std;

int main() {

  char direction;
  int xp = 2;
  int yp = 3;
  char name = 'a'; // the character that will represent the players pos on the board

  // loop to ask the user until a 'q' is entered
  while(direction != 'q') {

	// printing out game board
    for(int y=0;y<5;y++) {
      for(int x=0;x<5;x++) {
        if (xp == x && yp == y)
          cout << "  " << name << "  "; // if its the player's position, print out player character
        else
          cout << '(' << x << "," << y << ") "; // otherwise print out coord position
      }
      cout << endl;
    }

    cout << "\nEnter in a direction (q to quit): ";
    cin >> direction;

	// update player's position based on the direction entered
	if (direction == 'n') yp--;
	else if (direction == 's') yp++;
	else if (direction == 'e') xp++;
	else if (direction == 'w') xp--;

  }

}



