kasperpeulen / euclidthegame

A geometry game based on Euclid's Elements.
euclidthegame.org
MIT License
447 stars 74 forks source link

Level 14: Can pass the level by just making a ray #301

Open Bocchio opened 10 years ago

Bocchio commented 10 years ago

Apparently if you move the elements in enough to make the approximation better (by making the circle smaller), the game consider that a ray is in fact tangent. 2014-07-13-22 36 02

Hexstream commented 10 years ago

Ouch! This actually "works". O_O

Nice find!

(I always thought problems like these would be avoided because of the way the game works internally, and because approximations like that really don't usually work.)

On Mon, Jul 14, 2014 at 2:53 PM, Bocchio notifications@github.com wrote:

Apparently if you move the elements in enough to make the approximation better (by making the circle smaller), the game consider that a ray is in fact tangent. [image: 2014-07-13-22 36 02] https://cloud.githubusercontent.com/assets/7820753/3575392/e1ee3c34-0b87-11e4-8ddf-6f848b37d1ff.png

— Reply to this email directly or view it on GitHub https://github.com/kasperpeulen/euclidthegame/issues/301.

kasperpeulen commented 10 years ago

hm... will see if I can fix this

andersk commented 10 years ago

I don’t know if this is something you can do with Geogebra, but one thought I had is that, whenever you create or move a free point, the game should randomly nudge it by some imperceptible amount, say up to a tenth of a pixel. I think that would effectively eliminate this class of bugs.

pkundrat commented 10 years ago

Or maybe disallow creating new implicit points completely - if you need an explicit point - you can create it manually.

On 17 July 2014 00:08, Anders Kaseorg notifications@github.com wrote:

I don’t know if this is something you can do with Geogebra, but one thought I had is that, whenever you create or move a free point, the game should randomly nudge by some imperceptible amount, say up to a tenth of a pixel. I think that would effectively eliminate this class of bugs.

— Reply to this email directly or view it on GitHub https://github.com/kasperpeulen/euclidthegame/issues/301#issuecomment-49234507 .

kasperpeulen commented 10 years ago

I don’t know if this is something you can do with Geogebra, but one thought I had is that, whenever you create or move a free point, the game should randomly nudge by some imperceptible amount, say up to a tenth of a pixel. I think that would effectively eliminate this class of bugs.

tried to implement this, I hope it didn't break anything

andersk commented 10 years ago

Did you push this fix already? I see no new commits in the repository, and I’m still able to cheat level 13 in the way I described to you earlier.

kasperpeulen commented 10 years ago

https://github.com/kasperpeulen/euclidthegame/commit/915e7ca4d202af0fa7c7cbdf0f639ee67f75b9d9#diff-a03b3a59b21ab1de4199e5fe63df92d2R46

this is the commit, I will look at this Level 13 cheat once again. Edit: Ah I see I've only did this for new free points, not yet for moving free points.

andersk commented 10 years ago

Looks like it will need three improvements to be effective against my cheat:

andersk commented 10 years ago

Or, as an alternative to nudging each point as soon as it is moved: whenever the level becomes complete, you could nudge every movable point and check whether the level is still complete.

kasperpeulen commented 10 years ago

@andersk yeah, that is probably better, I tried to nudging points as soon as they are moved, but it is hard, there is a function that check if a points position gets updated, but it doesn't check if the user or the program updates the point. So if the points get moved and after that I update the point, an infinite cycle is created.