This commit is contained in:
Miloslav Ciz 2024-10-08 20:06:43 +02:00
parent 3034949bc8
commit 695e83f707
16 changed files with 1839 additions and 1823 deletions

6
go.md
View file

@ -80,7 +80,11 @@ TODO
See also https://senseis.xmp.net/?ComputerGoProgramming and https://www.chessprogramming.org/Go.
**Board representation:** a straightforward representation of the go board is as a simple [array](array.md) of squares; each square can be either empty, white or black, that's 3 values that can be stored with 2 bits, which allow storing 4 values, leaving one extra value to be used for some other purpose (e.g. marking illegal ko squares, estimated dead stones, marking last move etc.). 1 byte allows us to store 4 squares this way so we need only 91 bytes to represent the whole 19x19 board. On computers with enough RAM it may be considered to store 1 square in a single byte or int, making the board take more space but gaining speed thanks to data alignment (we don't need extra instructions for squeezing bit from/to a single byte). Of course we furthermore have to keep track of extra things such as numbers of captured stones.
**Board representation:** a straightforward representation of the go board is as a simple [array](array.md) of squares; each square can be either empty, white or black, that's 3 values that can be stored with 2 bits, which allow storing 4 values, leaving one extra value to be used for some other purpose (e.g. marking illegal ko squares, estimated dead stones, marking last move etc.). 1 byte allows us to store 4 squares this way so we need only 91 bytes to represent the whole 19x19 board. On computers with enough RAM it may be considered to store 1 square in a single byte or int, making the board take more space but gaining speed thanks to data alignment (we don't need extra instructions for squeezing bit from/to a single byte). Of course we may furthermore have to keep track of extra things such as numbers of captured stones. Alternative way of board representation might be an ordered list of stones that have been placed, each one with its coordinates.
[SGF](sgf.md) (smart game format) is usually used to record games of go (similarly to how PGN is used in chess).
Notable go engines include [GNU](gnu.md) Go ([free](free_software.md)), Leela Zero (free) and AlphaGo (proprietary, by [Goolag](google.md)).
TODO