Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialEric Schroeder
19,894 PointsQuestion about 'get_moves' test
In the test for get_moves, the player position that is passed into the function is (0, 2). On a 2 by 2 board that position is off the board. It passes the logic of the function but would never happen in the game. Is it important to write a test that fits within the constraints of the entire program or should you concentrate on just the logic of the function itself?
3 Answers
Ryan S
27,276 PointsHey Eric,
That is a really good catch. I certainly missed that when I originally went through that video. I'm not even sure if it passes the logic of the function because the intention was to place the player in the corner (8:00 in the video), however if that were actually the case, then the player should not have both 'UP' and 'DOWN' as possible moves, yet that is what is returned. Also, a corner position should only return 2 possible moves, not 3. I think you just uncovered an error.
Alex Wootton
Courses Plus Student 5,943 PointsI noticed this too. Posted my thoughts in this thread: https://teamtreehouse.com/community/list-of-available-moves-in-2-x-2-dungeon-game-how-this-is-possible
Alex Wootton
Courses Plus Student 5,943 PointsIn case anyone is interested someone has answered this here: https://teamtreehouse.com/community/how-could-the-player-possibly-move-up-python-testing