Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 3.25 KB

README.md

File metadata and controls

52 lines (40 loc) · 3.25 KB

🛶 Canoe 🛶

A tic-tac-toe like two-player strategy game.

Objective

Players take turns placing colored pegs into available holes, one at a time. The first to complete two completed "canoes" wins. A "canoe" is formed by four pegs in this configuration (or any rotation). The two canoes may not share any pegs.

Horizontal Vertical
⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ 🔴 ⚪ ⚪
⚪ 🔴 ⚪ ⚪ 🔴 ⚪ ⚪ ⚪ 🔴 ⚪ ⚪ ⚪
⚪ ⚪ 🔴 🔴 ⚪ ⚪ ⚪ ⚪ 🔴 ⚪ ⚪ ⚪
⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ ⚪ 🔴 ⚪ ⚪

Default board layout

The only available board is based on the original design by Dale Walton.

Compiling

Compile changes into javascript and run the Elm reactor server with elm make src/Canoe.elm --output=assets/js/main.js && elm reactor

JSON Codes

Backend -> Frontend

"action" "content" Description
connect_to_server "" Server has connected. Respond with a request to create a user.

To be continued

Frontend -> Backend

"action" "content" Description
submit_move {"team": 1, "pos": {"x": x, "y": y} Submit list of moves
create_user "" Add user
update_user {"username": "User", "color": "#faefa0", "score": 5, "is_admin": true, "is_muted": false} Update user
update_chat {"user": <User>, "msg": "Hello!", "kind": 0} Send chat message
ping "ping" Send "ping" every 50 seconds to maintain the connection.