From 5420a6e4dc67a49365cbc97787592108c9148d54 Mon Sep 17 00:00:00 2001 From: NoahLan <6995syu@163.com> Date: Mon, 18 Dec 2023 17:45:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dpoint=20util=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E5=A4=84=E7=90=86pass=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ngochess/gtp/util.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ngochess/gtp/util.go b/ngochess/gtp/util.go index eb83aac..e975365 100644 --- a/ngochess/gtp/util.go +++ b/ngochess/gtp/util.go @@ -11,7 +11,7 @@ const alphaUpper = "ABCDEFGHJKLMNOPQRSTUVWXYZ" func Point(x, y int) string { if x < 0 || x >= 25 || y < 0 || y >= 25 { - return "" + return "PASS" } return fmt.Sprintf("%s%d", byteToString(alphaUpper[x]), y+1) } @@ -21,6 +21,9 @@ func byteToString(b byte) string { } func ParsePoint(pos string) (x, y int) { + if strings.ToUpper(pos) == "PASS" { + return 255, 255 + } x = byteToIndex(alpha, pos[0]) if x == -1 { x = byteToIndex(alphaUpper, pos[0])