A unique implementaion of Donald Knuth's algorithm and data structure to compute solutions at lightning speeds for the IQ-arrows puzzle game.
This project seeks to tackle the root cause of my frustration. Once, when walking in a book store, I noticed an IQ puzzle game on sale. It was labelled as extremely difficult and I felt up for the challenge. However, I must admit that after trying the harder levels of the game, I felt defeated. But I wasn't about to give up this easily, so I devised a plan to create an algorithm that would obliterate this game. Coincidentally, I was also brainstorming ideas for my personal MYP project and this seemed like a perfect opportunity. You can read my report on the project here.
- written in Java from scratch
- implements Donald Knuth's Algorithm X
- for improved efficiency and time, relies on the Dancing Links data structure
- GUI based on Java Swing
As mentioned in the introduction, the ultimate purpose of this project is to compute solutions to a puzzle game.
The game consists of a 6x3 board, 6 differently shaped pieces with arrows on them, and a booklet with challenges.
Each challenge in the booklet is presented in the form of the blank board with arrows drawn on it (left). The aim of the game is to position the puzzle pieces in such a manner that the arrows on them line up with those given by the challenge (right). Further information about the game can be found here.
This program allows the user to enter the starting position of the challenge through an intuitive user interface. Then, in a matter of milliseconds, it computes the appropriate answer that fulfills the starting criteria.
- Download or clone the repository to your local machine.
- If necessary, configure the starting point to
Solver.java
- Run the code to see a GUI representing the physical board.
- Enter a combination of arrows either from a challenge or randomly. Clicking again on an arrow will rotate its direction clockwise.
- Press solve to generate the solution. If not possible, an error will be displayed.
This was a milestone project for me as it taught me to develop my own, independent solution. While algorithms for cracking puzzle games have existed and developed for decades, as far as I am aware, no one has applied one to this specific game. As such, I was forced to roam through scientific papers in order to fully grasp the inner-workings of an algorithm and apply it to this problem. It was no easy task, but it felt extremely rewarding to have personally developed a unique solution to a unique problem with almost no outside reference.
Honestly, I'm rather proud and happy with this project. That being said, I believe I could've structured and documented my code more clearly. In addition, I would also like to explore customizations of the GUI and perhaps incorporating some additional features to the program. Such as for instance being able to interpret a challenge through image recognition from the picture of a page of a booklet.