Java – any algorithm for the “flip all” (light out) game?

In this game: http://www.mathsisfun.com/games/allout.html

OK, after reading some answers and comments (and taking a quick look at the light out game), I expanded my question:

If I expand the size of the grid (for example, 25) × 25), will the game be different? Is there any possible algorithm to solve any situation in an acceptable time (< 2S)?

Solution

This game is usually called lights out, and there are many elegant solutions. All solutions are based on some standards but some advanced mathematics I won't describe them here, but if you have a little Google, you can find all kinds of explanations, from simple programs to conversion to linear algebra or group theory Some links:

http://www.hamusutaa.com/pilot/solution.html

http://www.ripon.edu/academics/macs/summation/2010/articles/M.%20Madsen%20 -%20Lights%20Out. pdf

http://people.math.sfu.ca/ ~jtmulhol/math302/notes/24-Lights-Out. pdf

Editor: reply: your second question The algorithm provided in the second link I released can solve N x n boards in O (n ^ 6) time, which means that you should be able to solve 25 x 25 boards quickly

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>