https://github.com/holsee/xyozys
Coding Challenge: Implement Xy Ozys game
https://github.com/holsee/xyozys
Last synced: 2 months ago
JSON representation
Coding Challenge: Implement Xy Ozys game
- Host: GitHub
- URL: https://github.com/holsee/xyozys
- Owner: holsee
- Created: 2019-04-16T13:27:51.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-17T09:14:40.000Z (about 6 years ago)
- Last Synced: 2025-02-05T06:44:39.142Z (4 months ago)
- Language: Elixir
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Xy Ozys
=======
Aka. Tic-Tac-Toe, Noughts and Crosses etc.## Challenge
Implement a library which enables playing games of Xy Ozys.
### Rules
* Expose similar API to that defined in the _Spec_, however you may diverge for lang idiom reasons.
* Implement using [functional programming](https://en.wikipedia.org/wiki/Functional_programming).
* Write tests for the public API.## Spec
### Functions
Start a new game:
```
new() # => Game
```Player makes a move:
```
turn(Game, Cell, Player) # => Ok(Game) | Error(Reason)
```Query the game state:
```
status(Game) # => Status
```### Types
```
Game # Reference to the game
Cell # Reference to a position within the game board
Player # 'X' or 'O'
Status # "Tie", "X Wins", "O Wins", "X's Turn", "O's Turn"
Reason # Reason that `turn` operation was invalid e.g. "Game over", "Not X's turn" etc.
```