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])