See also: Computer Go for an overview
Table of contents |
There are a few algorithms for use in Go playing that can be of some use for Go programming.
local search strategy
Many programming languages have the ability to provide a custom comparator to run inside its standard sorting algorithm. Here is pseudocode to properly sort a list of ranks that include dans and kyus:
for example, this would work with php's uksort: http://us2.php.net/manual/en/function.uksort.php
python's http://python.org/doc/2.3.4/lib/typesseq-mutable.html
cmp(a,b):
//first take of of weird cases like ending with ? and blanks
//now check for d/k a_end = substr(a,-1) //eg get the last char of the strong b_end = substr(b,-1)
if a_end == b_end: if a_end == 'k': return (a < b ? a : b) else: return (a < b ? b : a)
else: //here a_end != b_end, therefore just find the "d" and return that return ( a_end == "d" ? a : b )
Bob Myers: This page is about programming computers to play go, not using computers for miscellaneous go-related things. Please move the information above somewhere else, or to a new page, perhaps one such as Programming Go-related Applications?.
See also