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 trial
Junior Mateus
2,784 PointsDungeon Game in OOP
I'm Stuck, when the player try to move out of limit of the board When the coordonate at x , reach 0, i receive an error
Here is the link for the code: https://repl.it/@jzzmatt/dungeongames
2 Answers
Junior Mateus
2,784 PointsHi Jeff thank for you advise, i indeed realize that had a problem with the available list moves. Instead of using the original list of the instance, i make a copy of the available move in boardLimit method. So Each time the while loop start, i get a fresh new copy...Seem to fix the issue here is the code with this corrected version: https://repl.it/@jzzmatt/dungeongames
Jeff Muday
Treehouse Moderator 28,731 PointsYour work looks great! So glad you are taking advantage of repl.it for presenting your code.
You are definitely on track with your clear, concise, and highly-readble code. Good luck with your learning at Treehouse! I look forward to seeing more of your craft!
Jeff Muday
Treehouse Moderator 28,731 PointsJeff Muday
Treehouse Moderator 28,731 PointsThis code looks pretty nice, you are very close to making it work out. The error being thrown in the boardLimit() method is because the code attempts to remove a letter from the self.moves parameter that was taken out in a previous move. You can fix this by reinstantiate the self.moves to the full list. You also want to check if a move is in the moves available to the user by checking if the "move" is in "self.moves"