The following is a list of 8 move constraints, each of which corresponds to its own rule governing the legality of backgammon moves. Six of these constraints have to do with dragging and dropping pieces on the board, and the other 2 constraints affect the outcome of the user clicking the "Next" button: only if none of them are violated does the next-player method of the game-server object get called.
Drag from Board
1. Drag is enabled only if piece being dragged belongs to current player (exception: if current point contains exactly one piece of current player, and piece being dragged is the only piece of opposing player on this point, then enable drag).
2. Drag is disabled if piece being dragged is not on the bar and at least one piece of current player is on the bar.
Drop on Board
1. Disable drop if destination point contains more than one piece belonging to opposing player.
2. Let x = value of distance moved. If x = 0 then enable drop. Otherwise, disable drop if x not found in list of outstanding move values. In case of doubles, this list initially contains 4 integers (otherwise only 2 integers).
3. Disable drop if destination point is the home point and at least one piece belonging to current player is not in position to bear off.
4. Disable drop if piece belongs to opposing player and destination point is not the bar.
1. Enable next button if list of outstanding move values is empty.
2. Otherwise, disable next button if the following is true: for all outstanding move values, if any move value is equal to at least one move value in the list of all possible moves for current player.