{"id":28999969,"url":"https://github.com/ripred/tictactoe","last_synced_at":"2025-07-25T06:38:28.624Z","repository":{"id":147027125,"uuid":"532285966","full_name":"ripred/TicTacToe","owner":"ripred","description":"Game engine for games requiring several pieces to be placed \"In-A-Row\" such as TicTacToe and Gomoku.  The board width and height can be customized.","archived":false,"fork":false,"pushed_at":"2023-02-19T20:10:49.000Z","size":33,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T08:47:13.803Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ripred.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-03T14:38:00.000Z","updated_at":"2023-01-16T19:26:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"c505de66-d71e-4e21-b41a-bdd79a3dc605","html_url":"https://github.com/ripred/TicTacToe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ripred/TicTacToe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripred%2FTicTacToe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripred%2FTicTacToe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripred%2FTicTacToe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripred%2FTicTacToe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ripred","download_url":"https://codeload.github.com/ripred/TicTacToe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ripred%2FTicTacToe/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266966727,"owners_count":24013756,"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","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-06-25T08:41:11.000Z","updated_at":"2025-07-25T06:38:28.612Z","avatar_url":"https://github.com/ripred.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TicTacToe\nGame engine for games requiring several pieces to be placed \"In-A-Row\" such as TicTacToe and Gomoku. Written in standard C++ so runs in any terminal. Has .xproj wrapper if you want to use it for builds/testing but it's not needed and compiles on any machine, OS, or std g++ capable platform.\n\nThe board width, height, and the number of pieces in a row required to win can all be customized.\n\nThis engine will always play a perfect game resulting in a win or a draw.\n\n```\n// Example output running 1000 games against itself\n// on a 7x7 grid requiring 7 In-A-Row to Win:\n\nturn = 1\n   0 1 2 3 4 5 6\n A . . . . . . .\n B . . . . . . .\n C . . . . . . .\n D . . . . . . .\n E . . . . . . .\n F . . . . . . .\n G . . . . . . .\nmaking move: { key: RANDOM1 value: D3 (24) }\n\nturn = 2\n   0 1 2 3 4 5 6\n A . . . . . . .\n B . . . . . . .\n C . . . . . . .\n D . . . X . . .\n E . . . . . . .\n F . . . . . . .\n G . . . . . . .\nmaking move: { key: RANDOM1 value: E4 (32) }\n\n\n\u003c snipped out turns 3 - 47 ... \u003e\n\n\n\n\nturn = 48\n   0 1 2 3 4 5 6\n A O X O O O O X\n B O X X O X X O\n C . O O O O X O\n D X O X X X O X\n E X X X X O . O\n F X X X X X O X\n G O X O O O O X\nmaking move: { key: RANDOM2 value: E5 (33) }\n\nturn = 49\n   0 1 2 3 4 5 6\n A O X O O O O X\n B O X X O X X O\n C . O O O O X O\n D X O X X X O X\n E X X X X O O O\n F X X X X X O X\n G O X O O O O X\nmaking move: { key: RANDOM2 value: C0 (14) }\n\n   0 1 2 3 4 5 6\n A O X O O O O X\n B O X X O X X O\n C X O O O O X O\n D X O X X X O X\n E X X X X O O O\n F X X X X X O X\n G O X O O O O X\n\nDraw!\n900\n800\n700\n600\n500\n400\n300\n200\n100\n\nResults[0] = 0      // player 0 win count\nResults[1] = 0      // player 1 win count\nResults[2] = 1,000  //         draw count\n\nGrid Width: 7\nTotal games: 1000\nTotal spots: 49\nTotal time: 1.83873 seconds\nAvg per game: 0.00183873 seconds\n0 Variations\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fripred%2Ftictactoe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fripred%2Ftictactoe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fripred%2Ftictactoe/lists"}