Posts

Checkers Move Generation

I was able to make a small improvement in the checkers move generator (written in Java for the Android SDK). The following table shows run times of several perft depths before and after optimization when run on the emulator (which should mimic actual run times on the phone quite well). DEPTH #LEAF NODES ORIGINAL OPTIMIZED TIME TIME ==================================== 7 179740 2.9s 1.9s 8 845931 14.2s 9.7s 9 3963680 66.3s 45.6s 10 18391564 294.6s 208.7s P.S. Runtimes for a C++ checkers move generator on a 2.2 GHz Core 2 Duo are given at my checkers page .

Perft for Checkers

Martin Fierz kindly extended his engine Cake with a perft feature. Luckily the numbers reported by Cake match the numbers reported by Checkers for Android exactly. Below the numbers from the start position are shown, hopefully useful data for aspirant checkers programmers. DEPTH #LEAF NODES ======================= 1 7 2 49 3 302 4 1469 5 7361 6 36768 7 179740 8 845931 9 3963680 10 18391564 11 85242128 12 388623673

CheckerBoard

If you are looking for a checkers program for Windows, I can highly recommend Martin Fierz ' CheckerBoard , consisting of a checkers GUI that features game databases, opening books, endgame databases, and various checkers engines (including the capability to plug in your own as DLL). I have used his engine Cake as "sparring partner" to test the correctness and strength of Checkers for Android. Needless to say, Cake won, but the games at least assured me that my Android version plays correct checkers. Martin also kindly responded to my request for adding a perft feature to Cake, which will enable verifying the correctness of my move generator against his.

Yet Another Update

Image
I am on the roll with updates! Version 1.3.2 of Chess for Android uses a larger font for the move list and highlights the last moved played by the engine (controlled by the already existing "show valid moves" button). I am thinking about a version 2.0 with a completely new board layout to use the limited screen space more effectively. As usual, keep an eye on this blog if you are interested.

More Android Updates

Image
Two minor updates at the Android Market . Version 1.3.1 of Checkers for Android has a slightly improved search and evaluation in the checkers engine. Some users complain the engine plays too strong, others say it is too weak. Needless to say I enjoy the challenge of making a strong engine more. I also added an "undo" feature for this game. Version 1.3 of Chess for Android now also has the option to disable highlighting all valid moves once a piece has been selected for more experienced chess players. I also modified the on screen button layout.

Reversi for Android Update

Image
Version 1.3 of Reversi for Android at the Android Market adds an "undo" feature of the last move (to correct a mistake) and an option to disable the "ghost stones" for all valid moves (for users that prefer to see the board as in real-life).

Fixed Castling Bug

I posted version 1.2.2 of Chess for Android at the Android Market that fixes a bug that would sometimes allow castling when no longer legal. I validated the move generator of the chess engine by doing a perft (an internal feature) on several board positions to minimize the probability of other bugs related to move generation.

Trackball Support

Image
I just posted version 1.2.1 of Chess, Checkers, and Reversi for Android at the Android Market with trackball support. A small circle denotes the trackball cursor, as illustrated in the screen shot below. Hopefully this will make the input easier. Many thanks to Chris Bueno for quickly testing the applications shortly after posting!

G1 Android Phone

Image
I received my own G1 (well, strictly speaking, the Android Dev Phone 1&#153)! This means now I can (1) read all user comments posted at the Android Market, and (2) experience my applications on the real device, rather than on the emulator. After just a few minutes I must agree with users stating that touch screen input is rather hard given the board size (something I could never experience on the emulator, where touch is emulated with mouse input). So, trackball support may be a good idea after all.

More on User Feedback at the Android Market

I can now read the last few comments that are posted at the Android Market for each application. For chess and reversi, feedback is mostly constructive. I was very shocked, however, to read the comments posted for checkers. People freely post four-letter words and do not shy away from personal insults. Why? Because the application uses the official straight checkers rule where jumps are mandatory? Perhaps, but adding an option to make captures optional did not seem to help. Because graphics are not advanced? True, but I wrote the game for fun and give it away for free! Because the application plays too strong (or too weak)? I assumed people like a challenge (and, conversely, I still have ideas for improving the strength of the checkers engine). Ironically, I implemented checkers by popular demand after I released chess and reversi in the hope people would enjoy the application. But now I am starting to regret this somewhat after reading too many ill-mannered comments and emails....

Chess for Android Update

Image
Version 1.2 of Chess for Android at the Android Market has several improvements. The first is the much requested "undo" feature, where up to eight plies (half-moves) can be taken back to correct mistakes in the input (or mere blunders, as for black in the screenshot below!). The second is a "free play" option, where the phone can be used as a "magnetic chessboard" to study games, or play a game up to a position for further play with the chess engine (this option, like the different levels of play, can be found under the "Menu" button). Furthermore, move highlighting has been modified with a black border, which looks slightly better along files and ranks. Finally, a few rules were added to evaluation function of the chess engine.

Reversi for Android Update

Image
Version 1.2 of Reversi for Android at the Android Market now highlights the new and flipped white stones after each computer move with a red border, as shown below. Hopefully this will make it more clear what was played last.

User Feedback at the Android Market

Perhaps a surprise to some, but I don't actually have the G1 Android phone myself yet. Instead, I developed the three game applications on the Android emulator . This unfortunately also implies that I cannot read the comments that were posted at the Android Market, I only can see the average rating. As such, I just get a sense of user feedback from emails I receive. These emails can be divided into roughly three categories. The first, and luckily largest category consists of nice emails in which people say they enjoy the game(s) and give constructive feedback and suggestions for improvements. I hope to implement some of the requested features, but please keep in mind that this is "spare time" development. The second, smaller category consists of emails where people claim the program is "cheating". So far those claims invariably resulted from a lack of understanding the proper rules (castling or en-passant in chess, forward jumps only for uncrowned pieces in chec

Optional Captures

Image
To my great surprise, quite a few users complained that captures should not be mandatory in the just released Checkers for Android, even though the official straight checkers rules clearly state that jumps are forced (something that in my opinion adds to the beauty of the game). Nevertheless, since this seems a popular feature request, I just posted an update at the Android Market in which the user can chose between mandatory or optional captures prior to the game. The latter option does not follow the so-called "huffing" rule, where the piece that should have performed the capture is forfeited. Instead, the game simply continues, which may lead to some interesting draw situations.

Checkers for Android

Image
The number of downloads of Chess and Reversi for Android exceeded all my expectations, and I received a lot of nice feedback. The most popular request was for a checkers application. So I gave it a try and implemented Checkers for Android which, like Reversi and Chess for Android, is available for free at the Android Market . Some screen shots are shown below. Since captures in checkers can consist of several jumps, I tried a new input mechanism where touching a square shows all valid moves that involve that square. By clicking on those squares (making orange colors red) eventually a move is uniquely defined. Also, the last played move is highlighted on the board (a feature requested for Chess and Reversi as well). The checkers engine plays at various levels (including random).