{"id":29541193,"url":"https://github.com/tornikegomareli/zig-tictactoe","last_synced_at":"2025-07-17T09:02:44.506Z","repository":{"id":304412448,"uuid":"1018262677","full_name":"tornikegomareli/zig-tictactoe","owner":"tornikegomareli","description":"Simple Multiplayer Tic Tac Toe game written in Zig with Raylib.","archived":false,"fork":false,"pushed_at":"2025-07-12T23:31:52.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-13T00:18:48.495Z","etag":null,"topics":["networking","raylib","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tornikegomareli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-11T22:45:47.000Z","updated_at":"2025-07-13T00:01:25.000Z","dependencies_parsed_at":"2025-07-13T00:29:17.911Z","dependency_job_id":null,"html_url":"https://github.com/tornikegomareli/zig-tictactoe","commit_stats":null,"previous_names":["tornikegomareli/zig-tictactoe"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/tornikegomareli/zig-tictactoe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tornikegomareli%2Fzig-tictactoe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tornikegomareli%2Fzig-tictactoe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tornikegomareli%2Fzig-tictactoe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tornikegomareli%2Fzig-tictactoe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tornikegomareli","download_url":"https://codeload.github.com/tornikegomareli/zig-tictactoe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tornikegomareli%2Fzig-tictactoe/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265587543,"owners_count":23793144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["networking","raylib","zig"],"created_at":"2025-07-17T09:02:30.208Z","updated_at":"2025-07-17T09:02:44.490Z","avatar_url":"https://github.com/tornikegomareli.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tic Tac Toe Multiplayer in Zig\n\nA multiplayer Tic Tac Toe game built to learn the Zig programming language.\n\n![CleanShot 2025-07-13 at 03 11 27](https://github.com/user-attachments/assets/7ff5ff5c-0f09-4dbe-b793-e4672a9ecee6)\n\n\n## Educational Purpose\n\nThis project was created for educational purposes to learn:\n- Zig programming language fundamentals\n- TCP socket networking\n- State management\n- Modularity\n\n## What we have\n\n- **Local Play**: Two players on the same computer\n- **Network Multiplayer**: Host or join games over TCP\n- **Real-time Synchronization**: Instant move updates between players\n- **Cross-platform**: Works on macOS, Linux, and Windows\n\n## Technologies Used\n\n- **[Zig](https://ziglang.org/)** - A general-purpose programming language and toolchain\n- **[Raylib](https://www.raylib.com/)** - A simple and easy-to-use library for game development\n- **[raylib-zig](https://github.com/Not-Nik/raylib-zig)** - Zig bindings for Raylib\n\n## Prerequisites\n\n- Zig 0.14.0 or later\n- Git\n\n## Getting Started\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/yourusername/learn-zig.git\ncd learn-zig\n```\n\n2. Build the project:\n```bash\nzig build\n```\n\n3. Run the game:\n```bash\nzig build run\n```\n\n## How to Play\n\n### Local Play\n1. Launch the game and select \"Local Play\"\n2. Players take turns clicking on the grid\n3. First player to get 3 in a row wins\n\n### Network Multiplayer\n\n**To host a game:**\n1. Select \"Host Game\" from the main menu\n2. Note the port number (default: 5555)\n3. Share your IP address with the other player\n4. Wait for them to connect\n\n**To join a game:**\n1. Select \"Join Game\" from the main menu\n2. Enter the host's IP address\n3. Enter the port number (default: 5555)\n4. Click \"Connect\"\n\n**Game Rules:**\n- The host plays as X and goes first\n- The client plays as O\n- Players take turns clicking empty squares\n- First to get 3 in a row wins\n\n## Project Structure\n\n```\nsrc/\n├── main.zig         # Entry point and game loop\n├── game.zig         # Game logic and state management\n├── renderer.zig     # All drawing and UI rendering\n├── network.zig      # TCP networking implementation\n├── ui_state.zig     # UI state definitions\n├── input.zig        # Input handling utilities\n└── constants.zig    # Shared constants and configuration\n```\n\n## Building from Source\n\nThe project uses Zig's built-in build system. The `build.zig` file configures:\n- Executable compilation\n- Raylib dependency linking\n- Build options and flags\n\nTo build in release mode for better performance:\n```bash\nzig build -Doptimize=ReleaseFast\n```\n\n## Network Protocol\n\nThe multiplayer mode uses a simple TCP protocol with message types:\n- `CONNECT` - Initial handshake\n- `MOVE` - Transmit player moves\n- `RESET` - Restart the game\n- `DISCONNECT` - Clean disconnection\n\nMessages are serialized with a 4-byte header indicating message length.\n\n## Learning Resources\n\nFor those learning Zig:\n- [Zig Language Documentation](https://ziglang.org/documentation/master/)\n- [Ziglearn](https://ziglearn.org/)\n- [Zig by Example](https://zigbyexample.github.io/)\n\nFor Raylib:\n- [Raylib Cheatsheet](https://www.raylib.com/cheatsheet/cheatsheet.html)\n- [Raylib Examples](https://www.raylib.com/examples.html)\n\n## Acknowledgments\n\n- The Zig community for excellent documentation\n- [Raylib](https://github.com/raysan5/raylib)\n- [raylib-zig](https://github.com/Not-Nik/raylib-zig) for the Zig bindings of the Raylib\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftornikegomareli%2Fzig-tictactoe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftornikegomareli%2Fzig-tictactoe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftornikegomareli%2Fzig-tictactoe/lists"}