![]() (taken from Lights out puzzle solver and. Ignore this improvement until you implement a working (though slow) solution. Questions, Comments, Issues Contact jjflanigan via DDO PM or Thread or. If the efficiency of the algorithm is important, you might want an informed algorithm -such as A* algorithm, which is expected to be pretty fast (relative to the alternatives) with a good admissible heuristic function.Ī slower though simpler solution can be running a BFS.īoth algorithms (A*, BFS) are both complete (always finds a solutuion, if one exists) and optimal (finds shortest path).Īlso note, you can use macros to learn "good" series of moves, to get the algorithm faster. This is a lights out game played on a 6圆 grid. Remember that a, b, & n are all integers. Simplifying this equation gives you na/2 +b. ![]() ![]() Mathematically, this means that na+b- (n-b). The idea is the same, represent the problem as a states graph, and run shortest path algorithm. The strategy is to manipulate the lights such that there are n lights off.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |