Skip to content

ItzBlinkzy/TicTacTCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TicTacTCP

Simple networked Tic-Tac-Toe. One server hosts the game, two clients can connect and play over TCP sockets. Default port: 27015.

What it does

  • Server waits for two players, runs a 3x3 Tic-Tac-Toe game.
  • Server sends board updates to both clients.
  • Clients send moves (1-9) to the server when it's their turn.

Requirements

  • gcc (MinGW/MSYS2 on Windows, standard gcc on Linux/macOS)
  • On Windows, link with ws2_32 (build script does this).

Build

Windows (PowerShell):

  • Run the provided script: .\build.ps1

Linux / macOS:

  • Make script executable and run: chmod +x build.sh ./build.sh

Run

  1. Start server:

    • Windows: .\server.exe
    • Unix: ./server
  2. Start two clients (each in its own terminal):

    • Windows: .\client.exe <server-ip>
    • Unix: ./client <server-ip> Example (local): ./client 127.0.0.1

Controls

When it's a clients turn you will be prompted: enter a number 1-9.

1 2 3
4 5 6
7 8 9

About

Tic Tac Toe but over TCP Sockets🤯

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors