Posts

Android 2.2

I am excited that Android 2.2 (aka Froyo) has been announced at Google I/O. Especially the Dalvik JIT compiler directly benefits all my game engines with deeper search. And yes, the 5x improvement reported for checkers in the Android 2.2 highlights page refers to Checkers for Android!

Replay Buttons

Image
I am working on extending Chess for Android with full replay buttons. This will remove the somewhat arbitrary restriction of only an 8 half-move undo. Furthemore, it allows replaying older saved games and experimenting with different continuations. Here is already a quick preview of the new landscape and portrait layout I am planning to use. Early feedback welcome!

Loading and Saving Games

Image
I added a much requested feature to Chess for Android: the ability to load and save games (other than just the one in progress). To use this feature, long-press anywhere in the notation window to get to a menu for exporting the game to clipboard as PGN or FEN or, the new feature, for loading and saving games as file. As illustrated below, after pressing "Save Game to File", a pop-up window asks the user to pick a file. Initially files are empty, but after saving they get marked with the date and time of the last stored game. Simply pick a marked file to overwrite or pick an empty file, as done below for file 3. Loading a game is done in a similar manner.

Perft for Checkers (again)

Today I was prototyping a distributed worker pool at work which needed some test input, and this gave me a good excuse to compute perft for checkers for depth 21 (one deeper than results I posted a while back). The perft breakdown per move (called "divide") from the start position for depths 18 up to 21 is shown below. move divide(18) divide(19) divide(20) divide(21) ----------------------------------------------------------------- 12-16: 550829166472 2517202147314 11531470109861 52945190026737 11-16: 566149929068 2564849953998 11736729175821 53527954221225 11-15: 435063007630 2041959240377 9515983205474 44775005468548 10-15: 472279451484 2180656975018 10055597639275 46574865098865 10-14: 402570639569 1859042884028 8600202424158 39822944739732 9-14: 441590753001 2068865301476 9698986164172 45530585259776 9-13: 625398758917 2881467090588 13406062152792 61923979665936 ----------------------------------------------------------------- 349388...

Maze Solving in 6510

Image
Not sure why, but I suddenly felt the strong urge to see if I could still program in 6510. So I implemented a backtracking solver that finds the path in a maze from the '-' symbol to the '+' symbol (actually an undergraduate programming exercise I did long time ago on a Motorola 68000). The result running on a Commodore 64 emulator is shown below. The active search path appears as white '*' symbols, dead end positions appear as '.' symbols. And below the solution has been found. You can find the assembler source file maze.s (and a 6510 cross-assembler) on my Commodore 64 page if you are interested. You can define a different maze in the .byte section (just make sure the active search path length cannot exhaust the small stack of the Commodore 64). Also don't forget to remove the artificial delay to appreciate how fast machine code runs!

Commodore 64

Image
Remember this screen? Yes, that's right. I too became interested in computer science because of the Commodore 64. Although I still have my Commodore 64 somewhere, nowadays it is much easier to relive the good old times with an emulator, such as CCS64 (Per HÃ¥kan Sundell), VICE (the VICE team), or MP64 (an emulator under development by Michael Plet). A while back I wrote a 6510 cross-assembler win2c64 that converts an assembler source file into a target file that can run on one of these emulators or, with some work, on the real Commodore 64 (an assembler converts human readable mnemonics, labels, and simple expressions into machine code; win2c64 is a cross -assembler because it runs on a Windows platform but generates machine code for the Commodore 64). If you are interested, you can find the cross-assembler and some sample programs at Aart's C64 page .

More Board Textures

Image
Now that I am enthusiastic about textures, I also added a board texture to the other games. For Reversi for Android this hopefully also addresses complaints that the board was "too green". For Checkers for Android, I simply reused the coffee table texture, as shown below.

Wood Texture

Image
A user "dragonfish" suggested to add texture to the wooden chess board in Chess for Android. So I took a picture of my coffee table and used that as texture for the dark squares. See the result below. Together with a minor engine improvement, this new feature has been released in v2.2.

Topeka

Image
I am now working for Topeka .

Copy to Clipboard (PGN/FEN)

Image
Version 1.2.9 of Chess for Android will enable users to export a game to another application, such as an editor, email, or another chess program: copy all moves to the clipboard as PGN (Portable Game Notation) copy the position to the clipboard as FEN (Forsyth–Edwards Notation) To use these options, long-press anywhere in the move list area. Then, the following menu appears. Select one, then exit the chess application and go to the application where you want to paste the game. For example, I picked Copy Moves as PGN and went to messaging and long-pressed the text area. Then Paste the contents of the clipboard into the message, and the game appears in PGN format (note that, for convenience, I use a slightly more elaborate algebraic chess notation than strictly required; readers should still accept that format though). Likewise, using Copy Position as FEN , the contents would look as follows.