lightvector / KataGo

GTP engine and self-play learning in Go
https://katagotraining.org/
Other
3.56k stars 564 forks source link

showboard mistake #698

Closed songshizhao closed 1 year ago

songshizhao commented 1 year ago

open with cmd call showboard method these is no "I" char for X axis From A to S is right. and Y axis from 1 to 19 is better, i guess.

GTP ready, beginning main protocol loop showboard = MoveNum: 0 HASH: CDCBC1F514D7E680FACD226074256633 A B C D E F G H J K L M N O P Q R S T 19 . . . . . . . . . . . . . . . . . . . 18 . . . . . . . . . . . . . . . . . . . 17 . . . . . . . . . . . . . . . . . . . 16 . . . . . . . . . . . . . . . . . . . 15 . . . . . . . . . . . . . . . . . . . 14 . . . . . . . . . . . . . . . . . . . 13 . . . . . . . . . . . . . . . . . . . 12 . . . . . . . . . . . . . . . . . . . 11 . . . . . . . . . . . . . . . . . . . 10 . . . . . . . . . . . . . . . . . . . 9 . . . . . . . . . . . . . . . . . . . 8 . . . . . . . . . . . . . . . . . . . 7 . . . . . . . . . . . . . . . . . . . 6 . . . . . . . . . . . . . . . . . . . 5 . . . . . . . . . . . . . . . . . . . 4 . . . . . . . . . . . . . . . . . . . 3 . . . . . . . . . . . . . . . . . . . 2 . . . . . . . . . . . . . . . . . . . 1 . . . . . . . . . . . . . . . . . . . Next player: Black Rules: {"friendlyPassOk":false,"hasButton":false,"ko":"POSITIONAL","komi":7.5,"scoring":"AREA","suicide":true,"tax":"NONE","whiteHandicapBonus":"0"} B stones captured: 0 W stones captured: 0

lightvector commented 1 year ago

Thanks for the report, but there is no mistake here. This is the standard coordinate system for Go.

See for example this output from GnuGo, a program that has been around for more than three decades, and has exactly the same coordinate conventions, of skipping I and having the y coordinate decrease as you move downward.

Board Size:   19
Handicap      0
Komi:         0.0
Move Number:  0
To Move:      black
Computer player: White

    White (O) has captured 0 pieces
    Black (X) has captured 0 pieces

    A B C D E F G H J K L M N O P Q R S T
 19 . . . . . . . . . . . . . . . . . . . 19
 18 . . . . . . . . . . . . . . . . . . . 18
 17 . . . . . . . . . . . . . . . . . . . 17
 16 . . . + . . . . . + . . . . . + . . . 16
 15 . . . . . . . . . . . . . . . . . . . 15
 14 . . . . . . . . . . . . . . . . . . . 14
 13 . . . . . . . . . . . . . . . . . . . 13
 12 . . . . . . . . . . . . . . . . . . . 12
 11 . . . . . . . . . . . . . . . . . . . 11
 10 . . . + . . . . . + . . . . . + . . . 10
  9 . . . . . . . . . . . . . . . . . . .  9
  8 . . . . . . . . . . . . . . . . . . .  8
  7 . . . . . . . . . . . . . . . . . . .  7
  6 . . . . . . . . . . . . . . . . . . .  6
  5 . . . . . . . . . . . . . . . . . . .  5
  4 . . . + . . . . . + . . . . . + . . .  4
  3 . . . . . . . . . . . . . . . . . . .  3
  2 . . . . . . . . . . . . . . . . . . .  2
  1 . . . . . . . . . . . . . . . . . . .  1
    A B C D E F G H J K L M N O P Q R S T

This is also consistent with online Go servers, for example OGS: image And KGS: image

songshizhao commented 1 year ago

thank you for your answer another question: if i don't want to wrtie logic for stones , can i just parse the showboard result string and display it?

lightvector commented 1 year ago

I would not recommend doing so. If you do, it is at your own risk. The showboard output is not promised to remain the same in future versions. Additionally the format of the output is different between different Go programs, so if you rely on parsing it, whatever you are doing will not be able to support other programs easily.

Implementing the logic for the rules shouldn't be a problem, you should just use a preexisting library. For example in python you have https://github.com/mattheww/sgfmill