###### tags: `chalmers` # Diamond (game) ![game board](https://upload.wikimedia.org/wikipedia/commons/thumb/f/f9/Diamond%2C_Puzzle_1.PNG/410px-Diamond%2C_Puzzle_1.PNG) (image from [wikipedia](https://en.wikipedia.org/wiki/Diamond_(game))) ## Proposal <!--"1 or 2 sentences"--> We want to model a little board game for 2 players called diamond. It is a game based on the _first-place-then-move_ principle of 9-men-morris. Our program will start with only the core logic of the game being implemented in a stand-alone module so that the game can be played by sending the coordinates of the specific move ("like b1-b2") via the terminal and gives for every move a text-based representation of the current state of the game. The rules and the notation convention for the moves can be found here: [Diamond (game) wiki](https://en.wikipedia.org/wiki/Diamond_(game)) ![simplified board](https://i.imgur.com/qF6n17P.jpg =400x) (simplified board to see the possible moves) ## First submission The current version of the game can be played in the terminal by sending input moves as strings following the official notation convention ([wikipedia](https://en.wikipedia.org/wiki/Diamond_(game))). For this, the `Parsing` module provided in the course has been used to implement `Read` so to match `Show` of all displayable custom types. We can also interactively create a game file consisting of a list of all valid moves. Unfortunately, we couldn't solve a problem with the cornering move (we could make it work at all, but further testing is needed to understand if it's just a bug or an error in the logic). Our plan is to fix the logic and to instance a "smart" generator for game files (whith a different strategy than the one currently use to accertain the validity of the moves) and use it to test the correctness of our model. The final step would be to use something like the `diagrams` library to have a nicer visual output for the current state of the board. Additionally, the conditions for Draws and some "meta-moves" (as for the ability to surrend) could be added.