Backgammon

This is the game of backgammon, written in Java.

You can play against a friend, or against a (currently somewhat rudimentary) computer player.



You can move pieces either by clicking-and-dragging or by clicking on the from point and then on the to point. You can drag a single man the combination of both dice (e.g. you roll a 3 and a 4, you can move one man 7 points), as long as you can legally land on at least one of the points that one or the other die would get you to. If there is a single opponent on that intervening point, it will be automatically hit. Note that if both possible intervening points contain one opponent, the one on the point from the top die will be automatically hit. If you want to hit the other one, you must make two separate moves.

Clicking on Undo after making one (but not all) of your moves takes back all moves made (you keep the same dice rolls). Clicking on Undo when you have made no moves takes you back to the beginning of the other player's previous move.

To bear off at the end of the game, drag the men to the open area at the right side of the board.