Skip to content

Latest commit

 

History

History

client

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

Usage 🗝

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!

      ttt-interface

  • Using runner.sh :

    • Install requirements :

      $ sudo pip3 install -r requirements.txt
    • Run the game :

      $ ./runner.sh g
    • Start playing!

      ttt-interface

Demo 🧮

You can playing with any connected enemy or playing with AI.

Play Online (online)

Start the server to start playing

  • configure server.yaml file for client.

  • start the server.

    start-the-server

Start playing with stable connection!

  • choose empty square using (mouse/keyboard).

  • hit enter to set a value.

  • wherever you play, your enemy will see the result immediately.

    state-share

Winning / Losing cases

  • the game will reseted.

  • your symbol will changed.

    win-lose-cases

Play With AI (offline & online)

Change from online mode to AI mode

  • press 'Play With AI' button.
  • game will reseted and connection will not recv any data.
  • there are four AI engine levels :
    • the level will automatically increased when you win.

    • maximum level is 4.

    • after each game you'll get a new playing symbol.

      change-to-ai-mode

Set value and get AI response

  • choose empty square using (mouse/keyboard).

  • hit enter to set a value.

  • you'll get an AI response.

    ai-res

Winning case

  • AI engine level will increased.

  • the game will reseted.

  • your symbol will changed.

    win

Losing case

  • AI engine level will not increased.

  • the game will reseted.

  • your symbol will changed.

    lose

Tests 🧪

Test dir include tests for two classes :

Run instructions :