{
  "fetched_at": "2026-10-22T08:40:39Z",
  "source_url": "https://www.kaggle.com/competitions/gomoku-predict-next-move/data",
  "pages": [
    {
      "name": "data-description",
      "content": "See Description",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    },
    {
      "name": "Description",
      "content": "# Gomoku Data and Supervised Model Requirements\n\n![](https://raw.githubusercontent.com/fucusy/gomoku-first-move-always-win/master/opennings/pu_yue.png)\n\n\nBuild a model to fit a large scale dataset\n\n## Input of the model：\nMeaning of the input：15×15 board, there are 225 position on the board. Those position are either placed black piece, white piece or empty.\nPossible representation in computer：225 numbers, 0 represent black piece, 1 represents white piece, 2 represents the position is empty. Of course, you can design more ways represent the input efficiently. \n\n\n## Output of the model：\nMeaning of the output: which position next player should place their black piece, you are always to asked the position of the player (  ( the first player ) ) play black piece\nPossibile representation in computer: a 225 dimension vector, the position with maximum number is the position to place black piece\n\n## How to get training data and evaluation data：\nIn this competition, training data and evaluation data are the same\n\n\n1. git clone this repository [https://github.com/fucusy/gomoku-first-move-always-win/](fucusy/gomoku-first-move-always-win)\n2. Open folder `./gomoku/divided/`\n3. List all the files in those sub folder, filename ending with `txt.board2action.txt` contains the data, filename ending with .txt only is not the data file.　[https://github.com/fucusy/gomoku-first-move-always-win/blob/master/gomoku/divided/h8_i8_i7_j7_j6_k5_h9_h7_g9_f10_g8_g10_i10_f7_j9/h8_i8_i7_j7_j6_k5_h9_h7_g9_f10_g8_g10_i10_f7_j9_k11.txt.board2action.txt](https://github.com/fucusy/gomoku-first-move-always-win/blob/master/gomoku/divided/h8_i8_i7_j7_j6_k5_h9_h7_g9_f10_g8_g10_i10_f7_j9/h8_i8_i7_j7_j6_k5_h9_h7_g9_f10_g8_g10_i10_f7_j9_k11.txt.board2action.txt) is one of the data file.\n4. How to parse the training data from data file：\n4.1 Each row of those data file is one sample, one data file may contains several samples, the example above only contains one sample\n4.2 `1073741823,1073741823,1073741823,1073741823,1072693247,1073217535,1073331199,1073635327,1073176575,1073605631,1072693247,1073741823,1073741823,1073741823,1073741823:j11`，this the sample example\n4.3 The data is splited by : into two parts. The left part is the input of the model which is the 15x15 board with piece placed on some position. The right part is the output of the model which is the move of next player.\n4.4 Understanding the output of the model：take j11 as an example, it contains two parts, the first part is a character, the second part is a number. The character can be any character that starts from a to o, it represents the position in the first dimension, the number starts from 1 to 15, it represents the position in second dimension on the board\n4.5 Understanding the input of the model：The below board_str2steps function can convert `1073741823,1073741823,1073741823,1073741823,1072693247,1073217535,1073331199,1073635327,1073176575,1073605631,1072693247,1073741823,1073741823,1073741823,1073741823` to `h8_h7`. The converted string container several position concatenated by _，h8_h7 means there are two piece on the board, because the black piece is always placed firstly. h8_h7 means place piece is placed on h8 and white piece is placed on h7\n5. There are about 14 million training and evaluation samples\n6. The model need to learn how to map the input to output. The model is used to predict the next move given the board.\n\n## board_str2steps Function\n```\ndef position2move(x, y):\n    \"\"\"\n\n    :param x:\n    :param y:\n    :return:\n    >>> position2move(6, 7)\n    'g8'\n    \"\"\"\n    return \"%s%s\" % (chr(x + ord('a')), y + 1)\n\nclass bit_board():\n    black_mask = 0b01\n    white_mask = 0b10\n\n    def __init__(self):\n        self.horizontal_ = []\n        for i in range(15):\n            self.horizontal_.append(0x3FFFFFFF)\n\n    @staticmethod\n    def init_from_board_str(board_str):\n        b = bit_board()\n        horizontal_ints = [int(x) for x in board_str.split(\",\")]\n        for i in range(15):\n            b.horizontal_[i] = 0x3FFFFFFF & horizontal_ints[i]\n        return b\n\n    def to_step_str(self):\n        black_position = []\n        white_position = []\n        for y in range(15):\n            for x in range(15):\n                mask = 0b11 << (2 * x)\n                fig = (mask & self.horizontal_[y]) >> (2 * x)\n                if fig == self.black_mask:\n                    black_position.append((x, y))\n                elif fig == self.white_mask:\n                    white_position.append((x, y))\n\n        steps_strs = []\n        for i in range(len(black_position) + len(white_position)):\n            if i % 2 == 0:\n                x, y = black_position[int(i / 2)]\n            else:\n                x, y = white_position[int((i - 1)/ 2)]\n            steps_strs.append(position2move(x, y))\n        return \"_\".join(steps_strs)\n\n\ndef board_str2steps(board_str):\n    \"\"\"\n\n    :param board_str:\n    :return:\n    >>> board_str2steps(\"1073741823,1073741823,1073741823,1073741823,1073741823,1073741823,1073725439,1073709055,1073741823,1073741823,1073741823,1073741823,1073741823,1073741823,1073741823\")\n    'h8_h7'\n    \"\"\"\n    b = bit_board.init_from_board_str(board_str=board_str)\n    return b.to_step_str()\n    \nprint(board_str2steps(\"1073741823,1073741823,1073741823,1073741823,1073741823,1073741823,1073725439,1073709055,1073741823,1073741823,1073741823,1073741823,1073741823,1073741823,1073741823\"))\n\n```\n\n## Acknowledgements\n\nWe thank http://qiangchen.org to offer those dataset. ",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    },
    {
      "name": "Evaluation",
      "content": "Please evaluate your model performance on the training dataset\n\n## Model requirements:\n\n1. The prediction accuracy need to be larger than 90% on those 14 million samples\n2. The code and model file need to be less than 10M\n",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    },
    {
      "name": "rules",
      "content": "1. Don't upload your solution\n2. Share your solution in the discussion",
      "isPublished": false,
      "hasIsPublished": false,
      "postTitle": "",
      "hasPostTitle": false,
      "mimeType": "",
      "hasMimeType": false
    }
  ]
}