Class: BoardConstants

BoardConstants()

碁盤定数と座標変換の列挙型を生成するクラスです。
碁盤クラスでは座標系に拡張線形座標を使います。 拡張線形座標は盤外の交点を持つ碁盤の座標です。 四路盤の場合、以下のような構造になります。
    ###### #が盤外(実際の値はEXTERIOR)
    #....# .は盤上交点(実際の値はEMPTY)
    #....#
    #....#
    #....#
    ######
左下から0-オリジンで数えます。四路盤の場合、
    30 31 32 33 34 35
    24 25 26 27 28 29
    18 19 20 21 22 23
    12 13 14 15 16 17
     6  7  8  9 10 11
     0  1  2  3  4  5
碁盤の交点をxy座標で表すときも左下が原点です。xy座標は盤上左下が(1,1)です。
      ###### #が盤外(実際の値はEXTERIOR)
    4|#....# .は盤上交点(実際の値はEMPTY)
    3|#....#
    2|#....#
    1|#....#
      ######
       1234

Constructor

new BoardConstants()

Source:

Classes

BoardConstants

Methods

calcSymmetricRawVertex(rv, symmetry)

線形座標の対称変換を計算して返します。
Parameters:
Name Type Description
rv Uint16 線形座標
symmetry Integer 対称番号
Source:

diagonals(}) → {Array.<Uint16>}

vに斜め隣接する交点の座標を返します。
Parameters:
Name Type Description
} Uint16 v 拡張線形座標
Source:
Returns:
Type
Array.<Uint16>

ev2rv(ev) → {Uint16}

拡張線形座標を線形座標に変換します。
Parameters:
Name Type Description
ev Uint16
Source:
Returns:
raw vertex
Type
Uint16

ev2str(ev) → {string}

拡張線形座標をGTPが使用する座標に変換します。
Parameters:
Name Type Description
ev Uint16
Source:
Returns:
GTP座標
Type
string

ev2xy(ev) → {Array.<Integer>}

拡張線形座標をxy座標に変換します。
Parameters:
Name Type Description
ev Uint16
Source:
Returns:
xy座標
Type
Array.<Integer>

getSymmetricRawVertex(rv, symmetry) → {Uint16}

線形座標の対称変換を返します。
Parameters:
Name Type Description
rv Uint16 線形座標
symmetry Integer 対称番号
Source:
Returns:
Type
Uint16

move2xy(s) → {Array.<Integer>}

SGFフォーマットの座標をxy座標に変換します。
Parameters:
Name Type Description
s string
Source:
Returns:
xy座標
Type
Array.<Integer>

neighbors(}) → {Array.<Uint16>}

vに隣接する交点の座標を返します。
Parameters:
Name Type Description
} Uint16 v 拡張線形座標
Source:
Returns:
Type
Array.<Uint16>

rv2ev(rv) → {Uint16}

線形座標を拡張線形座標に変換します。
Parameters:
Name Type Description
rv Uint16 raw vertex
Source:
Returns:
extended vertex
Type
Uint16

str2ev(v) → {Uint16}

GTPが使用する座標を拡張線形座標に変換します。
Parameters:
Name Type Description
v string
Source:
Returns:
extended vertex
Type
Uint16

xy2ev(x, y) → {Uint16}

xy座標を拡張線形座標に変換します。
Parameters:
Name Type Description
x Integer
y Integer
Source:
Returns:
extended vertex
Type
Uint16