Слияние кода завершено, страница обновится автоматически
<!DOCTYPE html>
<html>
<head>
<title>棋谱复盘镜像</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.staticfile.net/twitter-bootstrap/5.1.1/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.staticfile.net/twitter-bootstrap/5.1.1/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<div class="container-fluid p-2">
<div class="btn-group form-control">
<input class="form-control bg-secondary" type="text" id="sgftext">
<button type="button" class="form-control btn btn-primary" onclick="gt.main(event)">New</button>
<button type="button" class="form-control btn btn-primary" onclick="gt.main(event)">Show</button>
<span id="posColorList" class="badge bg-info" style="width: 50px;">0</span>
<button type="button" class="btn btn-primary" onclick="gt.main(event)">-</button>
<input class="form-control" type="range" id="myRange" onchange="gt.main(event)" value="0" min="0" max="10">
<button type="button" class="btn btn-primary" onclick="gt.main(event)">+</button>
<button id="man-auto" type="button" class="btn btn-primary" onclick="gt.main(event)">></button>
<button type="button" class="form-control btn btn-primary" onclick="gt.main(event)">记录</button>
<button type="button" class="form-control btn btn-primary" onclick="gt.main(event)">步数</button>
<button id="qp-mode" type="button" class="form-control btn btn-primary"
onclick="gt.main(event)">下棋模式</button>
</div>
<div id="baseid" class="col border">
<canvas id="myCanvas" style="border:1px solid gray;"></canvas>
</div>
</div>
<script>
var health_alert = false;
function health() {
const now = new Date();
const minutes = now.getMinutes();
if (minutes === 0 || minutes === 30) {
if (health_alert) {
alert("游戏健康忠告:请注意休息,合理安排游戏时间。");
health_alert = false;
}
} else {
health_alert = true;
}
setTimeout("health()", 25000);
}
setTimeout("health()", 1000);
class DrawQipan {
constructor(canvasid, grid = 20) {
this.grid = grid;
this.gridHalf = grid / 2;
this.qipanWidth = 20 * this.grid;
this.canvas = document.getElementById(canvasid);
this.ctx = this.create_ctx(this.canvas);
this.canvasOrigin = [0, 0];
this.positions = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s"];
this.canvas_size();
this.painting = false;
this.blueList = ["rg", "oc"];
this.goldPosition = "dd";
this.setupClickListener(this.canvas, this);
this.isShowText = true;
this.strokeStyle = "B";
}
create_ctx(canvas) {
let ctx = canvas.getContext("2d");
ctx.strokeStyle = "black";
ctx.lineWidth = 2;
return ctx;
}
setupClickListener(element, someVariable) {
element.addEventListener('mousedown', function (event) {
someVariable.painting = true;
someVariable.canvasListener("mousedown", event.clientX, event.clientY);
});
element.addEventListener('mousemove', function (event) {
if (someVariable.painting) {
someVariable.canvasListener("mousemove", event.clientX, event.clientY);
}
});
element.addEventListener('mouseup', function (event) {
if (someVariable.painting) {
someVariable.painting = false;
someVariable.canvasListener("mouseup", event.clientX, event.clientY);
}
});
}
canvasListener(action, x, y) {
let qpMode = document.getElementById("qp-mode").innerText;
let rect, rx, ry, gr, gc, position;
rect = this.canvas.getBoundingClientRect();
gr = Math.floor((x - rect.left) / this.qipanWidth);
gc = Math.floor((y - rect.top) / this.qipanWidth);
this.canvasOrigin = [this.qipanWidth * gr, this.qipanWidth * gc];
position = this.coordinate_position(x, y);
[rx, ry] = this.position_coordinate(position);
//console.log(gr, gc, position, x - rect.left, y - rect.top, rx, ry)
if (qpMode == "下棋模式" && action == "mousedown") {
let sgf = this.strokeStyle + "[" + position + "]";
} else if (qpMode == "选择模式" && action == "mousedown") {
this.startPosition = position;
this.painting = true;
this.selectedList = [position];
this.ctx.strokeStyle = "red";
this.ctx.lineWidth = 2;
this.ctx.beginPath();
this.ctx.moveTo(rx, ry);
} else if (qpMode == "选择模式" && action == "mousemove") {
if (this.painting) {
if (position != this.selectedList[this.selectedList.length - 1]) {
this.selectedList.push(position);
this.ctx.lineTo(rx, ry);
this.ctx.stroke();
}
}
} else if (qpMode == "选择模式" && action == "mouseup") {
this.painting = false;
if (this.selectedList[0] != this.selectedList[this.selectedList.length - 1]) {
this.selectedList.push(this.selectedList[0]);
}
let blueList = [], linshiList = [];
sgo.sgf.forEach((item, index) => {
if (this.isPointInPolygon(item.slice(2, 4), this.selectedList)) {
linshiList.push(item.slice(2, 4));
}
});
this.selectedList.concat(linshiList).forEach((item, index) => {
blueList.includes(item) || blueList.push(item);
});
let sgf = [], pcDict = {}, pcList = [];
sgo.sgf.forEach((item, index) => {
if (blueList.includes(item.slice(2, 4))) {
sgf.push(item);
pcList.push(JSON.parse(JSON.stringify(sgo.posColorList[index])));
}
});
pcDict = JSON.parse(JSON.stringify(pcList[pcList.length - 1]));
sgo.newWeiQi(sgf, pcDict, pcList);
document.getElementById("myRange").value = 0;
document.getElementById("myRange").max = sgo.sgf.length - 1;
document.getElementById("posColorList").textContent = 0;
gt.blueList = sga.mirror_blue(blueList)
gt.show(sga.mirror_area(sgo.posColorList[0]));
/*
let sgf = [], pcDict = {}, pcList = [];
sgo.sgf.forEach((item, index) => {
if (this.blueList.includes(item.slice(2, 4))) {
sgf.push(item);
pcList.push(JSON.parse(JSON.stringify(sgo.posColorList[index])));
}
});
pcDict = JSON.parse(JSON.stringify(pcList[pcList.length - 1]));
sgo.newWeiQi(sgf, pcDict, pcList);
qipan.goStep();
*/
}
}
draw(posColor) {
let ox, oy, cx, cy;
let start = this.grid;
let end = 19 * this.grid;
let current;
[ox, oy] = this.canvasOrigin;
let radius = Math.floor(this.grid / 3 - 1);
this.ctx.clearRect(ox, oy, this.qipanWidth, this.qipanWidth);
this.ctx.lineWidth = 2;
this.ctx.strokeStyle = "black";
this.ctx.beginPath();
this.positions.forEach((row, ri) => {
current = (this.positions.indexOf(row) + 1) * this.grid;
this.ctx.moveTo(current + ox, start + oy);
this.ctx.lineTo(current + ox, end + oy);
this.ctx.moveTo(start + ox, current + oy);
this.ctx.lineTo(end + ox, current + oy);
});
let pos = ["d", "j", "p"];
for (let row in pos) {
for (let col in pos) {
let aa = this.position_coordinate(pos[row] + pos[col]);
cx = aa[0], cy = aa[1];
this.ctx.moveTo(cx + radius, cy);
this.ctx.arc(cx, cy, radius, 0, 2 * Math.PI);
}
}
this.ctx.stroke();
let strokeStyle = { B: "black", W: "White" };
for (let pos in posColor) {
this.ctx.beginPath();
let aa = this.position_coordinate(pos);
cx = aa[0], cy = aa[1];
this.ctx.moveTo(cx + Math.floor(this.grid / 2 - 1), cy);
this.ctx.lineWidth = 3;
//console.log(pos, posColor[pos], Number(document.getElementById("myRange").value))
if (pos == this.goldPosition) {
this.ctx.strokeStyle = "Gold";
} else if (this.blueList.includes(pos)) {
this.ctx.strokeStyle = "LightBlue";
} else {
this.ctx.strokeStyle = "black";
this.ctx.lineWidth = 2;
}
this.ctx.arc(cx, cy, Math.floor(this.grid / 2 - 1), 0, 2 * Math.PI);
this.ctx.fillStyle = strokeStyle[posColor[pos][0]];
this.ctx.fill();
if (this.isShowText) {
if (posColor[pos][0] == "B") {
this.ctx.fillStyle = "White";
} else {
this.ctx.fillStyle = "black";
}
this.ctx.textBaseline = "middle";
this.ctx.fillText(posColor[pos][1], cx - this.ctx.measureText(posColor[pos][1]).width / 2, cy);
}
this.ctx.stroke();
}
this.ctx.strokeStyle = "black";
}
coordinate_position(x, y) {
let rect, row, col;
rect = this.canvas.getBoundingClientRect();
row = Math.floor((x - this.canvasOrigin[0] + this.grid / 2 - rect.left) / this.grid) - 1;
col = Math.floor((y - this.canvasOrigin[1] + this.grid / 2 - rect.top) / this.grid) - 1;
return this.positions[row] + this.positions[col];
}
position_coordinate(position) {
let row, col, rect, rx, cy;
rect = this.canvas.getBoundingClientRect();
row = this.positions.indexOf(position.slice(0, 1));
col = this.positions.indexOf(position.slice(1, 2));
rx = Math.floor((row + 1) * this.grid + this.canvasOrigin[0]);
cy = Math.floor((col + 1) * this.grid + this.canvasOrigin[1]);
return [rx, cy];
}
canvas_size(qp_row, qp_col) {
this.canvasWidth = this.qipanWidth * qp_row;
this.canvasHeight = this.qipanWidth * qp_col;
document.getElementById("myCanvas").width = this.canvasWidth;
document.getElementById("myCanvas").height = this.canvasHeight;
}
isPointInPolygon(point, polygon) {
let numIntersections = 0;
let [x, y] = this.position_coordinate(point);
const n = polygon.length;
for (let i = 0, j = n - 1; i < n; j = i++) {
let [xi, yi] = this.position_coordinate(polygon[i]);
let [xj, yj] = this.position_coordinate(polygon[j]);
if ((yi > y) != (yj > y) &&
x < (xj - xi) * (y - yi) / (yj - yi) + xi) {
numIntersections++;
}
}
return numIntersections % 2 !== 0;
}
}
const drawQipan = new DrawQipan("myCanvas", 23);
class simpleGo {
constructor() {
this.positions = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s"];
this.newWeiQi([], {}, []);
this.goString = { string: [], empty: [] };
}
go_handler(item = "B[qd]") {
var position = item.slice(2, 4);
if (this.posColor.hasOwnProperty(position)) {
return false;
} else {
this.posColor[position] = [item[0]];
}
var del_pos = [];
var near_pos = this.near_positions(position);
for (var npn in near_pos) {
if (this.posColor.hasOwnProperty(near_pos[npn])) {
if (this.posColor[near_pos[npn]][0] != this.posColor[position][0]) {
this.goString = { 'string': [], 'empty': [] };
this.go_string(near_pos[npn]);
if (this.goString['empty'].length == 0) {
for (var spn in this.goString['string']) {
del_pos.includes(this.goString['string'][spn]) || del_pos.push(this.goString['string'][spn]);
}
}
}
}
}
if (del_pos.length == 0) {
this.goString = { 'string': [], 'empty': [] };
this.go_string(position);
if (this.goString['empty'].length == 0) {
delete this.posColor[position];
return false;
}
} else {
for (var d_p in del_pos) {
delete this.posColor[del_pos[d_p]];
}
}
this.sgf.push(item);
this.posColor[position].push(this.sgf.length)
this.posColorList.push(JSON.parse(JSON.stringify(this.posColor)));
return true;
}
go_string(position) {
this.goString['string'].push(position);
var nPos = this.near_positions(position);
for (var np in nPos) {
if (this.posColor.hasOwnProperty(nPos[np])) {
if (!this.goString['string'].includes(nPos[np]) && this.posColor[nPos[np]][0] == this.posColor[position][0]) {
this.go_string(nPos[np]);
}
} else {
this.goString['empty'].includes(nPos[np]) || this.goString['empty'].push(nPos[np]);
}
}
}
near_positions(position) {
var near_pos = [];
var row = this.near(position[0]);
var col = this.near(position[1]);
for (var r in row) {
near_pos.push(row[r] + position[1]);
}
for (var c in col) {
near_pos.push(position[0] + col[c]);
}
return near_pos;
}
near(char) {
switch (char) {
case "a":
return ["b"];
case "s":
return ["r"];
case "b": case "c": case "d": case "e": case "f": case "g":
case "h": case "i": case "j": case "k": case "l": case "m":
case "n": case "o": case "p": case "q": case "r":
default:
var pos = this.positions.indexOf(char);
return [this.positions[pos - 1], this.positions[pos + 1]];
}
}
newWeiQi(sgf, posColor, posColorList) {
this.sgf = sgf;
this.posColor = posColor;
this.posColorList = posColorList;
}
}
const sgo = new simpleGo();
class simpleGoArea {
constructor() {
this.positions = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s"];
this.mirror_positions = JSON.parse(JSON.stringify(this.positions)).reverse();
this.newWeiQi([], {});
this.goArea = { 'area': [], 'empty': [] }
}
mirror_area(posColor) {
let mirrorArea = {
"围棋域": {},
"左右翻转": {},
"上下翻转": {},
"左右上下翻转": {},
"旋转90度": {},
"反旋90度": {},
"旋转左右翻转": {},
"旋转上下翻转": {},
/*
"旋转左右上下翻转": {},
"反旋左右翻转": {},
"反旋上下翻转": {},
"反旋左右上下翻转": {}
*/
}
for (let position in posColor) {
let color = posColor[position][0];
let sequence = posColor[position][1];
let row = position.slice(0, 1);
let col = position.slice(1, 2);
let mRow = this.mirrow_position(row);
let mCol = this.mirrow_position(col);
mirrorArea["围棋域"][position] = [color, sequence];
mirrorArea["左右翻转"][mRow + col] = [color, sequence];
mirrorArea["上下翻转"][row + mCol] = [color, sequence];
mirrorArea["左右上下翻转"][mRow + mCol] = [color, sequence];
mirrorArea["旋转90度"][col + mRow] = [color, sequence];
mirrorArea["反旋90度"][mCol + row] = [color, sequence];
mirrorArea["旋转左右翻转"][mCol + mRow] = [color, sequence];
mirrorArea["旋转上下翻转"][col + row] = [color, sequence];
/*
mirrorArea["旋转左右上下翻转"][mCol + row] = [color, sequence]; //反旋90度
mirrorArea["反旋左右翻转"][col + row] = [color, sequence]; //旋转上下翻转
mirrorArea["反旋上下翻转"][mCol + mRow] = [color, sequence]; //旋转左右翻转
mirrorArea["反旋左右上下翻转"][col + mRow] = [color, sequence]; //旋转90度
*/
}
return mirrorArea;
}
mirror_blue(positions) {
let mirrorBlue = {
"围棋域": [],
"左右翻转": [],
"上下翻转": [],
"左右上下翻转": [],
"旋转90度": [],
"反旋90度": [],
"旋转左右翻转": [],
"旋转上下翻转": [],
}
for (let index in positions) {
let row = positions[index].slice(0, 1);
let col = positions[index].slice(1, 2);
let mRow = this.mirrow_position(row);
let mCol = this.mirrow_position(col);
mirrorBlue["围棋域"].push(row + col);
mirrorBlue["左右翻转"].push(mRow + col);
mirrorBlue["上下翻转"].push(row + mCol);
mirrorBlue["左右上下翻转"].push(mRow + mCol);
mirrorBlue["旋转90度"].push(col + mRow);
mirrorBlue["反旋90度"].push(mCol + row);
mirrorBlue["旋转左右翻转"].push(mCol + mRow);
mirrorBlue["旋转上下翻转"].push(col + row);
}
return mirrorBlue;
}
mirrow_position(mark) {
return this.mirror_positions[this.positions.indexOf(mark)];
}
near_positions(position) {
rnp = this.near(position[0])
cnp = this.near(position[1])
near_pos = {}
if (rnp.hasOwnProperty("right")) {
near_pos["右"] = rnp["right"] + position[1]
}
if (rnp.hasOwnProperty("right") && cnp.hasOwnProperty("left")) {
near_pos["右上"] = rnp["right"] + cnp["left"]
}
if (cnp.hasOwnProperty("left")) {
near_pos["上"] = position[0] + cnp["left"]
}
if (rnp.hasOwnProperty("left") && cnp.hasOwnProperty("left")) {
near_pos["左上"] = rnp["left"] + cnp["left"]
}
if (rnp.hasOwnProperty("left")) {
near_pos["左"] = rnp["left"] + position[1]
}
if (rnp.hasOwnProperty("left") && cnp.hasOwnProperty("right")) {
near_pos["左下"] = rnp["left"] + cnp["right"]
}
if (cnp.hasOwnProperty("right")) {
near_pos["下"] = position[0] + cnp["right"]
}
if (rnp.hasOwnProperty("right") && cnp.hasOwnProperty("right")) {
near_pos["右下"] = rnp["right"] + cnp["right"]
}
}
near(char) {
switch (char) {
case 'a':
return { 'right': 'b' }
case 's':
return { 'left': 'r' }
case "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r":
pos = this.positions.indexOf(char)
return { 'left': this.positions[pos - 1], 'right': this.positions[pos + 1] }
}
}
newWeiQi(sgf, posColor) {
this.sgf = sgf;
this.posColor = posColor
}
}
const sga = new simpleGoArea();
class Tools {
constructor() {
this.row = 4;
this.col = 2;
this.positions = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s"];
this.combinedPattern = /[\u4e00-\u9fa5a-zA-Z0-9;\[\]\-: ]+/g;
this.sgf = [];
this.blueList = [];
this.goldDict = {};
this.mirror_area = null;
drawQipan.canvas_size(this.row, this.col);
this.test();
}
main(event) {
switch (event.target.textContent) {
case "New":
sgo.newWeiQi([], {}, []);
for (let i = 0; i < this.col; i++) {
for (let j = 0; j < this.row; j++) {
drawQipan.canvasOrigin = [drawQipan.qipanWidth * j, drawQipan.qipanWidth * i];
drawQipan.draw({});
}
}
break;
case "Show":
this.blueList = [];
drawQipan.blueList = [];
sgo.newWeiQi([], {}, []);
if (document.getElementById("sgftext").value == "") {
egm.handle(sgftext)
} else {
egm.handle(document.getElementById("sgftext").value)
}
document.getElementById("myRange").max = sgo.sgf.length - 1;
this.show(sga.mirror_area(sgo.posColorList[0]));
break;
case "-":
document.getElementById("myRange").value = Math.max(0, Number(document.getElementById("myRange").value) - 1);
this.show(sga.mirror_area(sgo.posColorList[Number(document.getElementById("myRange").value)]));
break;
case "+":
document.getElementById("myRange").value = Math.min(sgo.sgf.length - 1, Number(document.getElementById("myRange").value) + 1);
this.show(sga.mirror_area(sgo.posColorList[Number(document.getElementById("myRange").value)]));
break;
case ">":
this.autoRun = true;
setTimeout("gt.autorunning(0)", 2000);
break;
case "记录":
break;
case "步数":
drawQipan.isShowText ? drawQipan.isShowText = false : drawQipan.isShowText = true;
break;
case "下棋模式":
event.target.textContent = "选择模式";
break;
case "选择模式":
event.target.textContent = "下棋模式";
break;
default:
this.show(sga.mirror_area(sgo.posColorList[Number(document.getElementById("myRange").value)]));
break;
}
}
show(mirror_area) {
let area_list = ["围棋域", "左右翻转", "上下翻转", "左右上下翻转", "旋转90度", "反旋90度", "旋转左右翻转", "旋转上下翻转"];
this.goldDict = sga.mirror_blue([sgo.sgf[Number(document.getElementById("myRange").value)].slice(2, 4)]);
document.getElementById("posColorList").textContent = Number(document.getElementById("myRange").value) + 1;
area_list.forEach((item, index) => {
drawQipan.canvasOrigin = [drawQipan.qipanWidth * (index % 4), drawQipan.qipanWidth * Math.floor(index / 4)];
if (this.blueList.hasOwnProperty(item)) {
drawQipan.blueList = this.blueList[item];
}
drawQipan.goldPosition = this.goldDict[item][0];
drawQipan.draw(mirror_area[item]);
});
}
autorunning(n) {
if (n < sgo.posColorList.length) {
document.getElementById("myRange").value = n++;
this.show(sga.mirror_area(sgo.posColorList[Number(document.getElementById("myRange").value)]));
this.autoRun && setTimeout("gt.autorunning(" + n + ")", 1000);
} else {
this.autoRun = false;
}
}
test() {
drawQipan.canvas_size(this.row, this.col);
for (let i = 0; i < this.col; i++) {
for (let j = 0; j < this.row; j++) {
drawQipan.canvasOrigin = [drawQipan.qipanWidth * j, drawQipan.qipanWidth * i];
drawQipan.draw({});
}
}
}
}
const gt = new Tools();
const sgftext = `(;CA[utf8]AP[golaxy]GN[29届三星车险杯半决赛]PW[党毅飞]PB[连笑]WR[3002]BR[3002]HA[0]RE[W+R]KM[6.5]SZ[19]ST[0]RU[japanese]
;B[qd];W[dp];B[cd];W[qp];B[cq];W[cp];B[dq];W[fq];B[eq];W[ep];B[fr];W[gq];
B[gr];W[hq];B[od];W[ec];B[jc];W[dg];B[de];W[hc];B[dc];W[ed];B[ee];W[he];
B[ci];W[lc];B[je];W[le];B[ic];W[eh];B[hb];W[gc];B[jg];W[hg];B[md];W[ld];
B[lg];W[ne];B[nd];W[me];B[og];W[mg];B[mh];W[lh];B[li];W[kh];B[kg];W[nh];
B[mi];W[ng];B[ii];W[hi];B[hj];W[gi];B[cf];W[cg];B[oj];W[ni];B[nj];W[ki];
B[ih];W[kj];B[lk];W[kk];B[ll];W[ik];B[ij];W[pi];B[gj];W[ej];B[hh];W[gh];
B[fj];W[km];B[fi];W[dj];B[gg];W[ff];B[fh];W[fg];B[pj];W[nb];B[ob];W[pb];
B[oc];W[pg];B[qi];W[qh];B[bg];W[bh];B[bf];W[ri];B[qj];W[lm];B[mm];W[mn];
B[nm];W[nn];B[om];W[on];B[pn];W[po];B[qn];W[hr];B[kl];W[jl];B[jm];W[im];
B[jn];W[ln];B[pq];W[qq];B[mq];W[or];B[hl];W[il];B[ho];W[in];B[io];W[jo];
B[jp];W[kn];B[fo];W[fp];B[iq];W[jr];B[gn];W[kp];B[ch];W[cj];B[bj];W[cl];
B[qo];W[pp];B[rg];W[rh];B[oi];W[oh];B[of];W[oe];B[re];W[qf];B[rf];W[oa];
B[pe];W[qc];B[rc];W[rb];B[pf];W[sc];B[ph];W[kb];B[qg];W[jb];B[el];W[bq];
B[br];W[bp];B[ir];W[is];B[ib];W[ar];B[gs];W[es];B[er];W[hs];B[ds];W[cs];
B[cr];W[dr];B[dn];W[cn];B[ds];W[eb];B[rd];W[pc];B[pd];W[mc];B[rp];W[rq];
B[db];W[dr];B[bi];W[ei];B[ds];W[da];B[ca];W[dr];B[sb];W[sa];B[ds];W[ea];
B[cb];W[dr];B[sd];W[sb];B[ds];W[lj];B[mj];W[dr];B[qa];W[pa];B[ds];W[ml];
B[mk];W[dr];B[nc];W[mb];B[ds];W[pm];B[pl];W[dr];B[as];W[aq];B[ds];W[sp];
B[ro];W[dr];B[qb];W[ra];B[ds];W[qm];B[rm];W[dr];B[qb];W[qa];B[ds];W[ql];
B[rl];W[dr];B[ef];W[eg];B[ds];W[if];B[jf];W[dr];B[na];W[ma];B[ds];W[id];
B[jd];W[dr];B[ko];W[lo];B[ds];W[so];B[qk];W[dr];B[dm];W[bk];B[ds];W[gm];
B[hm];W[dr];B[cm];W[bm];B[ds];W[hn];B[gl];W[dr];B[gf];W[fe];B[ds];W[eo];
B[fm];W[dr];B[bn];W[co];B[ds];W[hp];B[bs];W[ip];B[sn];W[sq];B[hf];W[ge];
B[ig];W[go];B[ie];W[gb];B[fn];W[hd];B[ek];W[ak])`
class extract_go_manual {
constructor() {
this.positions = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s"];
this.combinedPattern = /[\u4e00-\u9fa5a-zA-Z0-9;\[\]\-: ]+/g;
}
handle(text) {
sgo.newWeiQi([], {}, []);
var results = text.match(this.combinedPattern) || [];
var format_content = results.join('').split(";");
for (var index in format_content) {
var item = format_content[index];
if (item.length == 5 && this.positions.includes(item[2]) && this.positions.includes(item[3])) {
sgo.go_handler(item);
}
}
sga.newWeiQi([], {});
return sga.mirror_area(sgo.posColor);
}
}
const egm = new extract_go_manual();
</script>
</body>
</html>
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )