Im creating a map for a python game, so that when an input of (Up,Down,Right,Left) are put in it will show a "map" of X's but it shows you as "A", but as you move, the X changes to a "E". So you know where you are in the game.
Asked
Active
Viewed 88 times
-2
-
Have the map go up and down not side to side though – Tyler W Mar 04 '15 at 18:26
-
possible duplicate of [Python read a single character from the user](http://stackoverflow.com/questions/510357/python-read-a-single-character-from-the-user) – motoku Mar 04 '15 at 18:44
-
Not a duplicate. I need hep – Tyler W Mar 04 '15 at 18:48
-
Can you edit your question to be more clear about what exactly it is you are trying to do? As it is, your statements are not very decipherable. – motoku Mar 04 '15 at 18:50
-
Hope i made it clearer. – Tyler W Mar 04 '15 at 18:54
1 Answers
0
Once you code into your program how to read the user's input, you can make a two-dimensional "map" with the following snippet. Here I iterate through ten positions for brevity:
>>> len = 10
>>> for n in range(0, len): print('x' * n + 'A' + 'x' * (len - n))
...
Axxxxxxxxxx
xAxxxxxxxxx
xxAxxxxxxxx
xxxAxxxxxxx
xxxxAxxxxxx
xxxxxAxxxxx
xxxxxxAxxxx
xxxxxxxAxxx
xxxxxxxxAxx
xxxxxxxxxAx
>>>
It's then just a simple matter of variating the A
through the use of a variable.

motoku
- 1,571
- 1
- 21
- 49