[Welcome to Sensei's Library!]

StartingPoints
ReferenceSection
About


Referenced by
ComputerGoProgram...

Homepages
BenAxelrod

 

Ti Go
    Keywords: Software

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 my knowledge it is the only one currently available for Ti calcs. To download the program and see some screen shots go here: [ext] http://www.ticalc.org/archives/files/fileinfo/284/28424.html


Some info on the program:

  • It displays a cursor on the board which you move around using the arrow keys
  • It displays the coordinates of the current cursor position
  • It displays whose turn it is
  • It automatically removes dead stones
  • It counts the dead stones removed from the board
  • You can save and load one game at a time
  • It allows a handicap
  • It allows a pass
  • The program is written in Ti-Calc BASIC, so it is a little slugish at times
  • Does not check for illigal moves (placing a stone where it will have no liberties and ko rules)

To come in the future:

  • Undo feature
  • Last move marking
  • Faster opperation in assembly language (need help with)
  • Calculator linking capabilites (need help with)

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


Here is some info on the dead stone algorithm:

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.

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?

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 [ext] 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.



This is a copy of the living page "Ti Go" at Sensei's Library.
(OC) 2003 the Authors, published under the OpenContent License V1.0.