off
200
25
on
15
999
0
0
pretty
5
110
0
0
on
15
on
Application,BoardSize,User
5
35
10
35
on
25
0
0.9
0.62
360
None
pass
at
450
750
Arial
60
px
Javascript not available
BoardSize error
Unknown error
Go Game
:
Addstone error ()
Black
matchStone (, , )
Black
A1
1
findxy ()
findxy ()
findxy ()
Black
0
0
1
drawxy ()
drawxy ()
drawxy ()
drawxy ()
#blackStone
#whiteStone
Black
0
0
0
1
labelStone ()
labelStone ()
labelStone ()
labelStone ()
labelStone ()
white
black
none
1
empty
#black
#white
Mark ()
moveNum is()
match is()
pointStatus is()
colour is()
#black
#white
#whitefillsquare
#white
0
0
0
testing number()
found tryNumber()
found tryPos()
using ()
found matchB()
0
black
0
black
0
0
0
0
0
#black
#white
0
black
0
no comment
#Jdot
K10,Q10,D10,K16,Q16,D16,K4,Q4,D4
#Jdot
J9,O9,D9,J14,O14,D14,J4,O4,D4
#Jdot
H8,M8,D8,H12,M12,D12,H4,M4,D4
#Jdot
K10,D10,K4,Q4
ClipX is
ClipY is
A1
A1
#Jdot
move error ()
peekAll ()
= boardsize) || (y < 0) || (y >= boardsize)) {
return;
}
var n = gname(x, y);
if (cellfarm[n] == c) {
group_x[group_x.length] = x;
group_y[group_y.length] = y;
var xa = new Array(x - 1, x + 1, x, x);
var ya = new Array(y, y, y - 1, y + 1);
for (var i = 0; i < 4; i++) {
var xx = xa[i];
var yy = ya[i];
var already = false;
for (var j = 0; j < group_x.length; j++) {
if ((xx == group_x[j]) && (yy == group_y[j])) {
already = true;
break;
}
}
if (!already) {
group_iterator(xx, yy, c);
}
}
} else if (cellfarm[n] == '.') {
group_has_liberties = true;
}
}
function get_group(x, y, isblack)
{
var c;
if (isblack)
c = "x";
else
c = "o";
group_x.length = 0;
group_y.length = 0;
group_has_liberties = false;
group_iterator(x, y, c);
}
function loadMove (xy, colour)
{
var x;
var y;
error = true;
x = s.indexOf(xy.substring(0,1));
y = boardsize - Number(xy.substring(1,xy.length));
if (!isNaN(x) && !isNaN(y)) {
error = false;
if ((colour == "White") || (colour == "AddWhite"))
blackMove = false;
else
blackMove = true;
applyMove (x, y);
}
return error;
}
function applyMove (x, y)
{
put_cell(x, y, false);
var xarray = new Array(x - 1, x + 1, x, x );
var yarray = new Array(y, y, y - 1, y + 1);
for (var i = 0; i < 4; i++) {
get_group(xarray[i], yarray[i], !blackMove);
if (group_x.length > 0) {
if (!group_has_liberties) {
delete_group(!blackMove);
}
}
}
return null;
}
//
// examine cell contents
//
function peekCell(xy)
{
var answer;
var x;
var y;
x = s.indexOf(xy.substring(0,1));
y = boardsize - Number(xy.substring(1,xy.length));
answer = cellfarm[gname(x, y)];
if (answer == '.')
return 'empty';
if (answer == 'x')
return 'Black';
if (answer == 'o')
return 'White';
}
//
// examine everything (for debugging)
//
function peekAll()
{
var h;
h = "";
for(var y = 0; y < boardsize; y++)
{
for(var x = 0; x < boardsize; x++)
{
h = h + cellfarm[gname(x, y)];
}
}
return h;
}
//
// initialise
//
function init (size)
{
error = 2
boardsize = parseInt(size);
if (!isNaN(boardsize))
error = 0
for(var y = 0; y < boardsize; y++)
{
for(var x = 0; x < boardsize; x++)
{
put_cell(x, y, true);
}
}
return error;
}
function counterInit (xslproc, elem) {
counter = parseInt(elem.getAttribute ("value"));
return null;
}
function counterRead () { // Return a string.
return "" + counter;
}
function counterIncr () {
counter++;
return null;
}
]]>