-
Notifications
You must be signed in to change notification settings - Fork 137
Description
From Brandon Trainor, who reported a couple of other bugs:
If I am properly reading the choose_ghosts_spots function, it:
• Consumes the grid list and the number of ghosts to spawn
• Uses len() to obtain a int representing the length and width of grid (which it gets away with because it's assumed all grids passed into the function are perfectly square)
• Uses that to create a set of shuffled range lists for the x and y pairs
• Takes those randomly ordered x and y lists and pops the last value from each one to append an [x, y] list to the positions list
• repeats the last step for the number of ghosts consumed at the beginning
• returns the newly created positions list
Looking at the quiz question, it states that in order for the function to be considered mutable, it had to modify the actual grid list that the function consumes:
To me, it seems that passing the grid into the function only serves to grab the immutable value of its length, not to modify grid itself in any way, meaning that the choose_ghost_spots function should actually be considered immutable, correct?
I'm not sure if this is a bug, because I haven't double checked it, but I didn't want to lose track of it.

