There are currently 3 programs that allow you to play/view Go games on a TI calculator.
Ti-Go is a program for the TI-83 graphing calculator that allows two players to play Go on a 9x9 board. It was written by Ben Axelrod. To download the program and see some screen shots go here: http://www.ticalc.org/archives/files/fileinfo/284/28424.html
If you would like to help in any way (porting to another calc, converting to assembly language, adding calculator linking or anything else) please email me: bmaxelro@syr.edu
The process of removing dead stones is essentialy recursive. However, the laguage i am writing in does not allow this type of recusion. So the idea behind my algorithm is to build up a list of stones to be erased. The algorithm goes down this list and for every stone on the list, it looks at its 4 neighbors. If the neighbor is also of the right color, it adds it to the end of the list. If the neighbor is black or a wall, it does nothing. If one of the neighbors is an empty spot, then the list is cleared and the search is abandoned. Once the agorithm gets to the end of the list, then the stones on the list are deleted. Of course, this whole algorithm will have to be implemented 4 times: once for each of the placed stone's neighbors.
NOTE: I numbered the for loops for clarity
For_1 (the 4 neighbors of the placed stone) ;goes around the placed stone clear list if (stone is target color) Then add the stone to list For_2 (X,1,size of list) ;goes down the list of stones in the group For_3 (the 4 neighbors of X) ;goes around the stones in the list if (neighbor is target color) Then If (neighbor is not on list) Then Add stone to list End End if (neighbor is empty) ;group has liberty then clear list ;to break For_2 break For_3 End End_for_3 End_for_2 erase all stones on the list End End_for_1
What do you think about this algorithm?
Bisqwit: I recently wrote a goban simulator in Ruby. It keeps track of the stone groups on board and their respective liberties, and handles captures automatically. You can pick ideas from its source code. And then there's cgoban and many other free go-related software. Take a look.
David: I haven't studied algorithms that perform this task particularly, and so am not especially qualified to comment on yours. That said, I think it will work (I've even tested it, just now). You shouldn't worry too much about optimization. While this algorithm will visit a given stone several times, the captures of large strings that would make this a problem are not common. And in my experience, screen drawing operations are the major unavoidable bottleneck on the TI-83 (it's been years since I've used one, though).
I'm sure there are better algorithms, but most rely on maintaining data structures more complex than the TI-83 can conveniently handle. Your algorithm is novel and seems to me to be a good solution.
dmwit: When writing my own go program for the TI-83+, I came up with the same algorithm! It was good enough for me, though it was rather slow in BASIC. I am also using that algorithm in a C/assembly go board for the TI-89. Although it is still in the alpha stages, it has many nice features already. You can preview it at http://www.geocities.com/dmwit/goban89_preview.zip.
IGO is a Go program for the TI 83+ written by Matthias Butz in Assembly language. More information is available on a seperate page.
Ti-Go / TI-Go-View is a program for the TI-89 graphing calculator that allows two players to play Go on a 9x9, 13x13 or 19x19 board as well as save and view games. It was written by Alexander Nittka?. To download the program and see some screen shots go here: http://www.ticalc.org/archives/files/fileinfo/91/9130.html