{"id":17723771,"url":"https://github.com/ncw/oxo3d","last_synced_at":"2025-03-14T05:32:02.358Z","repository":{"id":140294306,"uuid":"138567120","full_name":"ncw/oxo3d","owner":"ncw","description":"Oxo3d - 3D noughts and crosses / tic tac toe","archived":false,"fork":false,"pushed_at":"2018-06-26T19:28:58.000Z","size":41,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-02T06:05:09.824Z","etag":null,"topics":["game","go","gopherjs","tictactoe-game"],"latest_commit_sha":null,"homepage":null,"language":"Go","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/ncw.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}},"created_at":"2018-06-25T08:42:09.000Z","updated_at":"2018-10-16T16:00:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"ddf79bfd-60e9-42c0-baeb-6f8072f810d0","html_url":"https://github.com/ncw/oxo3d","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncw%2Foxo3d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncw%2Foxo3d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncw%2Foxo3d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ncw%2Foxo3d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ncw","download_url":"https://codeload.github.com/ncw/oxo3d/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243532517,"owners_count":20306151,"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":["game","go","gopherjs","tictactoe-game"],"created_at":"2024-10-25T15:43:59.939Z","updated_at":"2025-03-14T05:32:02.350Z","avatar_url":"https://github.com/ncw.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oxo3d\n\nThis is a suite of Go programs for playing and testing 3D noughts and crosses / tic tac toe.\n\nTry [Oxo3d online](https://www.craig-wood.com/nick/oxo3d/).\n\nOr try it in your terminal in old school ASCII:\n\n    go get -u github.com/ncw/oxo3d\n    oxo3d\n\n```\n+-------------+-------------+\n| .  .  .  .  |  0  1  2  3 |\n| .  .  .  .  |  4  5  6  7 |\n| .  .  .  .  |  8  9 10 11 |\n| .  .  .  .  | 12 13 14 15 |\n+-------------+-------------+\n| .  .  .  .  | 16 17 18 19 |\n| .  .  .  .  | 20 21 22 23 |\n| .  .  .  .  | 24 25 26 27 |\n| .  .  .  X* | 28 29 30 31 |\n+-------------+-------------+\n| .  .  .  .  | 32 33 34 35 |\n| .  .  .  .  | 36 37 38 39 |\n| .  .  .  .  | 40 41 42 43 |\n| .  .  .  .  | 44 45 46 47 |\n+-------------+-------------+\n| .  .  .  .  | 48 49 50 51 |\n| .  .  .  .  | 52 53 54 55 |\n| .  .  .  .  | 56 57 58 59 |\n| .  .  .  .  | 60 61 62 63 |\nGo (0..63) \n```\n\nOr try [Oxo3d on your Android\ndevice](https://play.google.com/store/apps/details?id=com.craig_wood.Oxo3d).\nThe Go code here is a port of the Java code used in this game.\n\n## Playing the game\n\nOxo 3D is a 3 dimensional (4x4x4) noughts-and-crosses / tic-tac-toe\ngame.  This is a game with considerably more strategy than the\ntraditional 3x3 version.\n\nYou're O and you have to get 4 in a row.  The board is a cube\nviewed in slices.  Imagine the 4 slices piled on top of each\nother.\n\nWatch out for tricky diagonal lines!\n\nGood luck!\n\n## How to play 3D Noughts-and-Crosses\n\nEach group of 4x4 positions represents one plane on the cube.\n\nOn each layer there are 10 possible winning lines, 4 horizontal, 4\nvertical and two diagonal.\n\nHowever lines may run from layer to layer also.\n\nThere are 76 lines in total possible, these are 4x4 = north-south\nlines, 16 east-west lines, 16 vertical lines, 2x4x3 = 24 diagonal\nlines from one edge to another, and 4 diagonal ines from corner to\ncorner.\n    \n## Levels\n    \nThere are 6 carefully graduated levels with interesting names.\n\nThe levels get increasingly hard.  *Easy* and *Simple*\nuse the same simple heuristic player, but *Easy* makes random\nmistakes.  *Sneaky* uses a two level lookahead player.  It is\ncalled *Sneaky* for good reason as you'll see when you play it.\n*Relentless* plays very slightly better than *Sneaky*\nbut with a completely different style.  *Hard* is exactly that\nand *Very Hard* plays so well that I haven't beaten it yet.\n\n| Level name | Internal name | Description | Rank |\n| ---------- | --------------| ----------- | ---- |\n| Easy       | Heuristic0    | 1 level lookahead heuristic player with random errors | 1 |\n| Simple     | Heuristic1    | 1 level lookahead heuristic player | 2 |\n| Sneaky     | Heuristic2    | 2 level lookahead heuristic player | 3 |\n| Relentless | AlphaBeta2    | 2 level lookahead minimax player   | 4 |\n| Hard       | AlphaBeta3    | 3 level lookahead minimax player   | 5 |\n| Very Hard  | AlphaBeta4    | 4 level lookahead minimax player   | 6 |\n    \nIf you play 2,500 rounds of each one against the other this is what\nthe scores look like.  A Random player is included too as a\ncontrol. There are some interesting reversals of form in the table\n\n| Player 1   | Player 2   | Wins  | Draws | Losses | Player 1 time per go | Player 2 time per go |\n| :--------- | :--------- | ----: | ----: | -----: | ------------: | ------------: |\n| Heuristic0 |     Random |  2500 |     0 |      0 |     182041 ns |       3506 ns |\n| Heuristic1 |     Random |  2500 |     0 |      0 |      17193 ns |       1502 ns |\n| Heuristic2 |     Random |  2500 |     0 |      0 |      24100 ns |        789 ns |\n| AlphaBeta1 |     Random |  2500 |     0 |      0 |      18244 ns |       1320 ns |\n| AlphaBeta2 |     Random |  2500 |     0 |      0 |     220337 ns |        307 ns |\n| AlphaBeta3 |     Random |  2500 |     0 |      0 |    6296231 ns |        318 ns |\n| AlphaBeta4 |     Random |  2500 |     0 |      0 |   88652221 ns |        413 ns |\n| Heuristic1 | Heuristic0 |  2470 |     0 |     30 |      10722 ns |     145330 ns |\n| Heuristic2 | Heuristic0 |  2274 |    22 |    204 |      17717 ns |     120008 ns |\n| AlphaBeta1 | Heuristic0 |  2185 |     0 |    315 |      14914 ns |     146380 ns |\n| AlphaBeta2 | Heuristic0 |  2465 |     1 |     34 |     248772 ns |      51983 ns |\n| AlphaBeta3 | Heuristic0 |  2470 |     0 |     30 |    6134420 ns |      19663 ns |\n| AlphaBeta4 | Heuristic0 |  2489 |     1 |     10 |  133985769 ns |      15304 ns |\n| Heuristic2 | Heuristic1 |  1002 |   642 |    856 |      16801 ns |       8780 ns |\n| AlphaBeta1 | Heuristic1 |   242 |     2 |   2256 |      15445 ns |      10625 ns |\n| AlphaBeta2 | Heuristic1 |  1187 |   486 |    827 |     184999 ns |       8261 ns |\n| AlphaBeta3 | Heuristic1 |  1470 |   124 |    906 |    4577929 ns |       8403 ns |\n| AlphaBeta4 | Heuristic1 |  1775 |   216 |    509 |   93224450 ns |       8681 ns |\n| AlphaBeta1 | Heuristic2 |   864 |    45 |   1591 |      13980 ns |      20328 ns |\n| AlphaBeta2 | Heuristic2 |  1326 |   621 |    553 |     156175 ns |      16215 ns |\n| AlphaBeta3 | Heuristic2 |  1848 |    81 |    571 |    4485952 ns |      19077 ns |\n| AlphaBeta4 | Heuristic2 |  1599 |   660 |    241 |   49535585 ns |      16807 ns |\n| AlphaBeta2 | AlphaBeta1 |  2220 |     1 |    279 |     234968 ns |      13948 ns |\n| AlphaBeta3 | AlphaBeta1 |  2095 |     9 |    396 |    6054260 ns |      13851 ns |\n| AlphaBeta4 | AlphaBeta1 |  2388 |     0 |    112 |  151574104 ns |      14706 ns |\n| AlphaBeta3 | AlphaBeta2 |  1266 |    59 |   1175 |    4487537 ns |     237976 ns |\n| AlphaBeta4 | AlphaBeta2 |  1319 |   193 |    988 |   86538385 ns |     223163 ns |\n| AlphaBeta4 | AlphaBeta3 |  1740 |    85 |    675 |   82880581 ns |    4723343 ns |\n    \n...and here is the league table summary of the above\n    \n| Player     | Score  | CPU Time      |\n| :--------- | -----: | ------------: |\n|     Random | -17500 |          72ms |\n| Heuristic0 | -11230 |        11.56s |\n| AlphaBeta1 |  -4287 |         1.98s |\n| Heuristic2 |   2035 |         4.54s |\n| Heuristic1 |   4618 |         2.04s |\n| AlphaBeta3 |   7506 |     15m51.07s |\n| AlphaBeta2 |   7583 |        45.25s |\n| AlphaBeta4 |  11275 |   5h19m56.46s |\n\nInterestingly the Heuristic1 player beats the Heuristic2 player\noverall, however you'll see in the detailed breakdown that the\nHeuristic2 player beats the Heuristic1 player.\n\n## History\n\n  * Converted to Web with Gopherjs (2018)\n  * Converted to Go (2013)\n  * Converted to Java on Android (2010)\n  * Converted to Python (2004)\n  * Converted to Perl (2000)\n  * Converted to C (1996)\n  * Converted to Psion 3a OPL (1994)\n  * Converted to BBC Basic (1985)\n  * Converted to QL BASIC(1985)\n  * Writen in ZX81 BASIC (1983)\n  * 35 Years in the Making!\n\nI used to play this game with my father when I was a boy.  We always\nused to play on squared paper while sitting round the kitchen table.\nWhen I was old enough (and the home computer had been invented) this\ninspired me to write a computer player for the game.\n\nThe very first version of this game was written in 1983 on a Sinclair\nZX81 in BASIC.  It used to take 60 seconds to think of a move, and it\nused to beat the author nearly all of the time.  It used the\nHeuristic1 player.  However computing has moved on, and the current\nversion plays at a much higher strength almost instantly.  The author\nhas improved too!\n    \n## Contacting the Author\n\nIf you have a problem with *Oxo 3D*, it goes wrong in some fashion\nthen file an issue.  If you just want to say hello then you'll find my\nemail address below!\n\nNick Craig-Wood\nnick@craig-wood.com","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncw%2Foxo3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fncw%2Foxo3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fncw%2Foxo3d/lists"}