Exemplo n.º 1
0
func displayTestpond(width int, height int, rate time.Duration, initializer func(life.Dimensions, life.Location) []life.Location) {
	strategy, err := life.New("",
		life.Dimensions{Height: height, Width: width},
		life.NEIGHBORS_ALL,
		initializer,
		life.ConwayTester(),
		life.SimultaneousProcessor)
	if err == nil {
		displaypond(strategy, rate, -1, true, true)
	} else {
		fmt.Printf("Could not create: %s\n", err)
	}
}
Exemplo n.º 2
0
func TestNewCreateAnalysisResponse(t *testing.T) {
	size := life.Dimensions{Width: 3, Height: 3}
	analyzer, err := biologist.NewAnalyzer(size, life.Blinkers, life.ConwayTester())
	if err != nil {
		t.Fatalf("Unable to create analyzer: %s\n", err)
	}

	resp := NewCreateAnalysisResponse(analyzer)

	if !resp.Dims.Equals(&size) {
		t.Fatal("Expected size %s but received %s\n", size.String(), resp.Dims.String())
	}
}