示例#1
0
func TestInit(t *testing.T) {
	f := shirokuro.NewField()
	tests := []struct {
		want shirokuro.Stone
		i    uint8
		j    uint8
	}{
		{shirokuro.StoneNone, 0, 0},
		{shirokuro.StoneNone, 7, 7},
		{shirokuro.StoneWhite, 3, 3},
		{shirokuro.StoneBlack, 4, 3},
		{shirokuro.StoneBlack, 3, 4},
		{shirokuro.StoneWhite, 4, 4},
	}

	for _, test := range tests {
		actual := f.Stone(test.i, test.j)
		if actual != test.want {
			t.Errorf("(%d, %d) = %v; want %v", test.i, test.j, actual, test.want)
		}
	}
}
示例#2
0
func main() {
	f := shirokuro.NewField()
	f.PrettyPrint(os.Stdout)
}
示例#3
0
func Example() {
	f := shirokuro.NewField()
	f.PrettyPrint(os.Stdout)
}