{"id":36736964,"url":"https://github.com/code-game-project/tic-tac-toe-simple","last_synced_at":"2026-01-12T12:24:05.152Z","repository":{"id":57703508,"uuid":"495563500","full_name":"code-game-project/tic-tac-toe-simple","owner":"code-game-project","description":"A simple implementation of tic-tac-toe for CodeGame.","archived":false,"fork":false,"pushed_at":"2023-01-03T13:09:35.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-06-21T09:43:01.358Z","etag":null,"topics":["game","go","tic-tac-toe","tic-tac-toe-simple"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/code-game-project.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-05-23T20:28:31.000Z","updated_at":"2023-04-10T00:05:00.000Z","dependencies_parsed_at":"2023-02-01T06:15:56.980Z","dependency_job_id":null,"html_url":"https://github.com/code-game-project/tic-tac-toe-simple","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/code-game-project/tic-tac-toe-simple","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-game-project%2Ftic-tac-toe-simple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-game-project%2Ftic-tac-toe-simple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-game-project%2Ftic-tac-toe-simple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-game-project%2Ftic-tac-toe-simple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/code-game-project","download_url":"https://codeload.github.com/code-game-project/tic-tac-toe-simple/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-game-project%2Ftic-tac-toe-simple/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["game","go","tic-tac-toe","tic-tac-toe-simple"],"created_at":"2026-01-12T12:24:04.821Z","updated_at":"2026-01-12T12:24:05.147Z","avatar_url":"https://github.com/code-game-project.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tic-Tac-Toe Simple\n![CodeGame Version](https://img.shields.io/badge/CodeGame-v0.7-orange)\n![CGE Version](https://img.shields.io/badge/CGE-v0.4-green)\n\nA simple implementation of [tic-tac-toe](https://en.wikipedia.org/wiki/Tic-tac-toe) for [CodeGame](https://code-game.org).\n\nThis game is ideal for familiarizing yourself with CodeGame.\n\n## Known instances\n\n- `games.code-game.org/tic-tac-toe-simple`\n\n## Usage\n\n```sh\n# Run on default port 8080\ntic-tac-toe-simple\n\n# Specify a custom port\ntic-tac-toe-simple --port=5000\n\n## Specify a custom port through an environment variable\nCG_PORT=5000 tic-tac-toe-simple\n```\n\n### Running with Docker\n\nPrerequisites:\n- [Docker](https://docker.com/)\n\n```sh\n# Download image\ndocker pull codegameproject/tic-tac-toe-simple:0.3\n\n# Run container\ndocker run -d --restart on-failure -p \u003cport-on-host-machine\u003e:8080 --name tic-tac-toe-simple codegameproject/tic-tac-toe-simple:0.3\n```\n\n## Event Flow\n\n1. You receive a `start` event when a second player joins, which includes your sign ('x' or 'o').\n2. You regularly receive a `board` event, which includes the current state of the board.\n3. You receive a `turn` event, which includes the next sign to be placed.\n4. When it is your turn you can send a `mark` event with the row and the columnn (zero based), which should be marked with your sign.\n5. When the game is complete you will receive a `game_over` event, which includes which player wins and which fields form the winning row. Otherwise go to *3.*\n6. You will receive an `invalid_action` event when you try to do something that's not allowed like marking an already marked field.\n\n## Building\n\n### Prerequisites\n\n- [Go](https://go.dev) 1.18+\n\n```sh\ngit clone https://github.com/code-game-project/tic-tac-toe-simple.git\ncd tic-tac-toe-simple\ncodegame build\n```\n\n## License\n\nCopyright (C) 2022-2023 Julian Hofmann\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU Affero General Public License as published\nby the Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Affero General Public License for more details.\n\nYou should have received a copy of the GNU Affero General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-game-project%2Ftic-tac-toe-simple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-game-project%2Ftic-tac-toe-simple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-game-project%2Ftic-tac-toe-simple/lists"}