Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - drewbarbs

Pages: [1]
1
Just started going through this book and enjoying it so far. Chapter 3, after introducing the basic code for the snake game, has a section on finding bugs. At the end of this it says:

Quote
There's one more fault with the game that didn't get addressed here on purpose. Try to find it and fix it in order to practise resolving problems like this in the future.

Hint: It has to do with how many segments the snake has when the game starts.

I'm stumped as to what this could be. I thought this could be referring the case where our world is smaller than the space required to accommodate our hardcoded initial position, but that seems overly paranoid. Also, I've added some code to ensure the apple spawn isnt in a position occupied by the snake. I've looked at the finished code online, and fail to see what is fixed there that wasn't described in the text. Anyone know what this is referring to?

Pages: [1]
anything