Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/davidfstr/tic-tac-idris
Tic-tac-toe game written in Idris.
https://github.com/davidfstr/tic-tac-idris
idris tic-tac-toe
Last synced: about 2 months ago
JSON representation
Tic-tac-toe game written in Idris.
- Host: GitHub
- URL: https://github.com/davidfstr/tic-tac-idris
- Owner: davidfstr
- Created: 2015-02-13T03:53:00.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-03-07T03:04:04.000Z (almost 10 years ago)
- Last Synced: 2024-04-16T02:16:31.799Z (9 months ago)
- Topics: idris, tic-tac-toe
- Language: Idris
- Size: 133 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tic-tac-idris
This is a tic-tac-toe game written in Idris.
I wrote it as an exercise for learning basic functionality in Idris.
This program does not make much use of language facilities unique to
dependently-typed programming languages or Idris such as proof terms.
As such this tic-tac-toe implementation could be translated quite
straightforwardly to another functional programming language such
as Haskell.For a program that makes heavier use of facilities unique to dependently-typed
languages, see my [proven-correct implementation of insertion sort].[proven-correct implementation of insertion sort]: https://github.com/davidfstr/idris-insertion-sort
## Prerequisites
* Idris 0.9.16
* Make## How to Run
```
make run
```## Example Game
```
$ make run
idris -o TicTacToe TicTacToe.idr
./TicTacToe
| |
---|---|---
| |
---|---|---
| |Next move? (0-8) 4
| |
---|---|---
| X |
---|---|---
| |Next move? (0-8) 0
O | |
---|---|---
| X |
---|---|---
| |Next move? (0-8) 2
O | | X
---|---|---
| X |
---|---|---
| |Next move? (0-8) 1
O | O | X
---|---|---
| X |
---|---|---
| |Next move? (0-8) 6
O | O | X
---|---|---
| X |
---|---|---
X | |X wins!
```## License
MIT.