TicTacToe TUI implementation in Rust 🦀
You have to compile it yourself, but that shouldn't be a problem. Only thing
you need is cargo
. You need to go to the tictactoe
project folder and run:
cargo build -r
After it's done compiling, you can start it in ./target/release/tictactoe
.
You can start tictactoe
game like this (automatically fills screen):
./tictactoe
If you want to set specific size and win length, you can do it like this:
./tictactoe -s <width> <height> -w <win_length>
All the usage and flags can be seen in the help:
./tictactoe -h
When you start the game, you immediately see the board. Above the board,
there's current game state and score. It displays who's turn it is, who won or
whether game is a draw and score between the two players. There's one cell,
which is selected (has bold border). You can change selected cell using
Arrow
keys and using hjkl
keys. Player on turn can place its symbol by
pressing Enter
. The symbol will appear in the selected cell.
When any player reaches set win length (by default 5), the winning sequence
gets crossed out. The game then can be restarted by pressing r
key.
Arrow
keys: moves selected cellEnter
: places symbol on selected cellr
: restarts the gameR
: resets the scoreEsc
/q
: exists the game
- Author: Martan03
- GitHub repository: tictactoe
- Author website: martan03.github.io