Skip to content

Generating a dataset of the 765 unique game boards, and the connections between them, in the game of tic-tac-toe.

Notifications You must be signed in to change notification settings

knutsynstad/tic-tac-toe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tic-tac-toe

Generating a dataset of the 765 unique game boards, and the connections between them, in the game of tic-tac-toe.

boards.json data structure

 [
  {...},
  ...
  {
    "id": 278,
    // Unique ID
    "cells": [
      "X",
      "E",
      "O",
      "X",
      "E",
      "E",
      "E",
      "X",
      "O"
    ],
    // Cells of the game board
    // Left-to-right and top-to-bottom
    // Can be 'X', 'O', or 'E' for empty
    "symmetries": [
      "duplicate",
      "rotational"
    ],
    // If another board was excluded based on this board,
    // how was it similar? (duplicate/symmetrical)
    // 'duplicate', 'rotational', or 'reflectional'
    "parents": [
      100,
      114,
      141
    ],
    // List of game board IDs that preceeded this one
    "children": [
      378,
      494,
      497,
      486
    ],
    // List of game board IDs that followed this one
    "result": false,
    // Game result
    // 'false' if the game is ongoing
    // 'X', 'O', or 'draw' if the game is over
    "level": 5
    // Game move (0–9)
  },
  ...
  {...}
 ]

Do it yourself

  1. Clone the repository:
git clone https://github.com/knutsynstad/tic-tac-toe.git
  1. Generate dataset:
node tic-tac-toe.js

Results are saved to boards.json

About

Generating a dataset of the 765 unique game boards, and the connections between them, in the game of tic-tac-toe.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published