Skip to content
Phrogz edited this page Nov 2, 2011 · 9 revisions

Players: 2..4

Game Rules

Setup

Domohnoes is played with a standard set of 28 dominoes (blank through six).

The dominoes are shuffled, and then each player gets a hand of 7 dominoes. (Games with 2 or 3 players will not use all dominoes in the set.)

In the first game, the youngest player goes first. In subsequent games the winner of the previous game goes first.

The first player "opens" by playing any domino in their hand.

Gameplay

Play proceeds clockwise. Each player on their turn chooses a domino from their hand with at least one side that matches the pips exposed at either end of the board, and places it inline with the matching pips touching. "Double" dominoes (with the same number of pips on each end) are played inline; the result is no impact on the legal plays available to the next player.

A player must play on their turn if they can. If they cannot play they are said to have "chapped": they do nothing, and play proceeds to the next player.

Winning

If a player plays their last domino (resulting in an empty hand), the game is over and that player is the winner.

If every player has chapped consecutively (i.e., no player has any remaining legal plays) the game is over; the player with the lowest total number of pips in their hand is declared the winner.

Client/Server Communication

Starting a (Set of) Games

As described in Communication Overview the first message from the client to the server must be:

{
  "command":"start_game", "gametype":"com.danceliquid.domohnoes", "nick":"My Unique Name",
  "min_players":4, //optional; default is 2
  "rounds":100     //optional; default is 1
}

Starting a Particular Game

At the start of each new game round the server will send:

{"command":"new_game"}

This is your chance to reset any logic for the new game.

Game State

When it is time for your turn the server will send a command like the following:

{ "command":"move", "state":{
    "hand":[ [1,2],[0,5],[3,6],[3,3],[4,5],[3,4] ],
    "board":[ [1,5],[5,5] ]
} }

Your hand is an array of dominoes, where each domino is a unique pair of sorted numbers.

The board is guaranteed to have all dominoes "rotated" appropriately; the only playable locations are the first number in the first domino and the last number in the last domino.

Before the first player has played the board is an empty array ([]).

Making a Move

To make a play, send one of the following 'actions' to the server:

{"command":"move","action":"chapped"}                            /* I claim that I cannot move      */
{"command":"move","action":"play","domino":[1,5]}                /* Play the first domino           */
{"command":"move","action":"play","domino":[1,5],"edge":"left" } /* Play a domino on the left edge  */
{"command":"move","action":"play","domino":[1,5],"edge":"right"} /* Play a domino on the right edge */

The 'left' edge of the board may alternatively be indicated by: start, front, first.
The 'right' edge of the board may alternatively be indicated by: end, back, last.

Except on the first turn you must specify which edge to play the domino on. (The game will not pick one or the other for you, even though that would not affect gameplay.)

You do not need to "rotate" the domino appropriately; the game will do that when applying it to the board.

Asking If a Move Is Valid

If you aren't sure if a move is valid, you can send the server the command:

{"command":"valid_move?", "action":"play", "domino":[1,5], "edge":"left"}

The server will respond with either true or false.

End of Game

The game will automatically detect when a player has won. As described in Communication Overview the server will send to your client this message:

{"command":"gameover", "winner":"nickname of winner"}

Clone this wiki locally