Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Update README.md for 0.3.0
  • Loading branch information
brinza888 authored Apr 25, 2024
1 parent c003388 commit 51e596b
Showing 1 changed file with 33 additions and 44 deletions.
77 changes: 33 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,62 +1,51 @@
# TicTacToe game
TicTacToe game with AI written in C (terminal interactive interface).

**Only Linux** is currently supported as target platform.
**Only Linux** is currently supported as main platform, but there is CMakeLists.txt, which can be useful to compile project on Windows.

## How to start game
### Method 1 - Use already compiled executable
1. Download latest release in Releases section on GitHub.
2. Extract downloaded archive.
3. Run executable file:
```
./ttt
```
Download latest release, extract archive and run already compiled executable file.

### Method 2 - Download sources and build
1. Install requirements for build
```
### Method 2 - Download sources and compile yourself
Install requirements for build (apt as example)
```bash
sudo apt update && sudo apt install -y git make gcc libncurses-dev
```
2. Clone repo:
```
git clone https://github.com/BrinzaBezrukoff/tictactoe.git
```
3. Navigate inside repository directory:
```
cd tictactoe
```
4. Build with GNU Make and GCC
Clone repo and navigate inside directory
```bash
git clone https://github.com/brinza888/tictactoe.git && cd tictactoe
```
Build with GNU Make and GCC
```bash
make
```
5. Run executable file
```
./ttt
Run executable file
```bash
./bin/ttt
```
#### Some extra make options
1. For systems with gnome-terminal installed there is option to run game in separated window:
Also you can simply install tictactoe to /usr/bin location (by default), using `install` target
```bash
make install
```
make window
```
2. Build and run in one line:

### Method 3 - Docker (self-hosted OpenSSH server)
This asuume you have Docker installed.

Clone repo and navigate inside directory
```bash
git clone https://github.com/brinza888/tictactoe.git && cd tictactoe
```
make run
Build Docker image
```bash
docker build -t tictactoe -f docker/Dockerfile .
```
3. Clean everything related to build
Run in background
```bash
docker run -d -v tictactoe:/etc/ssh/keys -p 9999:22 tictactoe
```
make clean
Now connect using user `ttt` (without password)
```bash
ssh -p 9999 ttt@localhost
```

## Gameplay
AI is playing as zero, human is playing as cross and always starts.

1. Choose level mode for AI **using arrow buttons** (this feature in develoment, modes are not balanced).

![image](https://user-images.githubusercontent.com/29017599/145648147-60493a5a-9297-4e91-ace0-eb3952e61be4.png)

2. When it is your time to make turn, **use arrow buttons** to navigate on map. Selection is marked with yellow crosses. Press enter to place Cross in selected cell.

![image](https://user-images.githubusercontent.com/29017599/145648244-b8f91880-a3f5-43aa-b557-976020f0186a.png)

![image](https://user-images.githubusercontent.com/29017599/145648543-74bd5d3f-54bd-48d5-829e-c30a338879bf.png)

This method can be used wherever you are since after deployment on server you will be need only SSH client on machine you want!

0 comments on commit 51e596b

Please sign in to comment.