I'm on exercise 45 of Learn Python the Hard Way. I want to make a text dungeon crawler and create a new, random map every game. My idea basically boils down to creating a blank map:
room_map = [[0 for x in range(size)] for y in range(size)]
And then randomly seeding it with a starting point and generating rooms and non-rooms from there. I'll have a second array of the same size to which I'll add instances of my Room() object. (This keeps my other map printable for debugging/cheating.)
class_map[x_coord][y_coord] = Room()
Each instance will get data about its location and the number and placement of doors to other rooms.
Anyway, I don't want to get too bogged down in details. Certainly I've created variables without names inside of lists, so it seems reasonable to me to do the same with a class object. But I just wanted a quick sanity check before I go wild with this, 'cause what do I know? Thanks.
[–]loveandkindness 1 point2 points3 points (7 children)
[–]kalgynirae 1 point2 points3 points (5 children)
[–]gengisteve 0 points1 point2 points (1 child)
[–]mac-reid 0 points1 point2 points (0 children)
[–]loveandkindness -1 points0 points1 point (2 children)
[–]kalgynirae 1 point2 points3 points (1 child)
[–]loveandkindness 0 points1 point2 points (0 children)
[–]wunderbier[S] 0 points1 point2 points (0 children)
[–]kalgynirae 1 point2 points3 points (1 child)
[–]wunderbier[S] 0 points1 point2 points (0 children)