Python cli game map | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Python cli game map

I was wondering if anybody could shed a little light on how to create a interactable map on the command line via python lists for a little game. This map would be something like [[False for x in range(10)]for y in range(10)]. All unoccupied spaces would be False, the players position reading True. Using a player class with a move method would change the position of True... I've been trying to figure it out for a while now and can't seem to get it. Thanks in advance

25th Nov 2019, 3:43 AM
Chad Williams
Chad Williams - avatar
2 Answers
+ 2
yeah, you can't do that in sololearn. try doing it on a computer insetad
25th Nov 2019, 7:41 AM
Shen Bapiro
Shen Bapiro - avatar
+ 2
In this example the `move` method accepts list of value(s) as direction. Maybe it can give you an idea (hopefully). https://code.sololearn.com/c4KwJ5dz2NPl/?ref=app
26th Nov 2019, 5:04 AM
Ipang