[Gadget Addict] found out about a contest being held by a shoe seller. Their mobile app has a game very much like Bejeweled. The high scorer each month gets £500. His choices were to be better at the game than everyone else, or to be smarter. He chose the latter by writing a computer vision program to play the game.
There are two distinct parts of a hack like this one. The first is just figuring out a way to programmatically detect the game board and correctly identify each icon on it. This is an iPad game. [Gadget Addict] is mirroring the screen on his laptop, which gives him easy access to the game board and also allows for simulated swipes for automatic play. Above you can see two examples where black pixels may be counted in order to identify the icon. A set of secondary checks differentiates similar entries after the first filtering. The other part of the hack involves writing the algorithms to solve for the best move.
If you liked this one, check out a super-fast Bejeweled solver from several years back. We should also mention that this was just a proof of concept and [GA] never actually entered the contest.
This grid of letters is a puzzle game for tablet devices called Ruzzle. The contraption attached is an automated solver which uses LEGO Mindstorm parts to input the solutions on the screen. [Alberto Sarullo] is the mastermind behind the project. As you can seen in his demo video after the break he has a flair for the cinematic. But he makes you work a little bit to discover the details of his project.
His post gives a general overview of how this works. A Linux box takes a screenshot of the Ruzzle board. After processing the graphics with Imagemagick he uses Tesseract — an Optical Character Recognition program — to figure out which letter is on each square of the playing area. From there NodeJS is used to discover all possible words with the help of a dictionary file. The final solutions are pushed to the LEGO parts to be traced out on the touch screen with a stylus. The nice thing is that he published all of his code, so you can drill much deeper into the project by pawing through his repository.
Continue reading “LEGO stylus solves Ruzzle tablet game”
We think we have found project that will take over our holiday free time. [Bai Li] just published an excellent article about writing a program that can automatically solve the game of Minesweeper. For those of you who are unfamiliar, Minesweeper gives you a grid in which land mines have been randomly placed. As you click on boxes to reveal what is underneath you are greeted with a number which represents how many mines surround that box. [Bai’s] project examines how the puzzle may be solved programmatically.
He chose to use Java to write the solver. This works well both reading from the screen as well as simulating mouse clicks on the game. The reading portion of the program uses color detection with a screenshot. There were two problems associated with this, the numeral one is almost the same color as an uncovered square, and the numerals seven and three use identical colors. The input portion was much simpler as he’s able to use the existing Robot class.
The logic behind writing an efficient solver is very interesting. One of the most fascinating examples is shown above. What should you do when there is no possible way to ensure a safe move? As with traditional chess games, [Bai] has the solver calculate all possible solutions and choose the move that has the best odds of success.
His source code is available, but won’t this one be fun to hack out from the concepts alone? For some reason this seems more accessible to us than something like the Bejeweled Blitz solver.
Continue reading “How to write your own Minesweeper solver”
Programmers don’t need to get good at a game to achieve a high score, they code a bot for that instead. Take [hypnotizd] for instance. He was learning to write in the C# language and decided to make a bot that plays Bejeweled Blitz on Facebook. He figures he took between 48 and 72 hours of coding over a couple of weeks, but remember, he was learning the language at the same time. We think you’d be hard pressed to achieve a 1.5 million range score by yourself, even with that amount of practice time.
We spoke with [hypnotizd] yesterday afternoon to get a bit of background on how he made this happen. His code (he’s not releasing it so you’ll have to write your own) scrapes the screen image as input. You can see at the beginning of the video after the break that he sizes his app to properly align each jewel in its grid. The program then identifies each game piece by finding the center of the cell and taking a 25 square-pixel average color. Many of the jewels are easily recognized in this first pass, but some are harder and require several different tests to identify. That’s the difficult part, choosing the best move is just a matter of coming up with your own rules on how the bot should play the game.
Continue reading “Bejeweled Blitz bot makes your high score look just sad”
CubeStormer solves Rubik’s cubes and it does it quickly! Made entirely out of LEGO, a Mindstorm web camera is used to scan in the cube with four mechanical hands for manipulation. The device is capable of solving a random cube in less than 11 seconds. That’s quite a bit faster than the last Minstorm solver we saw, and the CuBear solver we are so fond of.
[John Sarik] asked himself why a project should only have a handful of Nixie tubes? Without a good answer to his query he went ahead and built this Sudoku game using 81 Nixie tubes. There’s not much of a description for his work but here’s how we think things go: The two knobs manipulate a cursor, one for rows and the other for columns, while the keypad is used to input your chosen number. The system is Arduino based and [John’s] linked to his code, schematic, and board layout files on Dropbox. He’s even written a recursive solver which can be seen in the video after the break. Would it be inappropriate to bring this to work and whip it out during some down time?
Continue reading “Nixie Sudoku”
It has been quite a while since we looked in on the world of automated Rubik’s cube solving. [David Gilday] built this one using LEGO Mindstorm parts. It uses a computer to calculate the solutions but unlike the standalone Tilted Twister, this creation can solve more than one type of cube. As long as the physical dimensions are between 5 and 6 centimeters on a side, the machine can solve 2, 3, 4, and 5 piece cubes. [David] wasn’t quite satisfied with that though. He built a separate machine to take care of the 6x6x6 cubes too. See both in action after the break.
Want to see more? Don’t miss the CuBear solver developed at Berkeley or the AVR based solver.
Continue reading “Mindstorm Rubik’s solver”