Euclidea – Geometric construction game with straightedge and compass
euclidea.xyz
euclidea.xyz
My best guess without the actual source code is as follows: The perfect algorithm would involve the equality between two functions returning constructible numbers [1], where each function would map from unspecified points (that you can move around with the hand tool) to the result points. As far as I concerned comparing two constructible numbers is possible but inefficient [2], and comparing two functions is probably much harder. However for the purpose of game, we can approximate the equality by randomly evaluating a difference between two functions to the reasonable accuracy and checking if it is close to zero. Theoretically exact real arithmetic would be preferable, but adaptive fixed-precision real arithmetic may be also possible as long as rounding errors are tracked.
[1] https://en.wikipedia.org/wiki/List_of_interactive_geometry_s...
[1] http://ggb1.idm.jku.at/~kovzol/papers/Kovacs-Recio-Weitzhofe...
An alternative approach would be to "cheat" and do a numeric approximation. Constructible numbers (the coordinates of any point the player can make) are always the solution to a quadratic equation whose coefficients have been previously constructed. So, especially for constructions that aren't very "deep" (as would be found in this game), we can easily find the decimal approximation to high precision very quickly. In no time at all, this approach can determine with high confidence that the player's solution and a prototype solution are probably the same.
I would speculate that constructing a near-miss that is falsely deemed correct by this method would require an inordinately complex construction.
Another one they do manage to understand (and love) is Lightbot http://lightbot.com
https://play.google.com/store/apps/details?id=com.Suborbital...
It's so good I managed to do all 135 puzzles in two days and another few hundred generated ones.
The generator might need some work. A lot of the ones it makes are too simple, solvable in 1 or two moves.
For a really nice introduction to the more advanced uses of geometric algebra in three dimensions, there's this fantastic chapter in a book by Rudy Rucker, which you can read here: http://www.rudyrucker.com/infinityandthemind/#calibre_link-3...
[1] https://math.stackexchange.com/questions/1587861/inscribing-...