online-tictactoe is a GUI online pygame version of tictactoe game with AI, server-side and client network has been created using python socket lib.
Online-TicTacToe (Client)
Online-tictactoe client is a client-side part of online-tictactoe game using python pygame lib aim to make a wonderful GUI for tictactoe game with simple network using socket and pickle lib.
There are two ways to use the client side :
-
Using exe version without any requirements :
-
Download entire exe dir.
-
Configure server.yaml file (set server host & port).
-
Run exe/main.exe.
-
Start playing!
-
-
Using runner.sh :
You can playing with any connected enemy or playing with AI.
-
configure server.yaml file for client.
-
start the server.
-
choose empty square using (mouse/keyboard).
-
hit enter to set a value.
-
wherever you play, your enemy will see the result immediately.
- press 'Play With AI' button.
- game will reseted and connection will not recv any data.
- there are four AI engine levels :
Test dir include tests for two classes :
- network.network.Network
- tictactoe.tictactoe.TicTacToe (only whoWinner function)
- tictactoe.tictactoe.TicTacToe (entire class)
- Install requirements:
$ sudo pip3 install -r requirements.txt
- All tests :
- Run all tests using runner.sh
$ ./runner.sh t
- network.network.Network class :
$ ./runner.sh tn
- tictactoe.tictactoe.TicTacToe (only whoWinner function) :
$ ./runner.sh tt
- tictactoe.tictactoe.TicTacToe (entire class) :
$ ./runner.sh ta
- Run all tests using runner.sh
Online-TicTacToe (Server)
Online-tictactoe server is a server-side part of online-tictactoe game using python socket lib and pickle lib aim to make a stable connection between two threaded tictactoe players and send/recv data from/to players as objects using pickle lib.
There are two ways to use the server :
-
Using exe version without any requirements :
-
Download entire exe dir
-
Configure server.yaml file (set server host & port)
-
Run exe/main.exe
-
Press start button
-
-
Using runner.sh and there are three ways:
-
Inside your machine (both CLI & GUI) :
- Install requirements:
$ sudo pip3 install -r requirements.txt
- Configure server.yaml file (set server host & port)
- CLI :
$ ./runner.sh c
- GUI :
$ ./runner.sh g
- Install requirements:
-
Inside docker container (only CLI version) :
- Configure server.yaml file (set server host & port)
- Build and run docker :
$ ./runner.sh host port
$ ./runner.sh 0.0.0.0 6000
-
The entire server.server.Server unit tests include within tests directory
- Install requirements:
$ sudo pip3 install -r requirements.txt
- Run tests using runner.sh
$ ./runner.sh t
👤 Hadi Alqattan
- Github: @hadialqattan
- Email: alqattanhadizaki@gmail.com
📝 License
Copyright © 2020 Hadi Alqattan.
This project is MIT licensed.
Give a ⭐️ if this project helped you!