-
Notifications
You must be signed in to change notification settings - Fork 262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prison is confusing. #28
Comments
Today I was discussing this problem with a participant who wanted to do a recursive version, not using the while loop. It turned out to be really trick to determine, whether this call was going to leave the "prison area", and if so, to determine the point where the turtle hits the wall. The proposed solution (going in steps of 1) will not be accurate when the distance is given as float, which was our assumption when reading it. |
Welcome to the wonderful world of collision detection :) |
Yes, you would have to solve a quadratic equation in any case, even with integer step lengths, since you can't assume that you are moving directly away from the origin. At least, there should be a note, that it's OK to overstep the prison line a little bit, or to return a bit too early. |
I might see if I can reword it then in combination with fixing up #41 |
The prison exercise seems to be confusing in the way it is explained. Quoting one of our berlin participants:
... " the two turtle prison questions were a bit confusing since if the turtle only walks forward it doesn't make a difference whether the prison is circular or square (it would've been nicer if one could somehow see the difference). " ...
The text was updated successfully, but these errors were encountered: