Go for PalmOS

What is it?

An interface for playing and replaying Go on a Palm. Go is an ancient Asian strategic game, a.k.a. Igo in Japanese, Wei Qi in Chinese or Baduk in Korean.
It is freely downloadable: Go.1.2.zip

Implements as well:
- Recording the moves, and navigating in the moves list
- Modification of the recorded moves
- Export and import of game listings in SGF format as Memo Pad notes
- Evaluating the game result (semi-automatic score counting)
- Better look on grayscale and color screens, including Sony Clie with High Resolution NEW
- Support for different board sizes, (also for import/export) NEW
More details below.

Screenshots

History

Sources released on 2007/02/14

You may do whatever you like with the code, but I would appreciate if you kept me informed about any nice developments...
I forgot almost everything about how I wrote the program, so please don't ask me questions about the code. The only thing I can tell is that the playing interface and the game rules are separated in different modules, so that the implementation of the rules might be rewritten without affecting the interface. About the rules, I remember I wrote a quite unorthodox method to count liberties of stones, originally with the purpose of writing a particular playing algorithm. It is based on the concept of "height" associated to each stone, (an integer from 0 to N). A height of N means a stone has at least a liberty, N-1 means a stone has no liberties but at least a neighbor of the same color that has a liberty, and so forth down to 0. The idea is, there is a sort of "gravity" that pulls the stones down towards 0 height, and the stones "hang on" to their neighbors. When a group of stones is surrounded, they lose all "hanging points" and they "fall down". The value of N (max height) must be chosen in function of the board size: if N is too small, it may happen that the stones of a group that are far from the group's edges (liberties) seem fallen down before the group is completely surrounded. An example (unlikely to happen in real games) in this sgf file.

Version 1.2 released on 2002/12/17

High resolution bitmaps adapted for Palm OS 5 as well. Update concerns only OS 5+ machines (like Palm Tungsten).

SGFLib update: SGFLib 1.2 released on 2002/09/13

Stripping blanks from the SGF files: Importing files with blank characters inside moves. SGFLib.prc
Will be included in the next version after some tests.

Version 1.1 released on 2002/05/02

Added new bitmaps to be used on grayscale screens, lower board sizes, and high resolution screens (Sony Clie). Functions from Palm OS 3.5 are used for drawing, so the application needs system version 3.5 or higher to run.

Support for different board sizes from 2x2 to 19x19. The size tag is handled in SGF import. The current game is reset when importing a new one (after confirmation).

Version 1.0 released on 2002/04/06

I originally wrote the program to test a new model for implementing the Go rules, which could be a basis for new types of Go playing algorithms. I will probably add later a link describing the model I used to create the method implementing the Go rules.

A little side-effect when designing the interface: I wanted to see the colors better used, and I tried to find a good compromise between simplicity, aesthetics, efficient and intuitive usability, and completeness with respect to its purpose. (was maybe impressed by the Palm-philosophy :) Ok, sure, good compromise is subjective...

Download this if you're struggling with the last bytes of free memory.

Loading onto the Palm

Use the Palm Desktop’s Install utility to load the necessary files on your Palm:
Go.prc – the interface module;
DuGoLib.prc – the library implementing a set of rules. It is necessary to be able to play.
SGFLib.prc – Optional library implementing SGF import and export.

Note: This is a first release, please use it cautiously! Back up your data before using it. It has not been extensively tested, so it might still have some bugs. I have tried it on a Palm IIIc, and on Palm Emulator with several ROMs, it looked like working fine.

How to use?

A brief explanation of usage is in the program (About/Tips).

Playing

Options/New Game sets up the board for a new game. Tap to move a piece. For more precision use “tap-drag” (release the pen when the piece to move is where intended). Undo with a Delete stroke, or the Down button.
Other shortcuts are listed in About/Tips.

The game rules are implemented in a separate library (which can be replaced). More details on the rule set are described in Options/Check Library/Tips. For example the DuGoLib library uses a minimally constrained rule set: allows Ko, suicide moves (in this case it removes the whole suicidal group), any number of successive Passes, etc. – the only constraint is not to move on an occupied place.

Scoring

Click on View Territories to start scoring. Click on a group to mark it dead or alive. Click on a surrounded territory do display the territories surrounded by that color. Click on the Captive Baskets to display the number of prisoners.
Replaying/Navigating
Use the Move menu commands to move back or forward in the list.
Some shortcuts:
 - Back to Start: Graffiti "Left";
 - Back: Graffiti "Delete" or Down hard-button;
 - Forward: Graffiti "Space" or Up hard-button;
 - Forward to Last: Graffiti "Right".

Note: while replaying, if the currently displayed move is not the last in the list, setting a new stone will overwrite the next recorded move. Thus it can happen that a later move will be invalid. In this case when reaching the invalid move, Go will display “Move XY occupied”.

Exporting/Importing

Use Options/Export to save a game as a Memo Pad note. An exported game will appear in the Unfiled category of the Memo Pad with the title “Go listing YYYY-MM-DD HH:MM”.
To import an SGF file, it should be first loaded into Memo Pad: copy into a note in your desktop application (Palm Desktop, Outlook) and synchronize. Then move it to the first position in its category (change its name such as to be the first in the list if you use alphabetical sorting). Then click Import in Go.

Note: If the original SGF file is larger than 1024 bytes (the Memo Pad limitation), you may need to strip off the non-essential tags (comments, etc.). Or split into memos of max 1024 characters each, and append an ellipsis (three dots) just before the splits. In this case, make sure the parts are in the right order in Memo Pad.

Note: More complete handling of the SGF format is yet to come...

Viewing options

Some of the view elements can be modified in function of taste in the View menu. When quitting the program the board and settings are saved and restored to how they were on next start.

Copyright

Adorjan Kiss, 2002.

Thanks for your visit here. For any comment drop a line to kiss@lirmm.fr
I may change my priorities regarding maintenance and continuation of this project depending on your feedback.
Cheers!