Islands Text Client

Build Status

Text client for the Game of Islands.

It’s a game for two players, and each player has a board, which consists of a grid of one hundred coordinates. The grid is labeled with the numbers 1 through 10 across the top for the columns and down the left side for the rows. We name individual coordinates with this row-column combination.

The players cannot see each other’s boards.

The players have matching sets of islands of various shapes and sizes, which they place on their own boards. The players can move the islands around as much as they like until they say that they are set. After that, the islands must stay where they are for the rest of the game.

Once both players have set their islands, they take turns guessing coordinates on their opponent’s board, trying to find the islands. For every correct guess, we plant a palm tree on the island at that coordinate. When all the coordinates for an island have palm trees, the island is forested.

The first player to forest all of her opponent’s islands is the winner.

Inspired by the book Functional Web Development by Lance Halvorsen.</br>Also inspired by the course Elixir for Programmers by Dave Thomas.

Usage

To play the Game of Islands, clone islands_engine from GitHub and compile it:

Then, clone islands_text_client from GitHub and compile it:

You would then run the engine in node :islands@<hostname> specifying short name islands:

Player1 starts the game from a different node using any short name (here game1_player1):

Example:

Player2 joins the game from yet another node using any short name (here game1_player2):

Example:

Multiple games can be played simultaneously in this fashion.

Notes

When starting a game, a player can specify “auto mode” with a pause duration (in milliseconds) between moves:

Example:

Likewise when joining a game, a player can specify “auto mode” with a pause duration (in milliseconds) between moves:

Example:

The default mode is :manual and the default pause is 1 millisecond.

Any combination of modes is possible for the two players.

Example

We launch the Islands Engine in node islands (required):

engine_node

Player1 (Adam) starts the game from node client1 (for example):

player1_node

player1_start

Player2 (Eve) joins the game from node client2 (for example):

player2_node

player2_join

A feedback notifies player1 that an opponent has joined the game:

player1_react_join

A player can ask for help to know how to make a move:

player1_help

Player1 positions the 5 islands on the board (can be in any order):

player1_atoll_positioned

player1_dot_positioned

player1_l_shape_positioned

player1_s_shape_positioned

player1_square_positioned

Player1 declares his islands “set”:

player1_set

Player2 positions all her islands randomly in a single move:

player2_all_positioned

Player2 declares her islands “set”:

player2_set

A feedback notifies player1 that his opponent has set her islands:

player1_react_set

Then, starting with player1, each player must make a guess in turn:

player1_guess1

A feedback will show what the opponent’s guess was:

player2_react_guess1

player2_guess1

player1_react_guess1

player1_guess2

player2_react_guess2

player2_guess2

player1_react_guess2

Etcetera until one player wins and the other loses…

player1_guess_last-1

player2_react_guess_last-1

player2_guess_last

player1_react_guess_last

player1_guess_last

player2_react_guess_last