示例#1
0
文件: sgf2_test.go 项目: Ken1JF/sgf
// printInitBoard2 is equivalent to printInitBoard
// but uses the iteration function ah.EachNode
// and a literal func.
func printInitBoard2(abhr *ah.AbstHier) {
	var row ah.RowValue = 0
	nCol, nRow := abhr.GetSize()
	fmt.Println("Board", int(nCol), "by", int(nRow))
	abhr.EachNode(ah.PointLevel,
		func(brd *ah.Graph, nl ah.NodeLoc) {
			_, r := brd.Nodes[nl].GetPointColRow()
			if r != row {
				fmt.Println()
				row = r
			}
			fmt.Print(ah.PtTypeNames[brd.Nodes[nl].GetPointType()])
		})
	fmt.Println()
}