Skip to content
| Marketplace
Sign in
Visual Studio Code>Education>GOs - Hilbert GoNew to Visual Studio Code? Get it now.
GOs - Hilbert Go

GOs - Hilbert Go

23J1633

|
4 installs
| (1) | Free
Go game extended to N-dimensional Hilbert space
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

GOs - 希尔伯特空间高维围棋 (Hilbert Space Go)

English | 中文

GOs 是一款运行在 VS Code 中的硬核策略小游戏插件。它将传统的二维围棋(Weiqi/Go)在数学和物理概念上进行了极致的拓展,将对局舞台延伸到了从零维到十一维的希尔伯特空间 (Hilbert Space)。

准备好燃烧你的大脑,在多维空间中进行布局与绞杀了吗?

GitHub: github.com/23J1633


核心特性

  • 多维自由度:支持从 0维 到 11维 的空间维度配置。
  • 自定义棋盘:支持多种棋盘尺寸(3, 5, 7, 9, 13, 15, 17, 19)。
  • 现代化界面:基于 VS Code 主题变量的原生风格 UI,支持中英文切换。
  • 原生侧边栏交互:专属的侧边栏视图,提供创建对局、坐标输入、落子记录、提子计数等功能。
  • 三维棋盘渲染:
    • 鼠标拖拽旋转、滚轮缩放。
    • 三维坐标轴指示器(X/Y/Z),实时跟随旋转方向。
    • 深度排序渲染,支持透明度渐变。
    • 底部缩放控制栏(缩放按钮、百分比输入、Fit 适配、1:1 原始比例)。
  • 高维棋盘支持:
    • 维度 >= 3 时可用 3D 视图,通过切片导航器控制更高维度坐标。
    • 切片导航器统一显示在视图顶部。
    • 2D 视图支持在当前切片直接点击落子,自动映射到完整 N 维坐标。
    • 矩阵视图展示原始数据。
  • 二维棋盘交互增强:
    • Ctrl + 鼠标滚轮缩放,支持 17 级缩放档位(25% ~ 500%)。
    • 底部缩放控制栏,可手动输入缩放比例,支持 Fit 适配和 1:1 原始比例。
    • 棋盘默认居中显示,支持鼠标拖拽平移。
  • 键盘快捷键:
    • 双击单键循环切换视图(默认 q:2D → 3D → Matrix → 2D)。
    • 双击单键反向循环切换视图(默认 w:2D → Matrix → 3D → 2D)。
    • 快捷键可在设置中自定义为任意单字符。
  • 严谨的围棋算法:根据空间维度动态计算"气"(Liberties),完美支持多维空间的提子规则。
  • AI 对战模式:
    • 支持 PVP(人人对战)和 PVE(人机对战)两种模式。
    • 集成 AI Core 扩展,支持 OpenAI、Claude、Gemini 等多种 AI 提供商。
    • 4 个难度等级:简单(初学者)、普通(业余爱好者)、高手(业余5段)、大师(职业九段)。
    • AI 可执黑(先手)或执白(后手),灵活配置。
    • AI 思考时显示状态提示,落子后自动更新棋盘。
  • 劫规则(Ko Rule):完整实现围棋劫争规则,禁止立即回提同一劫。
  • 实时文件持久化:所有对局状态以 JSON 格式实时保存在本地文件夹中。
  • 最近对局记录:自动保存最近打开的对局,一键继续。
  • 默认保存路径:在设置中配置默认保存路径,创建对局时自动填入,游戏名自动递增(Game1, Game2, ...)。
  • 设置页面:
    • 语言切换(中文/English)。
    • 默认保存路径配置(支持浏览选择)。
    • 视图切换快捷键自定义。
    • 对局模式切换(PVP/PVE)。
    • AI 难度设置。
    • AI 模型选择与配置。

玩法指引

1. 创建对局

  1. 在 VS Code 左侧活动栏点击 GOs 图标,打开插件侧边栏。
  2. 点击右上角齿轮图标进入设置页面,可切换语言、配置默认保存路径和自定义快捷键。
  3. 点击 "创建新对局"。
  4. 在配置页面中输入:
    • 对局名称:默认自动生成(Game1, Game2, ...),可自定义。
    • 保存位置:自动填入默认路径,可修改。
    • 维度:输入 0 到 11 之间的整数。
    • 棋盘大小:从下拉列表选择(3x3 到 19x19)。
    • AI 设置(PVE 模式):选择 AI 执棋颜色和 AI 模型。
  5. 点击 "开始对局" 进入对局。

提示:如需 AI 对战,请先在设置页面切换到 PVE 模式,并配置 AI 难度和模型。首次使用需安装 AI Core 扩展并配置 API 密钥。

2. 进行对弈

  • 右侧自动弹出棋盘面板,左侧边栏显示操作面板。
  • 黑棋先手(记为 1),白棋后手(记为 -1),空位为 0。
  • 落子方式:
    • 在侧边栏输入坐标(逗号分隔,位数与维度一致,如三维输入 2,5,8)。
    • 在 2D 棋盘上直接点击落子(高维棋盘会映射到当前切片坐标)。
    • 在 3D 棋盘上点击最近的空位落子。
  • 每次落子后,侧边栏实时更新提子数和落子记录。

3. 视图切换

  • 2D 视图:经典棋盘网格,支持点击落子。高维棋盘通过切片导航器选择显示哪个二维切片。
  • 3D 视图(维度 >= 3):三维层级渲染,鼠标拖拽旋转、滚轮缩放。右下角显示坐标轴指示器。
  • Matrix 视图:原始矩阵数据展示。
  • 快捷键切换:双击 q 正向循环(2D → 3D → Matrix),双击 w 反向循环。可在设置中自定义按键。

4. 棋盘操作

  • 缩放:Ctrl + 鼠标滚轮缩放,或使用底部缩放控制栏。
  • 平移:缩放后棋盘超出视口时,鼠标拖拽平移查看。
  • 适配:点击 Fit 按钮自动适配视口大小,点击 1:1 恢复原始比例。

高维围棋规则

传统围棋的规则被严格类推到 N 维空间:

  • 气的计算:一颗棋子的相邻正交点称为"气"。
    • 1维:2 口气
    • 2维:4 口气(上下左右)
    • 3维:6 口气(上下左右前后)
    • N维:2N 口气
  • 吃子:当一块相连的同色棋子的所有"气"都被对手占据时,这块棋子将被提掉并计入俘虏。
  • 禁着点:禁止自杀,除非该步落子能同时提掉对方的棋子。
  • 劫规则:禁止立即回提同一劫(Ko),防止无限循环。当一方提子后,对方不能立即提回同一位置。
  • 贴目:白方获得贴目补偿(大棋盘 6.5 目,小棋盘 3.5 目),确保公平性。

数据存储说明

创建对局后,会在指定目录下生成以对局名称命名的文件夹,包含:

  1. config.json:对局元数据(名称、维度、棋盘大小、创建时间)。
  2. GOs.json:N 维嵌套数组,黑子为 1,白子为 -1,空位为 0。
  3. history.json:逐手记录(步数、落子方、坐标、提子列表)。

棋盘内存与存储分析

数据结构

type Tensor = number | Tensor[];

棋盘是一个递归嵌套的数组结构:

  • 0维:一个数字 0
  • 1维:[0, 0, ..., 0](s 个元素)
  • d维:s 个 (d-1)维 Tensor 的数组

总交叉点数 = size^dimension

内存计算(JavaScript/V8 引擎)

在 V8 引擎中:

  • 数字 0、1、-1 是 SMI(Small Integer),内联存储在数组槽中,不额外占堆内存
  • 每个数组对象开销:56 字节(对象头)+ 8 字节 × 元素数(指针槽位)
  • 数组总数(维度 d,大小 s):A = (s^d - 1) / (s - 1)(s > 1 时)
内存(d, s) = A(d, s) × (56 + 8 × s)
其中 A(d, s) = (s^d - 1) / (s - 1)   (s > 1)
          A(d, 1) = d

以下所有数值为空棋盘(全部为 0)的内存占用。放置棋子后内存不变(SMI 0/1/-1 大小相同)。

size = 1

维度 交叉点数 数组数 内存 (bytes) 内存 (可读)
0 1 0 0 0 B
1 1 1 64 64 B
2 1 2 128 128 B
3 1 3 192 192 B
4 1 4 256 256 B
5 1 5 320 320 B
6 1 6 384 384 B
7 1 7 448 448 B
8 1 8 512 512 B
9 1 9 576 576 B
10 1 10 640 640 B
11 1 11 704 704 B

size = 3

维度 交叉点数 (3^d) 数组数 内存 (bytes) 内存 (可读)
0 1 0 0 0 B
1 3 1 80 80 B
2 9 4 320 320 B
3 27 13 1,040 ~1.0 KB
4 81 40 3,200 ~3.1 KB
5 243 121 9,680 ~9.5 KB
6 729 364 29,120 ~28.4 KB
7 2,187 1,093 87,440 ~85.4 KB
8 6,561 3,280 262,400 ~256.3 KB
9 19,683 9,841 787,280 ~768.8 KB
10 59,049 29,524 2,361,920 ~2.25 MB
11 177,147 88,573 7,085,840 ~6.76 MB

size = 5

维度 交叉点数 (5^d) 数组数 内存 (bytes) 内存 (可读)
0 1 0 0 0 B
1 5 1 96 96 B
2 25 6 576 576 B
3 125 31 2,976 ~2.9 KB
4 625 156 14,976 ~14.6 KB
5 3,125 781 74,976 ~73.2 KB
6 15,625 3,906 374,976 ~366.2 KB
7 78,125 19,531 1,874,976 ~1.79 MB
8 390,625 97,656 9,374,976 ~8.94 MB
9 1,953,125 488,281 46,874,976 ~44.7 MB
10 9,765,625 2,441,406 234,374,976 ~223.5 MB
11 48,828,125 12,207,031 1,171,874,976 ~1.09 GB

size = 7

维度 交叉点数 (7^d) 数组数 内存 (bytes) 内存 (可读)
0 1 0 0 0 B
1 7 1 112 112 B
2 49 8 896 896 B
3 343 57 6,384 ~6.2 KB
4 2,401 400 44,800 ~43.8 KB
5 16,807 2,801 313,712 ~306.4 KB
6 117,649 19,608 2,196,096 ~2.09 MB
7 823,543 137,257 15,372,784 ~14.66 MB
8 5,764,801 960,800 107,609,600 ~102.6 MB
9 40,353,607 6,725,601 753,267,312 ~718.4 MB
10 282,475,249 47,079,208 5,272,871,296 ~4.91 GB
11 1,977,326,743 329,554,457 36,910,099,184 ~34.38 GB

size = 9

维度 交叉点数 (9^d) 数组数 内存 (bytes) 内存 (可读)
0 1 0 0 0 B
1 9 1 128 128 B
2 81 10 1,280 ~1.3 KB
3 729 91 11,648 ~11.4 KB
4 6,561 820 104,960 ~102.5 KB
5 59,049 7,381 944,768 ~922.6 KB
6 531,441 66,430 8,503,040 ~8.11 MB
7 4,782,969 597,871 76,527,488 ~73.0 MB
8 43,046,721 5,380,840 688,747,520 ~656.9 MB
9 387,420,489 48,427,561 6,198,727,808 ~5.77 GB
10 3,486,784,401 435,848,050 55,788,550,400 ~51.96 GB
11 31,381,059,609 3,922,632,451 502,096,953,728 ~467.6 GB

size = 13

维度 交叉点数 (13^d) 数组数 内存 (bytes) 内存 (可读)
0 1 0 0 0 B
1 13 1 160 160 B
2 169 14 2,240 ~2.2 KB
3 2,197 183 29,280 ~28.6 KB
4 28,561 2,380 380,800 ~371.9 KB
5 371,293 30,941 4,950,560 ~4.72 MB
6 4,826,809 402,234 64,357,440 ~61.4 MB
7 62,748,517 5,229,043 836,646,880 ~798.0 MB
8 815,730,721 67,977,560 10,876,409,600 ~10.13 GB
9 10,604,499,373 883,708,282 141,393,325,120 ~131.7 GB
10 137,858,491,849 11,488,207,658 ~1.84 TB ~1.84 TB
11 1,792,160,394,037 149,346,699,507 ~23.9 TB ~23.9 TB

size = 15

维度 交叉点数 (15^d) 数组数 内存 (bytes) 内存 (可读)
0 1 0 0 0 B
1 15 1 176 176 B
2 225 16 2,816 ~2.7 KB
3 3,375 241 42,416 ~41.4 KB
4 50,625 3,616 636,416 ~621.5 KB
5 759,375 54,241 9,546,416 ~9.10 MB
6 11,390,625 813,616 143,196,416 ~136.6 MB
7 170,859,375 12,204,241 2,147,946,416 ~2.00 GB
8 2,562,890,625 183,063,616 32,219,328,416 ~30.0 GB
9 38,443,359,375 2,745,954,241 ~483.3 GB ~483.3 GB
10 576,650,390,625 41,189,313,616 ~7.25 TB ~7.25 TB
11 8,649,755,859,375 617,839,704,241 ~108.7 TB ~108.7 TB

size = 17

维度 交叉点数 (17^d) 数组数 内存 (bytes) 内存 (可读)
0 1 0 0 0 B
1 17 1 192 192 B
2 289 18 3,456 ~3.4 KB
3 4,913 307 58,944 ~57.6 KB
4 83,521 5,220 997,920 ~974.5 KB
5 1,419,857 88,741 16,964,640 ~16.2 MB
6 24,137,569 1,508,598 288,649,248 ~275.3 MB
7 410,338,673 25,646,167 4,907,041,104 ~4.57 GB
8 6,975,757,441 435,984,840 ~83.4 GB ~83.4 GB
9 118,587,876,497 7,411,742,281 ~1.42 TB ~1.42 TB
10 2,015,993,900,449 ~1.26×10^11 ~24.1 TB ~24.1 TB
11 34,271,896,307,633 ~2.14×10^12 ~410 TB ~410 TB

size = 19(标准围棋棋盘大小)

维度 交叉点数 (19^d) 数组数 内存 (bytes) 内存 (可读)
0 1 0 0 0 B
1 19 1 208 208 B
2 361 20 4,160 ~4.1 KB
3 6,859 381 79,248 ~77.4 KB
4 130,321 7,240 1,505,920 ~1.44 MB
5 2,476,099 137,561 28,612,688 ~27.3 MB
6 47,045,881 2,613,660 543,641,280 ~518.5 MB
7 893,871,739 49,659,541 10,329,184,528 ~9.62 GB
8 16,983,563,041 943,531,280 ~196.3 GB ~196.3 GB
9 322,687,697,779 ~1.79×10^10 ~3.73 TB ~3.73 TB
10 6,131,066,257,801 ~3.41×10^11 ~70.8 TB ~70.8 TB
11 116,490,258,898,219 ~6.47×10^12 ~1.35 PB ~1.35 PB

存储计算(JSON 文件)

棋盘存储在 GOs.json 中,使用紧凑 JSON(无缩进)。

f(0) = 1 字节                           // "0"
f(d) = s × f(d-1) + s + 1 字节          // d >= 1

推导:一个 s 元素数组的 JSON 表示为 [elem1,elem2,...,elemN], 即 1([)+ s 个子元素 + (s-1) 个逗号 + 1(])= s×f(d-1) + s + 1

size = 1

维度 存储 (bytes)
0~11 1~23(极小)

size = 3

维度 交叉点数 JSON 大小 (bytes) 可读
0 1 1 1 B
1 3 7 7 B
2 9 25 25 B
3 27 79 79 B
4 81 241 241 B
5 243 727 727 B
6 729 2,185 ~2.1 KB
7 2,187 6,559 ~6.4 KB
8 6,561 19,681 ~19.2 KB
9 19,683 59,047 ~57.7 KB
10 59,049 177,145 ~173.0 KB
11 177,147 531,439 ~519.0 KB

size = 5

维度 交叉点数 JSON 大小 (bytes) 可读
0 1 1 1 B
1 5 11 11 B
2 25 61 61 B
3 125 311 311 B
4 625 1,561 ~1.5 KB
5 3,125 7,811 ~7.6 KB
6 15,625 39,061 ~38.1 KB
7 78,125 195,311 ~190.7 KB
8 390,625 976,561 ~953.7 KB
9 1,953,125 4,882,811 ~4.66 MB
10 9,765,625 24,414,061 ~23.3 MB
11 48,828,125 122,070,311 ~116.4 MB

size = 7

维度 交叉点数 JSON 大小 (bytes) 可读
0 1 1 1 B
1 7 15 15 B
2 49 113 113 B
3 343 799 799 B
4 2,401 5,601 ~5.5 KB
5 16,807 39,215 ~38.3 KB
6 117,649 274,513 ~268.1 KB
7 823,543 1,921,599 ~1.83 MB
8 5,764,801 13,451,201 ~12.8 MB
9 40,353,607 94,158,415 ~89.8 MB
10 282,475,249 659,108,913 ~628.6 MB
11 1,977,326,743 4,613,762,399 ~4.30 GB

size = 9

维度 交叉点数 JSON 大小 (bytes) 可读
0 1 1 1 B
1 9 19 19 B
2 81 181 181 B
3 729 1,639 ~1.6 KB
4 6,561 14,761 ~14.4 KB
5 59,049 132,859 ~129.7 KB
6 531,441 1,195,741 ~1.14 MB
7 4,782,969 10,761,679 ~10.26 MB
8 43,046,721 96,855,121 ~92.4 MB
9 387,420,489 871,696,099 ~831.3 MB
10 3,486,784,401 7,845,264,901 ~7.31 GB
11 31,381,059,609 70,607,384,119 ~65.8 GB

size = 13

维度 交叉点数 JSON 大小 (bytes) 可读
0 1 1 1 B
1 13 27 27 B
2 169 361 361 B
3 2,197 4,699 ~4.6 KB
4 28,561 61,093 ~59.7 KB
5 371,293 794,215 ~775.6 KB
6 4,826,809 10,324,801 ~9.85 MB
7 62,748,517 134,222,419 ~128.0 MB
8 815,730,721 1,744,891,453 ~1.62 GB
9 10,604,499,373 22,683,588,893 ~21.1 GB
10 137,858,491,849 ~295 GB ~295 GB
11 1,792,160,394,037 ~3.8 TB ~3.8 TB

size = 15

维度 交叉点数 JSON 大小 (bytes) 可读
0 1 1 1 B
1 15 31 31 B
2 225 481 481 B
3 3,375 7,231 ~7.1 KB
4 50,625 108,481 ~106.0 KB
5 759,375 1,627,231 ~1.55 MB
6 11,390,625 24,408,481 ~23.3 MB
7 170,859,375 366,127,231 ~349.2 MB
8 2,562,890,625 5,491,908,481 ~5.11 GB
9 38,443,359,375 ~82.4 GB ~82.4 GB
10 576,650,390,625 ~1.2 TB ~1.2 TB
11 8,649,755,859,375 ~18 TB ~18 TB

size = 17

维度 交叉点数 JSON 大小 (bytes) 可读
0 1 1 1 B
1 17 35 35 B
2 289 611 611 B
3 4,913 10,411 ~10.2 KB
4 83,521 176,993 ~172.8 KB
5 1,419,857 3,008,899 ~2.87 MB
6 24,137,569 51,151,297 ~48.8 MB
7 410,338,673 869,572,063 ~829.3 MB
8 6,975,757,441 ~14.8 GB ~14.8 GB
9 118,587,876,497 ~251 GB ~251 GB
10 2,015,993,900,449 ~4.3 TB ~4.3 TB
11 34,271,896,307,633 ~73 TB ~73 TB

size = 19(标准围棋棋盘大小)

维度 交叉点数 JSON 大小 (bytes) 可读
0 1 1 1 B
1 19 39 39 B
2 361 761 761 B
3 6,859 14,479 ~14.1 KB
4 130,321 275,121 ~268.7 KB
5 2,476,099 5,227,319 ~4.99 MB
6 47,045,881 99,319,081 ~94.7 MB
7 893,871,739 1,887,062,559 ~1.76 GB
8 16,983,563,041 ~33.4 GB ~33.4 GB
9 322,687,697,779 ~635 GB ~635 GB
10 6,131,066,257,801 ~12 TB ~12 TB
11 116,490,258,898,219 ~228 TB ~228 TB

综合速查表(推荐配置)

以下列出每个维度下推荐的最大棋盘大小(内存 < 1 GB,存储 < 1 GB 的范围):

维度 推荐最大 size 交叉点数 内存 存储
0 任意 1 ~0 B 1 B
1 任意 ≤19 ≤208 B ≤39 B
2 任意 ≤361 ≤4.1 KB ≤761 B
3 19 6,859 ~77 KB ~14 KB
4 19 130,321 ~1.4 MB ~269 KB
5 19 2,476,099 ~27 MB ~5.0 MB
6 19 47,045,881 ~519 MB ~95 MB
7 9~13 4.7M~62.7M 73~798 MB 10~128 MB
8 5~9 390K~43M 9~657 MB 1~92 MB
9 5~7 59K~40M 45~718 MB 5~90 MB
10 3~5 59K~9.8M 2.2~224 MB 173 KB~23 MB
11 3~5 177K~48.8M 6.8 MB~1.1 GB 519 KB~116 MB

其他开销

除棋盘外,游戏运行时还有以下额外开销(相比棋盘可忽略不计):

数据 说明
config.json 游戏配置,~200 bytes
history.json 落子历史,每步 ~80 bytes,最多 s^d 步
GameHistoryItem[] 内存 每个对象 ~120 bytes + 坐标数组
其他游戏状态 captures、currentPlayer 等,~100 bytes

注意:history.json 的最大理论大小 = s^d × 80 bytes。在高维大棋盘下,历史记录也可能成为显著的存储负担。

结论

  • 低维(0-4维):所有 size 均可正常使用,内存和存储开销极小
  • 中维(5-6维):使用 size ≤ 19 仍可接受(~500 MB 内存上限)
  • 高维(7-9维):需要缩小 size 至 5~9 才能在普通电脑上运行
  • 超高维(10-11维):仅 size = 3~5 可行,且 11维 + size=5 需要约 1 GB 内存

系统要求

  • Visual Studio Code 1.80.0 或更高版本。
  • 高维度大棋盘可能消耗较多内存,建议从低维度开始体验。

发行说明

2.0.0

  • 新增 AI 对战模式(PVE),支持与 AI 进行围棋对弈。
  • 集成 AI Core 扩展,支持 OpenAI、Claude、Gemini 等多种 AI 提供商。
  • 新增 4 个 AI 难度等级:简单(初学者)、普通(业余爱好者)、高手(业余5段)、大师(职业九段)。
  • 新增 AI 执棋颜色选择(黑棋/白棋)。
  • 新增 AI 思考状态显示和落子提示。
  • 新增劫规则(Ko Rule),禁止立即回提同一劫。
  • 新增贴目系统,白方获得贴目补偿。
  • 优化对局模式选择界面,支持 PVP/PVE 切换。
  • 新增 AI 模型配置界面,可从设置页面直接打开 AI Core 配置。

0.0.2

  • 新增设置页面:语言切换、默认保存路径、视图切换快捷键自定义。
  • 新增默认保存路径配置,创建对局时自动填入,游戏名自动递增(Game1, Game2, ...)。
  • 新增三维坐标轴指示器(X/Y/Z),实时跟随旋转方向。
  • 新增 2D 棋盘缩放(Ctrl+滚轮、17 级档位)、平移(拖拽)、底部缩放控制栏。
  • 新增 3D 视图底部缩放控制栏。
  • 新增双击单键循环切换视图功能(默认 q 正向、w 反向,可自定义)。
  • 优化 3D 旋转操作逻辑,鼠标拖拽方向与视角旋转方向一致。
  • 优化切片导航器位置,统一显示在视图顶部。
  • 优化 2D 棋盘默认居中显示。
  • 优化 3D 棋子大小一致性,不随深度缩放。
  • 修复游戏结束图标在切换对局后残留的问题。
  • 修复高维棋盘 3D 视图可用性(维度 >= 3 即可使用)。

0.0.1

  • 初始版本发布。
  • 实现 0-11 维矩阵状态系统与文件存取。
  • 实装高维空间的"气"与提子算法。
  • 实现 Webview 棋盘渲染与侧边栏交互。
  • 支持中英文语言切换。
  • 支持三维棋盘旋转/缩放及坐标轴指示器。
  • 支持高维 3D 视图与切片导航。
  • 支持默认保存路径与自动递增游戏名。

Enjoy conquering the Hilbert Space!




GOs - Hilbert Space Go

English | 中文

GOs is a hardcore strategy game extension for VS Code. It extends the traditional 2D game of Go (Weiqi) into the mathematical realm of Hilbert Spaces, supporting gameplay across 0 to 11 dimensions.

Ready to challenge your brain with multi-dimensional territory battles?

GitHub: github.com/23J1633


Features

  • Multi-Dimensional Freedom: Configure game spaces from 0D to 11D.
  • Custom Board Sizes: Choose from 3x3 to 19x19.
  • Modern UI: Native VS Code theme-integrated interface with Chinese/English language support.
  • Sidebar Interaction: Dedicated sidebar for game creation, coordinate input, move history, and capture counts.
  • 3D Board Rendering:
    • Mouse drag rotation and scroll zoom.
    • Real-time XYZ axis indicator that follows rotation.
    • Depth-sorted rendering with transparency gradients.
    • Bottom zoom control bar (zoom buttons, percentage input, Fit, 1:1 reset).
  • High-Dimensional Board Support:
    • 3D view available for dimensions >= 3, with a slice navigator for higher dimensions.
    • Slice navigator displayed at the top of the view.
    • 2D view supports click-to-place on the current slice, automatically mapping to full N-dimensional coordinates.
    • Matrix view for raw data visualization.
  • Enhanced 2D Board Interaction:
    • Ctrl + mouse wheel zoom with 17 zoom levels (25% ~ 500%).
    • Bottom zoom control bar with manual percentage input, Fit and 1:1 buttons.
    • Board centered by default, supports mouse drag panning.
  • Keyboard Shortcuts:
    • Double-press single key to cycle views (default q: 2D → 3D → Matrix → 2D).
    • Double-press single key to reverse-cycle views (default w: 2D → Matrix → 3D → 2D).
    • Keys are fully customizable in settings.
  • Rigorous Go Algorithm: Dynamically calculates liberties based on spatial dimension, with full capture rule support.
  • AI Battle Mode:
    • Supports PVP (Player vs Player) and PVE (Player vs AI) modes.
    • Integrates AI Core extension with support for OpenAI, Claude, Gemini and other AI providers.
    • 4 difficulty levels: Easy (Beginner), Normal (Club Player), Hard (5-dan Amateur), Master (Professional 9-dan).
    • AI can play as Black (first) or White (second), with flexible configuration.
    • AI thinking status display and automatic board update after moves.
  • Ko Rule: Full implementation of Go ko rule, preventing immediate recapture.
  • Real-time File Persistence: All game states saved as JSON in local folders.
  • Recent Games: Automatically tracks recently opened games for quick access.
  • Default Save Path: Configure a default save directory in settings. Game names auto-increment (Game1, Game2, ...).
  • Settings Page:
    • Language switching (Chinese/English).
    • Default save path configuration (with browse support).
    • View switch shortcut customization.
    • Game mode switching (PVP/PVE).
    • AI difficulty settings.
    • AI model selection and configuration.

How to Play

1. Create a Game

  1. Click the GOs icon in the VS Code activity bar to open the sidebar.
  2. Click the gear icon (top-right) to access Settings for language, default save path, and shortcut configuration.
  3. Click "Create New Game".
  4. Configure:
    • Game Name: Auto-generated (Game1, Game2, ...), customizable.
    • Save Location: Pre-filled from default path, editable.
    • Dimension: Enter a number between 0 and 11.
    • Board Size: Select from the dropdown (3x3 to 19x19).
    • AI Settings (PVE mode): Select AI color and AI model.
  5. Click "Start Game".

Tip: For AI battles, first switch to PVE mode in settings and configure AI difficulty and model. First-time use requires installing the AI Core extension and configuring API keys.

2. Play

  • The board panel opens on the right; the sidebar shows the control panel.
  • Black plays first (encoded as 1), White second (-1), empty as 0.
  • Place stones by:
    • Entering coordinates in the sidebar (comma-separated, matching dimension count, e.g. 2,5,8 for 3D).
    • Clicking directly on the 2D board (maps to the current slice in high-dimensional games).
    • Clicking the nearest empty cell on the 3D board.
  • The sidebar updates capture counts and move history in real-time after each move.

3. View Modes

  • 2D View: Classic board grid with click-to-place. High-dimensional boards use a slice navigator to select the displayed 2D slice.
  • 3D View (dimensions >= 3): Layered 3D rendering with mouse rotation and zoom. Axis indicator in the bottom-right corner.
  • Matrix View: Raw matrix data display.
  • Shortcut Switching: Double-press q to cycle forward (2D → 3D → Matrix), double-press w to cycle backward. Keys are customizable in settings.

4. Board Interaction

  • Zoom: Ctrl + mouse wheel, or use the bottom zoom control bar.
  • Pan: After zooming, drag the board to pan around.
  • Fit: Click the Fit button to auto-fit the board to the viewport, or 1:1 to reset to original size.

Rules of N-Dimensional Go

Traditional Go rules are strictly generalized to N dimensions:

  • Liberties: Adjacent orthogonal points of a stone.
    • 1D: 2 liberties
    • 2D: 4 liberties (up, down, left, right)
    • 3D: 6 liberties (up, down, left, right, front, back)
    • N-dimensional: 2N liberties
  • Capture: When all liberties of a connected group of same-color stones are occupied by the opponent, the entire group is removed and counted as captured.
  • Suicide Rule: Self-capture is forbidden unless the move simultaneously captures opponent stones.
  • Ko Rule: Prevents immediate recapture of the same ko, avoiding infinite loops. After one player captures, the opponent cannot immediately recapture at the same position.
  • Komi: White receives compensation points (6.5 for large boards, 3.5 for small boards) to ensure fairness.

Data Storage

Each game creates a folder containing:

  1. config.json: Game metadata (name, dimension, board size, creation time).
  2. GOs.json: N-dimensional nested array. Black = 1, White = -1, Empty = 0.
  3. history.json: Per-move log (step number, player, coordinates, captured stones).

Board Memory & Storage Analysis

Data Structure

type Tensor = number | Tensor[];

The board is a recursively nested array:

  • 0D: A single number 0
  • 1D: [0, 0, ..., 0] (s elements)
  • dD: An array of s (d-1)-dimensional Tensors

Total intersection points = size^dimension

Memory Calculation (JavaScript/V8 Engine)

In the V8 engine:

  • Numbers 0, 1, -1 are SMI (Small Integers), stored inline in array slots with no extra heap allocation
  • Per-array overhead: 56 bytes (object header) + 8 bytes x element count (pointer slots)
  • Total arrays (dimension d, size s): A = (s^d - 1) / (s - 1) (for s > 1)
Memory(d, s) = A(d, s) x (56 + 8 x s)
where A(d, s) = (s^d - 1) / (s - 1)   (s > 1)
          A(d, 1) = d

All values below are for an empty board (all zeros). Memory does not change after placing stones (SMI 0/1/-1 are the same size).

size = 1

Dimension Intersections Arrays Memory (bytes) Memory (readable)
0 1 0 0 0 B
1 1 1 64 64 B
2 1 2 128 128 B
3 1 3 192 192 B
4 1 4 256 256 B
5 1 5 320 320 B
6 1 6 384 384 B
7 1 7 448 448 B
8 1 8 512 512 B
9 1 9 576 576 B
10 1 10 640 640 B
11 1 11 704 704 B

size = 3

Dimension Intersections (3^d) Arrays Memory (bytes) Memory (readable)
0 1 0 0 0 B
1 3 1 80 80 B
2 9 4 320 320 B
3 27 13 1,040 ~1.0 KB
4 81 40 3,200 ~3.1 KB
5 243 121 9,680 ~9.5 KB
6 729 364 29,120 ~28.4 KB
7 2,187 1,093 87,440 ~85.4 KB
8 6,561 3,280 262,400 ~256.3 KB
9 19,683 9,841 787,280 ~768.8 KB
10 59,049 29,524 2,361,920 ~2.25 MB
11 177,147 88,573 7,085,840 ~6.76 MB

size = 5

Dimension Intersections (5^d) Arrays Memory (bytes) Memory (readable)
0 1 0 0 0 B
1 5 1 96 96 B
2 25 6 576 576 B
3 125 31 2,976 ~2.9 KB
4 625 156 14,976 ~14.6 KB
5 3,125 781 74,976 ~73.2 KB
6 15,625 3,906 374,976 ~366.2 KB
7 78,125 19,531 1,874,976 ~1.79 MB
8 390,625 97,656 9,374,976 ~8.94 MB
9 1,953,125 488,281 46,874,976 ~44.7 MB
10 9,765,625 2,441,406 234,374,976 ~223.5 MB
11 48,828,125 12,207,031 1,171,874,976 ~1.09 GB

size = 7

Dimension Intersections (7^d) Arrays Memory (bytes) Memory (readable)
0 1 0 0 0 B
1 7 1 112 112 B
2 49 8 896 896 B
3 343 57 6,384 ~6.2 KB
4 2,401 400 44,800 ~43.8 KB
5 16,807 2,801 313,712 ~306.4 KB
6 117,649 19,608 2,196,096 ~2.09 MB
7 823,543 137,257 15,372,784 ~14.66 MB
8 5,764,801 960,800 107,609,600 ~102.6 MB
9 40,353,607 6,725,601 753,267,312 ~718.4 MB
10 282,475,249 47,079,208 5,272,871,296 ~4.91 GB
11 1,977,326,743 329,554,457 36,910,099,184 ~34.38 GB

size = 9

Dimension Intersections (9^d) Arrays Memory (bytes) Memory (readable)
0 1 0 0 0 B
1 9 1 128 128 B
2 81 10 1,280 ~1.3 KB
3 729 91 11,648 ~11.4 KB
4 6,561 820 104,960 ~102.5 KB
5 59,049 7,381 944,768 ~922.6 KB
6 531,441 66,430 8,503,040 ~8.11 MB
7 4,782,969 597,871 76,527,488 ~73.0 MB
8 43,046,721 5,380,840 688,747,520 ~656.9 MB
9 387,420,489 48,427,561 6,198,727,808 ~5.77 GB
10 3,486,784,401 435,848,050 55,788,550,400 ~51.96 GB
11 31,381,059,609 3,922,632,451 502,096,953,728 ~467.6 GB

size = 13

Dimension Intersections (13^d) Arrays Memory (bytes) Memory (readable)
0 1 0 0 0 B
1 13 1 160 160 B
2 169 14 2,240 ~2.2 KB
3 2,197 183 29,280 ~28.6 KB
4 28,561 2,380 380,800 ~371.9 KB
5 371,293 30,941 4,950,560 ~4.72 MB
6 4,826,809 402,234 64,357,440 ~61.4 MB
7 62,748,517 5,229,043 836,646,880 ~798.0 MB
8 815,730,721 67,977,560 10,876,409,600 ~10.13 GB
9 10,604,499,373 883,708,282 141,393,325,120 ~131.7 GB
10 137,858,491,849 11,488,207,658 ~1.84 TB ~1.84 TB
11 1,792,160,394,037 149,346,699,507 ~23.9 TB ~23.9 TB

size = 15

Dimension Intersections (15^d) Arrays Memory (bytes) Memory (readable)
0 1 0 0 0 B
1 15 1 176 176 B
2 225 16 2,816 ~2.7 KB
3 3,375 241 42,416 ~41.4 KB
4 50,625 3,616 636,416 ~621.5 KB
5 759,375 54,241 9,546,416 ~9.10 MB
6 11,390,625 813,616 143,196,416 ~136.6 MB
7 170,859,375 12,204,241 2,147,946,416 ~2.00 GB
8 2,562,890,625 183,063,616 32,219,328,416 ~30.0 GB
9 38,443,359,375 2,745,954,241 ~483.3 GB ~483.3 GB
10 576,650,390,625 41,189,313,616 ~7.25 TB ~7.25 TB
11 8,649,755,859,375 617,839,704,241 ~108.7 TB ~108.7 TB

size = 17

Dimension Intersections (17^d) Arrays Memory (bytes) Memory (readable)
0 1 0 0 0 B
1 17 1 192 192 B
2 289 18 3,456 ~3.4 KB
3 4,913 307 58,944 ~57.6 KB
4 83,521 5,220 997,920 ~974.5 KB
5 1,419,857 88,741 16,964,640 ~16.2 MB
6 24,137,569 1,508,598 288,649,248 ~275.3 MB
7 410,338,673 25,646,167 4,907,041,104 ~4.57 GB
8 6,975,757,441 435,984,840 ~83.4 GB ~83.4 GB
9 118,587,876,497 7,411,742,281 ~1.42 TB ~1.42 TB
10 2,015,993,900,449 ~1.26x10^11 ~24.1 TB ~24.1 TB
11 34,271,896,307,633 ~2.14x10^12 ~410 TB ~410 TB

size = 19 (Standard Go board size)

Dimension Intersections (19^d) Arrays Memory (bytes) Memory (readable)
0 1 0 0 0 B
1 19 1 208 208 B
2 361 20 4,160 ~4.1 KB
3 6,859 381 79,248 ~77.4 KB
4 130,321 7,240 1,505,920 ~1.44 MB
5 2,476,099 137,561 28,612,688 ~27.3 MB
6 47,045,881 2,613,660 543,641,280 ~518.5 MB
7 893,871,739 49,659,541 10,329,184,528 ~9.62 GB
8 16,983,563,041 943,531,280 ~196.3 GB ~196.3 GB
9 322,687,697,779 ~1.79x10^10 ~3.73 TB ~3.73 TB
10 6,131,066,257,801 ~3.41x10^11 ~70.8 TB ~70.8 TB
11 116,490,258,898,219 ~6.47x10^12 ~1.35 PB ~1.35 PB

Storage Calculation (JSON File)

The board is stored in GOs.json using compact JSON (no indentation).

f(0) = 1 byte                           // "0"
f(d) = s x f(d-1) + s + 1 bytes         // d >= 1

Derivation: A s-element array in JSON is [elem1,elem2,...,elemN], i.e. 1 ([) + s sub-elements + (s-1) commas + 1 (]) = sxf(d-1) + s + 1

size = 1

Dimension Storage (bytes)
0~11 1~23 (negligible)

size = 3

Dimension Intersections JSON Size (bytes) Readable
0 1 1 1 B
1 3 7 7 B
2 9 25 25 B
3 27 79 79 B
4 81 241 241 B
5 243 727 727 B
6 729 2,185 ~2.1 KB
7 2,187 6,559 ~6.4 KB
8 6,561 19,681 ~19.2 KB
9 19,683 59,047 ~57.7 KB
10 59,049 177,145 ~173.0 KB
11 177,147 531,439 ~519.0 KB

size = 5

Dimension Intersections JSON Size (bytes) Readable
0 1 1 1 B
1 5 11 11 B
2 25 61 61 B
3 125 311 311 B
4 625 1,561 ~1.5 KB
5 3,125 7,811 ~7.6 KB
6 15,625 39,061 ~38.1 KB
7 78,125 195,311 ~190.7 KB
8 390,625 976,561 ~953.7 KB
9 1,953,125 4,882,811 ~4.66 MB
10 9,765,625 24,414,061 ~23.3 MB
11 48,828,125 122,070,311 ~116.4 MB

size = 7

Dimension Intersections JSON Size (bytes) Readable
0 1 1 1 B
1 7 15 15 B
2 49 113 113 B
3 343 799 799 B
4 2,401 5,601 ~5.5 KB
5 16,807 39,215 ~38.3 KB
6 117,649 274,513 ~268.1 KB
7 823,543 1,921,599 ~1.83 MB
8 5,764,801 13,451,201 ~12.8 MB
9 40,353,607 94,158,415 ~89.8 MB
10 282,475,249 659,108,913 ~628.6 MB
11 1,977,326,743 4,613,762,399 ~4.30 GB

size = 9

Dimension Intersections JSON Size (bytes) Readable
0 1 1 1 B
1 9 19 19 B
2 81 181 181 B
3 729 1,639 ~1.6 KB
4 6,561 14,761 ~14.4 KB
5 59,049 132,859 ~129.7 KB
6 531,441 1,195,741 ~1.14 MB
7 4,782,969 10,761,679 ~10.26 MB
8 43,046,721 96,855,121 ~92.4 MB
9 387,420,489 871,696,099 ~831.3 MB
10 3,486,784,401 7,845,264,901 ~7.31 GB
11 31,381,059,609 70,607,384,119 ~65.8 GB

size = 13

Dimension Intersections JSON Size (bytes) Readable
0 1 1 1 B
1 13 27 27 B
2 169 361 361 B
3 2,197 4,699 ~4.6 KB
4 28,561 61,093 ~59.7 KB
5 371,293 794,215 ~775.6 KB
6 4,826,809 10,324,801 ~9.85 MB
7 62,748,517 134,222,419 ~128.0 MB
8 815,730,721 1,744,891,453 ~1.62 GB
9 10,604,499,373 22,683,588,893 ~21.1 GB
10 137,858,491,849 ~295 GB ~295 GB
11 1,792,160,394,037 ~3.8 TB ~3.8 TB

size = 15

Dimension Intersections JSON Size (bytes) Readable
0 1 1 1 B
1 15 31 31 B
2 225 481 481 B
3 3,375 7,231 ~7.1 KB
4 50,625 108,481 ~106.0 KB
5 759,375 1,627,231 ~1.55 MB
6 11,390,625 24,408,481 ~23.3 MB
7 170,859,375 366,127,231 ~349.2 MB
8 2,562,890,625 5,491,908,481 ~5.11 GB
9 38,443,359,375 ~82.4 GB ~82.4 GB
10 576,650,390,625 ~1.2 TB ~1.2 TB
11 8,649,755,859,375 ~18 TB ~18 TB

size = 17

Dimension Intersections JSON Size (bytes) Readable
0 1 1 1 B
1 17 35 35 B
2 289 611 611 B
3 4,913 10,411 ~10.2 KB
4 83,521 176,993 ~172.8 KB
5 1,419,857 3,008,899 ~2.87 MB
6 24,137,569 51,151,297 ~48.8 MB
7 410,338,673 869,572,063 ~829.3 MB
8 6,975,757,441 ~14.8 GB ~14.8 GB
9 118,587,876,497 ~251 GB ~251 GB
10 2,015,993,900,449 ~4.3 TB ~4.3 TB
11 34,271,896,307,633 ~73 TB ~73 TB

size = 19 (Standard Go board size)

Dimension Intersections JSON Size (bytes) Readable
0 1 1 1 B
1 19 39 39 B
2 361 761 761 B
3 6,859 14,479 ~14.1 KB
4 130,321 275,121 ~268.7 KB
5 2,476,099 5,227,319 ~4.99 MB
6 47,045,881 99,319,081 ~94.7 MB
7 893,871,739 1,887,062,559 ~1.76 GB
8 16,983,563,041 ~33.4 GB ~33.4 GB
9 322,687,697,779 ~635 GB ~635 GB
10 6,131,066,257,801 ~12 TB ~12 TB
11 116,490,258,898,219 ~228 TB ~228 TB

Quick Reference (Recommended Configurations)

Recommended maximum board sizes per dimension (Memory < 1 GB, Storage < 1 GB):

Dimension Max Recommended Size Intersections Memory Storage
0 Any 1 ~0 B 1 B
1 Any <=19 <=208 B <=39 B
2 Any <=361 <=4.1 KB <=761 B
3 19 6,859 ~77 KB ~14 KB
4 19 130,321 ~1.4 MB ~269 KB
5 19 2,476,099 ~27 MB ~5.0 MB
6 19 47,045,881 ~519 MB ~95 MB
7 9~13 4.7M~62.7M 73~798 MB 10~128 MB
8 5~9 390K~43M 9~657 MB 1~92 MB
9 5~7 59K~40M 45~718 MB 5~90 MB
10 3~5 59K~9.8M 2.2~224 MB 173 KB~23 MB
11 3~5 177K~48.8M 6.8 MB~1.1 GB 519 KB~116 MB

Additional Overhead

Besides the board, the game has these additional costs (negligible compared to the board):

Data Description
config.json Game config, ~200 bytes
history.json Move history, ~80 bytes per move, up to s^d moves
GameHistoryItem[] memory ~120 bytes per object + coordinate array
Other game state captures, currentPlayer, etc., ~100 bytes

Note: history.json max theoretical size = s^d x 80 bytes. On high-dimensional large boards, history can also become a significant storage burden.

Summary

  • Low dimensions (0-4D): All sizes work fine, minimal memory and storage overhead
  • Mid dimensions (5-6D): Size <= 19 is still acceptable (~500 MB memory ceiling)
  • High dimensions (7-9D): Need to reduce size to 5~9 for typical computers
  • Ultra-high dimensions (10-11D): Only size = 3~5 is feasible; 11D + size=5 needs ~1 GB memory

Requirements

  • Visual Studio Code 1.80.0 or higher.
  • High-dimensional large boards may consume significant memory. Start with lower dimensions.

Release Notes

2.0.0

  • Added AI battle mode (PVE) for playing against AI.
  • Integrated AI Core extension with support for OpenAI, Claude, Gemini and other AI providers.
  • Added 4 AI difficulty levels: Easy (Beginner), Normal (Club Player), Hard (5-dan Amateur), Master (Professional 9-dan).
  • Added AI color selection (Black/White).
  • Added AI thinking status display and move notifications.
  • Added Ko Rule to prevent immediate recapture.
  • Added komi system for White compensation.
  • Improved game mode selection interface with PVP/PVE switching.
  • Added AI model configuration interface accessible from settings.

0.0.2

  • Added settings page: language switching, default save path, view switch shortcut customization.
  • Added default save path configuration with auto-incrementing game names (Game1, Game2, ...).
  • Added 3D axis indicator (XYZ) that follows rotation in real-time.
  • Added 2D board zoom (Ctrl+wheel, 17 levels), panning (drag), and bottom zoom control bar.
  • Added 3D view bottom zoom control bar.
  • Added double-press single key to cycle views (default q forward, w backward, customizable).
  • Improved 3D rotation logic — drag direction matches view rotation direction.
  • Improved slice navigator position — displayed consistently at the top of the view.
  • Improved 2D board centered by default.
  • Improved 3D stone size consistency across depth layers.
  • Fixed game over overlay persisting after switching to a new game.
  • Fixed 3D view availability for high-dimensional boards (available for dimension >= 3).

0.0.1

  • Initial release.
  • 0-11 dimensional matrix state system with file persistence.
  • N-dimensional liberty calculation and capture algorithm.
  • Webview board rendering and sidebar interaction.
  • Chinese/English language switching.
  • 3D board rotation/zoom with axis indicator.
  • High-dimensional 3D view with slice navigator.
  • Default save path with auto-incrementing game names.

Enjoy conquering the Hilbert Space!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft