Skip to content
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

Open
gnunicorn opened this issue Feb 24, 2013 · 4 comments
Open

prison is confusing. #28

gnunicorn opened this issue Feb 24, 2013 · 4 comments

Comments

@gnunicorn
Copy link
Member

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). " ...

@rschwarz
Copy link
Contributor

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.

@Ivoz
Copy link
Member

Ivoz commented Sep 15, 2013

Welcome to the wonderful world of collision detection :)

@rschwarz
Copy link
Contributor

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.

@Ivoz
Copy link
Member

Ivoz commented Sep 15, 2013

I might see if I can reword it then in combination with fixing up #41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants