Plamcrust Logo
Great software for your tiny device
www.palmcrust.com
  

XdOts Logo


J2me release

For Java aware mobile devices


xdots.palmcrust.com
palmcrust@yahoo.com



Version 1.0  December 2003

Content



Getting Started How to Play Other Screens Registration

Appendix. Game Strategy

Getting Started

History

Hopefully someone might be able to help me with that ... The only thing I know about the game is that it was around in those golden days when calculators looked like cash registers and computers were really digital monsters. I searched the web, but I couldn't find anything apart from Yahoo dots, which (as far as I can see) is a completely different game.

Requirements

This implementation is designed to suit any J2ME compatible device with at least  50K memory for a MIDlet and minimum screen size 96x64.. Though colour is an advantage, but the application supports monochrome screen as well. In particular it suits old Siemens devices (like C55) and majority of Nokia Series 30 phones (but not 6310i).  With touchscreen devices (e.g. Sony Ericsson P800,  Nokia Series 90, Motorola M388) you can use stylus, otherwise keypad can be used.

At a cost of this versatility the board size is limited to 4x4.  This is not only a result of screen limitations. Some J2ME devices have slow CPU's where an increased board size might become a real disaster for a computer player. We might be able to come up with specific releases, where you will be able to customise board size, save game, etc, but I can't  promise that to happen in the near future

Rules

At each move a player crosses one, two, or three adjacent dots that haven't been crossed previously.  A player who gets a position with only one non-crossed dot looses.

The implementation allows to modify rules in the following ways:

See Game rules  for more.

Contact Details

The application has been developed by Michael Glickman for Palmcrust (Australia).

The current and the only version is 1.0 released in December 2003.

Your comments of any kind are appreciated whether or not you purchased the software.

Application site:
http://xdots.palmcrust.com
Company site:
http://www.palmcrust.com
Email:
palmcrust@yahoo.com

How to Play

Key Names

The following key names are used in the manual

Phone keys and T9 keypad

There are numeric keys [1] - [9], [*], [0], and [#].

In most cases phone keys are  arranged in a 3x4 rectangle referred as T9 keypad:

1 2
3
4
5
6
7
8
9
*
0
#
which makes it convenient to play the game.

Unfortunately some devices (Nokia  3650, Siemens SX1) have a non-T9 keypad.

Screen buttons

Keys located below the screen. All devices have at least two screen buttons: Left and Right, some models also have a Middle screen button. Screen buttons are used for entering Commands.

Touchscreen devices usually have soft buttons at the bottom or right hand side of the screen, or Menu key to bring up the list of commands.


Arrow keys: LEFT, RIGHT, UP, DOWN

Press a corresponding arrow key,  or move joystick in appropriate direction.



FIRE

The location of FIRE key is device specific. Here are just guidelines:
  1. Motorola, Nokia series 30 and 40  -  SEND key (often with a green handset picture) 
  2. Nokia Series 60 and compatible (incl. Siemens SX1, Sendon), Nokia Series 90 -  middle of arrow pad, or joystick press
  3. Siemens (apart from SX1) - Right screen button 
In most cases [5] works identically to FIRE for this application.


CLEAR

A key labeled as  C (Nokia 7650),  CLEAR, or with an eraser picture on it (Nokia 3650). If your device doesn't seem to have CLEAR key, use [0] instead.


[A], [B], [C], [D]

Additional keys, referred as "Game Keys".  Designated game keys are provided by some touchscreen device, though labels not always match, and not all four keys might be present.  If game keys are not present, use commands instead.


Introduction Screen

The game starts with an introduction screen containing application logo and Licensed to notice (UNREGISTERED for an unregistered copy).

Just press FIRE or [5] to start a game.

You can also press Left screen button (Right screen button on some model) to select one of the following commands:

Preferences - show Preferences screen
Who Plays   - show  Who Plays screen
Statistics - show Statistics
Help - show online help

Operating Game

With a non-touchscreen device,  you can see a pointer  Pointer Image .   Use arrow keys to move the pointer in vertical or horizontal directions. If Direction Mode is set in Preferences, you can also move the pointer  vertically, horizontally or diagonally using the phone keys.

To add a dot to current move press FIRE or [5]. To complete and make a move press FIRE again for the last dot in the move.

An incomplete move can be corrected it in one of the following ways:
You can prefer Auto-select mode : once a move started,  a dot is automatically added or removed while you move a pointer,  you only need to press FIRE in order to complete the move.  


With a touchscreen device you can hide the pointer (actually it is hidden by default) and use your stylus to pick up dots.  To complete a move tap again the last dot in the move   Tapping a non-last dot in a move truncates the move,  tapping a non-adjacent dot discards  previously selected dot and sets up a new move containing tapped dot.  To clear the whole move tap a void place on the screen.  You can also enable dragging for move selection (see Preferences).

Key Modes

Keys can can be set up to operate in either Direction or Command modes.  Non-Pointer mode is used when the pointer is not accessible.

Direction mode

In Direction Mode  phone keys are used mainly to operate the pointer,  while the commands (like Preferences, Who Plays, etc) can be access through screen buttons.  Direction mode is not recommended for a non-T9 keypad.

Key actions  in Direction mode:
1 Up-Left
2 Up
3 Up-Right 
4 Left
5 Add dot / Complete move
6 Right
7 Down-Left
8 Down
9 Down-Right
* Undo move
0 Reduce move
# Redo move

Command mode

In Command Mode  phone keys are used for entering commands,  therefore arrows keys provide the only way to operate the pointer.  As a result of that you can't move a pointer diagonally in a single operation.  For that reason Auto-select mode is not granted when keys operate in Command mode and Diagonal Lines  are enabled. See Commands action for the description of commands.

Key actions  in Command mode:
1 Preferences
6 Redo move
2 Advise move
7 Statistics
3 Who plays
8 Help
4 Undo move   
9 Exchange players
5 Add dot /  Complete move
0 Reduce move
* Undo move
# Redo move

Non-Pointer mode

Keys operate in Non-Pointer mode when the pointer is not accessible (e.g. pointer is hidden, demo mode, game terminated). This mode only slightly differs from Command Mode :
1 Preferences
6 Redo move
LEFT  UP  Undo move
2 Advise move
7 Statistics
RIGHT DOWN  Redo move
3 Who plays
8 Help
FIRE CLEAR See comments
4 Undo move
9 Exchange players

5 See comments
0 See comments

* Undo move
# Redo move

Comments

Some keys operate in relation to situation:

FIRE or [5] :
CLEAR or [0]

Game Keys

Game keys provide a shortcut to commands:

[A]
Preferences
[B]
Who plays
[C]
Exchange players
[D]
Statistics

Commands

To execute a command press a screen button (Left or Right or Middle depending on the model) and select a command from the list. With some touchscreen devices commands are available from Main (Top) menu. As mentioned previously, you can also activate commands with phone keys (in Command or Non-pointer modes) or with game keys.

The commands are explained below:

Undo move
Take back last move.  In a human vs computer game the corresponding computer move is also taken back.  With an unregistered version you can't undo opening (starting) moves. The command is also available after game terminates. In a demo game (computer vs computer) "undo move" suspends the game. The game continues after all taken back moves are redone.
Redo move
Redo previously taken back move (-s).
Swap players
Exchange players.  In human vs computer game this causes a computer to move.
Advise move
If you play against the computer, you can ask your opponent's advise  (and it is sincere !). The advice depends on your opponent's skill and some random values.  You can also ask an advice in human-vs-human game in which case average computer skill is assumed.
New game
Starts a new game. In case a game is in progress, a confirmation is required. After game terminates you have to wait for about 2.5. seconds before you can start a new game.
Preferences
Bring up Preferences form. You will need to start game if game rules are modified.
Who Plays
Bring up Who Plays form. With a non-registered copy this command operates only between games.
Statistics
Bring up Statistics form
Help
Show online help. This is a very brief description of game rules, using keys, etc.
Quit
Terminate application
   

Status Bar

Status bar appear on the right hand side of the game board and contains the following lines:

Line  1 (top)
Move number.  Since move number increments with each move, it actually it counts half-moves (or plies). The colour is green  if first plays has the move and red is second player starts the move
Line 2
When a game is in process, the line show number of taken back moves, empty if no moves.
After game terminates a faces appears:
        Happy Face - human won,
        Sad Face  - human lost,
        Calm face - for a human-vs-human or computer-vs-computer game
Line 3
Two letters representing player and skills ( green  for first,  red for second):
        H - human
        D - computer dumb
        A - computer average
        S  - computer smart
 A letter for the player who has move is shown in a bright colour.
Line 4 (bottom)
Number of available dots.

Other Screens

Preferences

The following customised features can be set up in Preferences form.

To activate new settings enter Accept command. To discard operation and return to board view screen enter Cancel command.

Note that  modification of game rules requires restarting a game. This doesn't apply to other settings.

Game rules

Rule
Default
Description
Diagonal lines
ON
ON -  the diagonal neighbours are considered as adjacent dots and can be crossed in same move.
OFF - diagonal neighbours can't be crossed in same move
Crossed lines
ON
If Diagonal lines are disabled, this option is ignored, otherwise it specifies whether a new diagonal line segment can be drawn over an existing  diagonal segment connecting the opposite dots to form an X shape.
ON -   diagonal segments can cross (X shapes are allowed)
OFF - diagonal segments cannot cross (X shapes are not allowed)
Last wins
OFF
OFF - a player who remains with the last non-crossed dot looses
ON - a player who crosses the last dot wins; this rule looks to be less challenging than the standard one

Other settings

Setting
Default
Description
Auto-select
OFF
ON - A new dot is added to an existing move when a pointer  moves to an empty dot,  a move is reduced when the pointer returns to a previous dot, press FIRE to complete the move.
OFF - FIRE needs to be pressed for adding a dot to current move, or truncating a move.  Press FIRE second time for the last dot in selected move to complete the move.
See Operating_Game  for more  
Auto-swap
OFF
ON - automatically exchange players after game finishes
OFF - don't exchange players, unless requested
Direction mode (non-touchscreen devices only)
ON for T9
OFF for other keypad
ON - use phone keys to operate pointer (see Direction mode)
OFF - use phone keys for entering commands (see Command mode)
Straight after the installation the application will try to guess whether or not your device has a T9 keypad and select the mode accordingly, but you can always change it later.
The mode does not appear for a touchscreen device which uses Non-pointer mode if pointer is hidden, or Direction mode if pointer is visible
Show pointer
(touchscreen devices only)
OFF
ON - show the pointer. Arrow and phone keys are used to operate the pointer
OFF - hide the pointer.  Arrow and phone keys are used for entering commands
See  Direction mode and Non-pointer mode for more information.
The pointer is always visible for a non-touchscreen device.
Dragged select
(touchscreen devices only)
OFF
If your device supports dragging and does it properly (some devices don't) you might wish to use dragging for move selection where you can just drag from one dot to another. You still need to use 'double-tap technique' for a single-dot move.

Who Plays

This form allows to specify type and skill of each player, top line corresponds to the player who starts the game.

To modify a player,  highlight corresponding line and keep pressing FIRE until you get what you are after.

To exchange players highlight last line (named 'Swap players ') and press FIRE.

To accept new players enter Accept command, or enter Cancel to discard new player settings.

Statistics

The application keeps statistics of previous games. The statistics is shown in Statistics form.

The statistics can be view in Compact or Detailed view modes.  To change mode enter Detailed view or Compact view command.

With a registered copy you can clear statistics with Clear stats command (after confirmation).

Enter Close command to close statistics screen and return to board view.

The statistics data are explained below.

Compact view (default)

Human
Number of games won by human against the computer
Computer
Number of games won by computer against human
Terminated
Number of  human-vs-computer games terminated with New game or Quit command. Note that a game terminated  after 4 or more moves is considered as lost for the human player
Hum-hum
Number of human-vs-human games

Detailed view

Human 1ST
Number of games won by human as starting  player against the computer
Human 2ND
Number of games won by human as second  player against the computer
Comp. 1ST
Number of games won by the computer as starting  player against  human
Comp. 2ND
Number of games won by the computer as second  player against  human
Terminated
Number of terminated  human-vs-computer games. See comments for Compact view
Hum vs Hum
Number of  human-vs-human games
Hm won Dumb
Number of games where human defeated Dumb computer player
Hm won Avg
Number of games where human defeated Average computer player
Hm won Smrt
Number of games where human defeated Smart computer player
Dumb won Hm
Number of games where Dumb computer player defeated human
Avg won Hm
Number of games where Average computer player defeated human
Smrt won Hm
Number of games where Smart computer player defeated human

Registration

If you like the game, you shouldn't regret about just few bucks spent on it - after all this is what we do for life.

By purchasing a product you contribute to development and support of first class software for alternative (non-monstrous) operating systems like  SymbianOS, PalmOS, J2ME.

To register the product try the site you downloaded it from, if not try the following
http://www.handango.com  
http://softwaremarket.nokia.com  (Nokia devices only)
http://www.smartsam.de
After the purchase you will be given the registration code that needs to be entered along with the user name.

The user name appear as "Licensed to" at the bottom of Introduction screen.

Limitations of unlicensed copy:

Appendix. Game Strategy

Though having  a degree  in Math , I am not really a professional mathematician.  What I am going to suggest here is far from being  exhaustive, but with a comprehensive strategy the game wouldn't be as challenging as it is! I hope my ideas will help you to beat Smart ... occasionally. If you feel like capable of developing your own theory you should better stop reading ...

While discussing the strategy I assume "last looses" rule, because "last wins" case is so simple that I can leave it to you as an exercise :)

We start with ...

Definitions

Contiguous sets

The whole set of  available (non-crossed) dots can be divided into contiguous subsets. Each pair of dots belonging to same contiguous set can be connected to each other either directly or through other non-crossed 'conducting' dots, while any pair of dots from different contiguous sets cannot be connected this way. This is very similar to flood or bucket filling (if you used a graphic editor, you know what it is about),  but in our case the neighbourhood is defined according to game rules.

Consider the following position:
 Position 1
     
As you can see,  the rules allow diagonal lines.

If the rules don't allow line crossing (X-shapes) , there are four different contiguous sets:
Set 1 (1 element):      dot  1
Set 2 (4 elements):    dots 3, 4 , 7, 8
Set 3 (3 elements):    dots 9, 10, 13
Set 4 (2 elements):    dots 15, 16
In  case the rules allow line crossing,  dot 10 can be connected to dots 7 and 15,  therefore only set 1 remains isolated, while sets 2, 3, and 4 become a single set of 9 elements.

Singles, doubles, triples and 'huge' sets. 

I use term single, double, triple and huge for a set containing  one,  two, three,  or more than three elements resp. If in the above example the rules don't allow line crossing there are 1 single, 1 double, 1 triple and one huge, while if line crossing is allowed we have one single and one huge.

Move categories and non-splittable sets

As far as contiguous sets are concerned, each move can be one of the following:
Deletion:  removes a set (doesn't apply to a huge set)
Reduction:  makes a set smaller (not applicable to a single)
Split: divides a set into two smaller sets (applies to a triple or a huge)
Note that that some triples can't be split  like Set 3 in the position above.

A set of 4 elements is non-splittable if the dots are arranged in a square and the rules allow diagonal lines and line crossing.

-------

We are getting to the real stuff now


Positions With Singles Only

This case is so simple that I need to apologise for being silly :)

Statement 1.
In a position containing only singles the beginner (i.e.  player who has the move) looses if number of sets is odd and wins if the number of sets is even.


Each player has no alternative to deleting a single, therefore a player starting with an odd number of singles get the last one, whereas if the number of singles is even, the last dot is left to the opponent.

Positions Containing No Huge Sets

In this section we consider positions containing only singles, doubles and triples.

Let S, D and T  be the number of singles, doubles and triples.  Since single-only case has been discussed previously,  we assume that the position has at least a double or a triple, in other words T+D > 0

Statement 2.
In a position containing  singles, doubles and triples so that T+D > 0 the beginner looses if and only if  S, D and T are either all even, or all odd
.

For simplicity we'll  use E for Even, O  for Odd,  1 for One,  N for None with  T+D+S layout. For example  1+N+O means one triple, no doubles and odd number of singles. We also assume that player A has the move, and player B is A's opponent.

Statement 2 is equivalent to the following set of statements

Statement 2a.  In situation  E+E+E  (T+D> 0)   A looses
Statement 2b. In situations O+E+E,  E+O+E and  E+E+O (T+D > 0)   A wins
Statement 2c. In situations E+O+O,  O+E+O and  O+O+E   A wins
Statement 2d. In situation  O+O+O A looses  

Let's prove  the statements one after another.

Proof of statement 2a (E+E+E)

B uses the following strategy: It can be seen that while non-singles are around, B always keeps A with an even number of singles, doubles and triples,  but before removing the last non-single  B leaves A with an odd number of singles so that A looses.

Proof of statement 2b (O+E+E, E+O+E, E+E+O)

First consider situation  T+D=1,  i.e.  1+N+E or N+1+E.  In this case A reduces the only remaining non-single into a single leaving B with odd number of singles, so that B looses.

Case T+D>1  is not less obvious. A just deletes the whole set of a category with the odd count.  In other words:  in case O+E+E A deletes a triple, in case E+O+E A deletes a double,  in case E+E+O  A deletes a single.  This leaves B with situation E+E+E where  T+D >0, so that B losses according to statement 2a.

Proof of statement 2c (E+O+O, O+E+O, O+O+E)

We again start with T+D=1,  i.e. N+1+O and 1+N+O.  In this case A removes the last non-single leaving B with odd number of singles.

In case T+D>1 A leaves B  with  E+E+E situation using the following rules:

Proof of statement 2d (O+O+O)

D and T are both odd, therefore T+D > 1 is always the case

Consider all possible moves of A:
In other words,  after any A's move:

Positions With Huge Sets

With 'huge' sets the situation is not as straightforward, so that looking ahead is by far the best I can suggest.  Since for CPU and memory limitations I wanted to keep the code non-recursive, there is only 1 step look ahead  performed by a Smart player and occasionally by  an Average player.

Positions containing one set of 4 elements and no other huge sets (wrong!)

In case you are looking for another exercise for your brain ...

The following  paragraph cold be a good 1st April joke. Since it is not 1st of April, I sincerely confess that it is wrong. Can you find the breach in the following reasonings ?

.............

Consider  a position containing one set of 4 dots, and maybe some doubles, singles and triples.

We are going to prove the following statement:


Statement 3.  In case a position has one set of four elements and no other huge sets:

We will refer to the position as 1+T+D+S.

If set of four is the only remaining set (1+N+N+N), A just turns it into a single, so that the opponent looses instantly.

We therefore concentrate on positions containing non-huge sets,  in other words T+D+S > 0.  What statement 3 actually declares is that we can disregard a set of four, and make the judgement by analysing T+D+S combination according to statements 1 and 2, which is equivalent to the following.

Statement 3a. If the position has no doubles and triples (1+N+N+S),  beginner looses if S is an odd number and wins if S is an even number

Statement 3b. If the position has a double or a triple (T+D > 0),  beginner looses if D, T and S have same parity, and wins otherwise.

Proof of statement 3a.


If number of singles is even, A reduces the  huge to a single, leaving B with odd number of singles, so that B looses.

If number of singles is odd, B uses the following strategy:
As a result of that A always get a position with odd number of singles. Eventually A is forced to either reduce the huge, or delete the last single, while either of moves leaves A with odd number of singles.

Proof of statement 3b

Consider the following outcomes:

1+O+E+E,  1+E+O+E  or 1+E+E+O   A reduces the huge to a triple, double or single depending on which counter is odd. This leaves B with E+E+E layout so that B looses according to statement 2a

1+E+O+O,  1+O+E+O  or 1+O+O+E   A reduces the huge to a triple, double or single depending on which counter is even. This leaves B with O+O+O layout so that B looses according to statement 2c

1+E+E+E or 1+O+O+O

B uses  the following strategy: