Chapter 3. Implementing your first Go bot
Listing 3.1. Using an enum to represent players
Listing 3.2. Using tuples to represent points of a Go board
Listing 3.3. Setting moves: plays, passes, or resigns
Listing 3.4. Encoding strings of stones with set
Listing 3.5. Creating a Go Board instance
Listing 3.6. Checking neighboring points for liberties
Listing 3.7. Utility methods for placing and removing stones
Listing 3.8. Continuing our definition of place_stone
Listing 3.9. Continuing our definition of place_stone
Listing 3.10. Encoding game state for a game of Go
Listing 3.11. Deciding when a game of Go is over
Listing 3.12. Continuing our definition of GameState to enforce the self-capture rule
Listing 3.13. Does the current game state violate the ko rule?
Listing 3.14. Is this move valid for the given game state?
Listing 3.15. Is the given point on the board an eye?
Listing 3.16. Your central interface for Go agents
Listing 3.17. A random Go bot, playing at about 30 kyu strength
Listing 3.18. Utility functions for bot vs. bot games
Listing 3.19. A script to let a bot play against itself
Listing 3.20. Generating Zobrist hashes
Listing 3.21. GoString instances with immutable sets of stones and liberties
Listing 3.22. Instantiating the Go board with a _hash value for the empty board
Listing 3.23. Placing a stone means applying the hash of that stone
Listing 3.24. Removing a stone means unapplying the hash value of the stone
Listing 3.25. Returning the current Zobrist hash of the board