Python Python Collections (2016, retired 2019) Dungeon Game Movement

<noob />
<noob />
16,693 Points

What the teachers Note means?

hi, I dont understand what the teachers notes mean? how come (-1,0) is "LEFT"? thanks!

2 Answers

Alex Koumparos
MOD
Alex Koumparos
Python Web Development Treehouse Moderator 33,515 Points

Hi Noob,

If you take a look at the Dungeon Entrance video, you'll see that Kenneth designs the grid as a list of 2-tuples where the first value is the X co-ordinate and the second value is the Y co-ordinate.

Accordingly, (-1, 0) could represent left because the first value would be a negative movement along the x-axis (left) and the second value represents no movement on the y-axis.

Cheers,

Alex

horus93
horus93
4,333 Points

imo, while I understand the coords he's using I think it would be simpler to just make the cords in a different fashion and have the tuples be a single number so you'd line them up like "column 1, row 5" etc.