0

So I have created code for a grid that looks like this :

- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - -
- X - - - - - - - -
- - - - - - - - - -

Co-ordinates are accessed by calling my_grid.Grid[x_coordinate][y_coordinate], and new characters can be placed anywhere there (as shown by the 'X' with coordinates [1][1])

I want to be able to move this character in any direction using arrow key inputs, without using the 'Enter' key afterwards if possible.

What is the best way to do this?

tombam95
  • 343
  • 2
  • 14
  • 2
    see http://stackoverflow.com/questions/510357/python-read-a-single-character-from-the-user – maazza Nov 19 '15 at 10:39
  • Great, that's exactly what I need. If you post as an answer I will accept it. – tombam95 Nov 19 '15 at 10:42
  • see this answer for a cross plafrorm solution http://stackoverflow.com/a/510364/1342402 and this one http://stackoverflow.com/a/22398481/1342402 to handle the arrow key codes – maazza Nov 19 '15 at 10:42

0 Answers0