Class Pos
Represents Go board position
Defined in: pos09.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Pos(n)
Object to represent n ro Go board position.
|
Field Attributes | Field Name and Description |
---|---|
black stone or space
|
|
movable points
|
|
unit adjacency relationship
|
|
adjacency relationship
|
|
atari
|
|
black stone liberty
|
|
white stone liberty
|
|
ko
|
|
space
|
|
number of liberty
|
|
number of moves
|
|
vector order
|
|
prisoner
|
|
number of lines
|
|
turn (BLACK or WHITE)
|
|
6 vector(option)
|
|
white stone or space
|
|
watched vector
|
Method Attributes | Method Name and Description |
---|---|
calcVectors(mv)
Calculate vectors and matrices for B-W Graph Model.
|
|
clear()
Initialize game position
|
|
getStone(col, row)
Returns stone color or space from board intersection co-ordinate
|
|
getWatch()
Get watching BVector
|
|
initF0()
Initialize adjacency relationship F0
|
|
isMovable(col, row)
Check if the point is movable
|
|
move(mv)
Update game position by move.
|
|
opposite(turn)
Return opposite of turn
|
|
setWatch(watch)
Set watching BVector
|
|
toIndex(col, row)
Convert move position to index for vector element
|
|
toMove(index)
Convert index for vector element to move position on board
|
|
toPicStr()
Convert board position state to picture string
|
|
toString()
Convert board position state to string
|
|
toTeX()
Convert board position state to TeX string
|
Class Detail
Pos(n)
Object to represent n ro Go board position.
- Parameters:
- {Number} n
- number of lines
- Since:
- 0.1
Field Detail
{BVector}
b
black stone or space
{BVector}
c
movable points
{BMatrix}
F
unit adjacency relationship
{BMatrix}
F0
adjacency relationship
{BVector}
h
atari
{BVector}
ib
black stone liberty
{BVector}
iw
white stone liberty
{BVector}
k
ko
{BVector}
l
space
{Number[]}
liberty
number of liberty
{Number}
moves
number of moves
{Number}
order
vector order
{Number[]}
prisoner
prisoner
{Number}
ro
number of lines
{Number}
turn
turn (BLACK or WHITE)
{SixVectors}
v6
6 vector(option)
{BVector}
w
white stone or space
{BVector}
watch
watched vector
Method Detail
{Boolean}
calcVectors(mv)
Calculate vectors and matrices for B-W Graph Model. Targets are:
a - added stone vector by move i
d - deleted unit vector by move i
A - added unit adjacent points matrix by move i
D - reset unit adjacent points matrix by move i
b - black stone or space vector after move
w - white stone or space vector after move
l - space vector after move
F - unit adjacent points matrix after move
k - ko vectoer after move
h - atari stones vector after move
c - movable points after move
ib - black stone liberties after move
iw - white stone liberties after move
a - added stone vector by move i
d - deleted unit vector by move i
A - added unit adjacent points matrix by move i
D - reset unit adjacent points matrix by move i
b - black stone or space vector after move
w - white stone or space vector after move
l - space vector after move
F - unit adjacent points matrix after move
k - ko vectoer after move
h - atari stones vector after move
c - movable points after move
ib - black stone liberties after move
iw - white stone liberties after move
- Parameters:
- {Move} mv
- move i
- Since:
- 0.9
- Returns:
- {Boolean} false if error
clear()
Initialize game position
- Since:
- 0.3
{Number}
getStone(col, row)
Returns stone color or space from board intersection co-ordinate
- Parameters:
- {Number} col
- column co-ordinate
- {Number} row
- row co-ordinate
- Since:
- 0.1
- Returns:
- {Number} SPACE, BLACK or WHITE (or -1 if error)
{BVector}
getWatch()
Get watching BVector
- Since:
- 0.1
- Returns:
- {BVector} watching BVector or null if not exist
initF0()
Initialize adjacency relationship F0
- Since:
- 0.1
{Boolean}
isMovable(col, row)
Check if the point is movable
- Parameters:
- {Number} col
- column co-ordinate for the point to check
- {Number} row
- row co-ordinate for the point to check
- Since:
- 0.3
- Returns:
- {Boolean} true if movable
{Boolean}
move(mv)
Update game position by move. ro+1 for either col or row means pass.
p.move(new Move(col, row));
- Parameters:
- {Move} mv
- position to move (to place stone)
- Since:
- 0.9
- Returns:
- {Boolean} true for leagal move, false for illeagal move
{Number}
opposite(turn)
Return opposite of turn
- Parameters:
- {Number} turn
- (BLACK or WHITE)
- Since:
- 0.1
- Returns:
- {Number} opposite of turn
setWatch(watch)
Set watching BVector
- Parameters:
- {BVector} watch
- watching BVector. If null then stop watching.
- Since:
- 0.1
{Number}
toIndex(col, row)
Convert move position to index for vector element
- Parameters:
- {number} col
- column of move
- {Number} row
- row of move
- Since:
- 0.1
- Returns:
- {Number} index (1 origin)
{Move}
toMove(index)
Convert index for vector element to move position on board
- Parameters:
- {Number} index
- (1 origin)
- Since:
- 0.1
- Returns:
- {Move} position on board as Move object
{String}
toPicStr()
Convert board position state to picture string
- Since:
- 0.1
- Returns:
- {String} picture string of board position
{String}
toString()
Convert board position state to string
- Since:
- 0.3
- Returns:
- {String} board position
{String}
toTeX()
Convert board position state to TeX string
- Since:
- 0.3
- Returns:
- {String} TeX string which represents board position