An open API service indexing awesome lists of open source software.

https://github.com/zsarge/tic-tac-toe

tic-tac-toe in rust
https://github.com/zsarge/tic-tac-toe

game rust tic-tac-toe

Last synced: 18 days ago
JSON representation

tic-tac-toe in rust

Awesome Lists containing this project

README

          

# tic-tac-toe

This was a project I made in an attempt to learn [Rust](https://www.rust-lang.org).

This is not a fully featured tic-tac-toe game, but it runs the basic game.

Example output:

```
1 | 2 | 3
---+---+---
4 | 5 | 6
---+---+---
7 | 8 | 9

- X's move:
5

1 | 2 | 3
---+---+---
4 | X | 6
---+---+---
7 | 8 | 9

- O's move:
0
- Please enter a number from 1 to 9.
5
- Please enter a number that has not been chosen.
2

1 | O | 3
---+---+---
4 | X | 6
---+---+---
7 | 8 | 9

- X's move:
6

1 | O | 3
---+---+---
4 | X | X
---+---+---
7 | 8 | 9

- O's move:
4

1 | O | 3
---+---+---
O | X | X
---+---+---
7 | 8 | 9

- X's move:
3

1 | O | X
---+---+---
O | X | X
---+---+---
7 | 8 | 9

- O's move:
7

1 | O | X
---+---+---
O | X | X
---+---+---
O | 8 | 9

- X's move:
9

1 | O | X
---+---+---
O | X | X
---+---+---
O | 8 | X

Game over!
```