[Contents]   [Back]   [Prev]   [Up]   [Next]   [Forward]  


Sample Game

Although GNU Backgammon has many commands and options, only a few of them are used during routine play. This chapter demonstrates some of those most commonly used.

If your @gnubg{} installation is complete, you should be able to start it and see output similar to the following:

GNU Backgammon 0.02  Copyright 1999, 2000, 2001 Gary Wong.
GNU Backgammon is free software, covered by the GNU General Public
License, and you are welcome to change it and/or distribute copies
of it under certain conditions.  Type "show copying" to see the
conditions.
There is absolutely no warranty for GNU Backgammon.  Type "show
warranty" for details.
(No game) 

When you start a game, @gnubg{} will (by default) show which player's move it is; it is displaying `(No game)' at the moment to indicate that it isn't anybody's turn.

GNU Backgammon uses a pseudo-random number generator to produce dice rolls. It will normally initialise the state of the generator to some value based on the current time (and perhaps other system information, depending what features are available on your platform). But for purposes of this example, it will be better to start the generator from a known state, so that the rolls it generates will be repeatable. Enter the following command to change the generator state ("seed"):

(No game) set seed 15
Seed set to 15.
(No game)   

The default settings allow you to play X (the black pieces, if you have a graphical board window) and the computer will play O (red). It will play with no lookahead by default; it is very fast at choosing moves in this mode (instantaneous, on most hardware) though it does not play at its full strength. Let's start a game.

(No game) new game
gnubg rolls 1, user rolls 3.
 GNU Backgammon  Position ID: 4HPwATDgc/ABMA
 +13-14-15-16-17-18------19-20-21-22-23-24-+     gnubg
 | X           O    |   | O              X |     
 | X           O    |   | O              X |     
 | X           O    |   | O                |     
 | X                |   | O                |     
 | X                |   | O                |    
v|                  |BAR|                  |     (Cube: 1)
 | O                |   | X                |    
 | O                |   | X                |     
 | O           X    |   | X                |     
 | O           X    |   | X              O |     
 | O           X    |   | X              O |     Rolled 13
 +12-11-10--9--8--7-------6--5--4--3--2--1-+     user

(user) 

This is the output you will see if a graphical board is unavailable or disabled; if your environment supports a graphical board, you will see a better representation of a backgammon board than this. Exactly the same information is available, either way.

You have just won the opening roll (you have a 3, and @gnubg{} has a 1) -- the dice roll is in the bottom right hand corner for the TTY board, or shown as graphical dice on the right hand side of the board window. The position ID (the `4HPwATDgc/ABMA' in this example) is an encoded representation of the current position. It comes in useful when using some of @gnubg{}'s advanced commands, but you can safely ignore it for now. Notice that the prompt has changed to `(user)', to indicate that it is your turn; on systems where a login name is available, @gnubg{} will use that instead.

If you are familiar with backgammon, you will know that the best play for this roll is to make your 5 point. The command to do that is:

(user) 8 5 6 5

in the terminal window (i.e. move one chequer from your 8 point to your 5 point, and move another from your 6 to your 5 point); or by dragging each chequer to the destination point in the board window. Click mouse button 1 on the dice to indicate you have finished your move (just as you would pick up your dice to end your move if you were playing on a real board).

Once you have done that, @gnubg{} will take its turn, rolling 63 and playing 24/15. It is now your move again:

 GNU Backgammon  Position ID: 4HPwCSCwZ/ABMA
 +13-14-15-16-17-18------19-20-21-22-23-24-+     gnubg
 | X           O    |   | O              X |     
 | X           O    |   | O              X |     
 | X           O    |   | O                |     
 | X                |   | O                |     
 | X                |   | O                |    
v|                  |BAR|                  |     (Cube: 1)
 | O                |   |                  |    
 | O                |   | X                |     
 | O                |   | X                |     
 | O           X    |   | X  X             |     
 | O     O     X    |   | X  X           O |     On roll
 +12-11-10--9--8--7-------6--5--4--3--2--1-+     user

(user) 

Since it is no longer the opening roll, you have the option of doubling before rolling your dice. To roll without doubling, just enter the command roll (or r for short):

(gnubg) roll
 GNU Backgammon  Position ID: 4HPwCSCwZ/ABMA
 +13-14-15-16-17-18------19-20-21-22-23-24-+     gnubg
 | X           O    |   | O              X |     
 | X           O    |   | O              X |     
 | X           O    |   | O                |     
 | X                |   | O                |     
 | X                |   | O                |    
v|                  |BAR|                  |     (Cube: 1)
 | O                |   |                  |    
 | O                |   | X                |     
 | O                |   | X                |     
 | O           X    |   | X  X             |     
 | O     O     X    |   | X  X           O |     Rolled 35
 +12-11-10--9--8--7-------6--5--4--3--2--1-+     user

(user)

(You can also roll by clicking the dice just underneath the board window.)

Let's play this roll by hitting twice: 13/10*, 6/1*. You can enter this move with 13 10 6 1 -- note that you don't need to specify anything special to hit; @gnubg{} will automatically move blots that are hit to the bar. You can also make this move by dragging chequers in the board window, of course.

(user) 13 10 6 1
 GNU Backgammon  Position ID: 4HPwAWBhZ+IBMA
 +13-14-15-16-17-18------19-20-21-22-23-24-+     gnubg
 | X           O    | O | O              X |     
 | X           O    | O | O              X |     
 | X           O    |   | O                |     
 | X                |   | O                |     
 |                  |   | O                |    
v|                  |BAR|                  |     (Cube: 1)
 | O                |   |                  |    
 | O                |   |                  |     
 | O                |   | X                |     
 | O           X    |   | X  X             |     
 | O     X     X    |   | X  X           X |     On roll
 +12-11-10--9--8--7-------6--5--4--3--2--1-+     user

(user) 

GNU Backgammon has rolled 65 and been unable to move. Let's take another roll:

(user) roll
 GNU Backgammon  Position ID: 4HPwAWBhZ+IBMA
 +13-14-15-16-17-18------19-20-21-22-23-24-+     gnubg
 | X           O    | O | O              X |     
 | X           O    | O | O              X |     
 | X           O    |   | O                |     
 | X                |   | O                |     
 |                  |   | O                |    
v|                  |BAR|                  |     (Cube: 1)
 | O                |   |                  |    
 | O                |   |                  |     
 | O                |   | X                |     
 | O           X    |   | X  X             |     
 | O     X     X    |   | X  X           X |     Rolled 25
 +12-11-10--9--8--7-------6--5--4--3--2--1-+     user

(user)

Play this roll as 13 11 6 1. @gnubg{} will now roll 16 -- and still can't move!

 GNU Backgammon  Position ID: 4HPwAWDDZsoBMA
 +13-14-15-16-17-18------19-20-21-22-23-24-+     gnubg
 | X           O    | O | O              X |     
 | X           O    | O | O              X |     
 | X           O    |   | O                |     
 |                  |   | O                |     
 |                  |   | O                |    
v|                  |BAR|                  |     (Cube: 1)
 | O                |   |                  |    
 | O                |   |                  |     
 | O                |   |                  |     
 | O           X    |   | X  X           X |     
 | O  X  X     X    |   | X  X           X |     On roll
 +12-11-10--9--8--7-------6--5--4--3--2--1-+     user

(user) 

Our position is now strong. Let's try doubling -- this can be done by entering the command double at the prompt, or by clicking the doubling cube in the board window. When you are doubled, you should use the command take or drop to accept or refuse the cube. GNU Backgammon will drop this double:

(user) double
gnubg refuses the cube and gives up 1 point.
user wins a single game and 1 points.
The score (after 1 game) is: gnubg 0, user 1 (money session,
without Jacoby rule).

That concludes the example game. You have seen most of the commands normally used while playing; others you will need include bar when re-entering a hit chequer (e.g. bar 20 24 20) and off to remove a chequer from the board when bearing off (e.g. 6 off 5 off).

Type help from within @gnubg{} for a summary of all commands, or browse the rest of this manual to learn more. Have fun playing GNU Backgammon!


[Contents]   [Back]   [Prev]   [Up]   [Next]   [Forward]