Пример #1
0
func (m mapToNextMap) Check() (bool, string) {
	u := universe.LoadFromString(m.Input)
	u.Toroidal = m.Toroidal
	u.Next()
	message := "Answer:\n" + m.Answer + "\nGuess:\n" + u.String() + "\nInput:\n" + m.Input + "\n"
	return u.String() == m.Answer, message
}
Пример #2
0
//-------------------
// Finally, the tests...
func TestSize(t *testing.T) {
	u := universe.LoadFromCanonicalString("3,2,f|0,0,")
	if u.Width != 3 || u.Height != 2 {
		t.Error("Size does not match")
	}
	u = universe.LoadFromString("..\n..\n..\n")
	if u.Width != 2 || u.Height != 3 {
		t.Error("Size does not match")
	}
}