1 How to play
serve-singles
serve-couples
play

Rackgammon: Backgammon for PLT Racket

David Van Horn <[email protected]>

This package provides a distributed Backgammon game.

Report a bug.

1 How to play

 (require (planet dvanhorn/backgammon))

These instructions assume you know the rules of Backgammon.

You can either play in singles or couples mode. In either case, you need to run a "Backgammon Server".

Serve single (self-playing) games.

Serve coupled games, pairing together players on a first-come, first-served basis.

(play name [#:IP ip])  any/c
  name : string?
  ip : LOCALHOST = string?
Play a game under the given player name using the Backagammon server located at the given IP address.

To play a game between two players, call (serve-couples) to start the backgammon server. Then call (play "Player 1") and (play "Player 2"). If the backgammon server is on a different machine than the players, use the #:IP keyword argument to specify the IP address of the server. The players do not need to be on the same computer, but if they are, the calls to play should be in different tabs of DrScheme, or use launch-many-worlds.

To play a game using one player who controls the entire game, call (serve-singles), then call play as before.

When it is not your turn, you will see "Passive" displayed across the board. You are not able to modify the board, but you will see all changes as the opponent makes them. When the opponent defers to you, it will be your turn.

When it is your turn, you may roll the dice and move checkers around the board. To roll the dice, press "R". To select a checker, click on it. Once selected, it is attached to your cursor. Click again on an area of the board to place it.

When you’re done with your turn, press "D". This defers to the opponent and makes your board passive.

In a singles game, the opponent always and immediately defers back to you.

Just as on a real backgammon board, there is no checking of the validity of moves. It is up to the players, all of whom can see each move made, to enforce the rules of play.