chore: minor changes
1 file changed
tree: 567816ec3ddc0d47d0fa11e0e3cbd5ba1e14de88
  1. bin/
  2. doc/
  3. resources/
  4. src/
  5. test/
  6. .gitignore
  7. LICENSE
  8. project.clj
  9. README.md
  10. README.org
README.md
______       _   _   _           _     _
| ___ \     | | | | | |         | |   (_)
| |_/ / __ _| |_| |_| | ___  ___| |__  _ _ __
| ___ \/ _` | __| __| |/ _ \/ __| '_ \| | '_ \
| |_/ / (_| | |_| |_| |  __/\__ \ | | | | |_) |
\____/ \__,_|\__|\__|_|\___||___/_| |_|_| .__/
                                        | |      ______ ______ ______
                                        |_|     |______|______|______|

Battleship

What it is about?

This game targets all developers, no matter the language they use. The idea behind is to make each developer write small programs and get challenged against other developers.

Game principle

It's a contest game. To win, players must shoot as much enemies as they can. NB: They are not shooting each others !!!

How to play

To play this game you must know about:

Game architecture

The Battleship game is based on a REST client-server architecture. The server side is already developed and hosts the game logic. It is available at this url: http://battleship.dwlo.cloudbees.net. So all your requests will address that server.

The REST API

This part is at your charge. You have to code your own REST client using the following APIs:

Start a new game play

This request is made once per game play and shared with other players as game identifier.

  1. Method : POST

  2. URI : /games

  3. RESPONSE :

    {
        "game-id": "32060218-5c1b-4b00-8b11-be49b1479c89"
    }
    

Fire on the enemy

  1. Method : PUT

  2. URI : /games/game-id/players/player-id/fire

  3. RESPONSE :

    {
        "fire-status": "success|failure",
        "game-status": "running|over",
        "score": {
            "D": 1,
            "L": 1
        }
    }
    

Show the battleship plan

  1. Method : GET

  2. URI : /games/game-id/battlefield

  3. RESPONSE :

    -|-|-|-|-
    -|D|-|-|-
    -|-|-|L|-
    -|-|-|-|-
    -|-|-|-|-
    

CLIENTS

BASH REST client (Default implementation)

This is a sample to quickly test the game and write your own client. Once done you can share your implementation and send me a pull request. Find the BASH REST client here How to play ? Fetch the repository, go to the bin directory and execute the battleship-client