Add maze pkg

This commit is contained in:
dwrz
2026-10-25 02:51:07 +00:00
parent 1aabbdfee7
commit 17d9903f17
6 changed files with 388 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
package cell
import (
"testing"
"code.chimeric.al/dwrz/minotaur/pkg/maze/direction"
)
func TestSetDirection(t *testing.T) {
var c Cell
t.Logf("start: %08b", c)
c.SetDirection(direction.Right)
t.Logf("set right: %08b", c)
c.SetDirection(direction.Down)
t.Logf("set down: %08b", c)
var (
hasRight = c.HasDirection(direction.Right)
hasDown = c.HasDirection(direction.Down)
hasLeft = c.HasDirection(direction.Left)
hasUp = c.HasDirection(direction.Up)
)
t.Logf("has right: %v", hasRight)
t.Logf("has down: %v", hasDown)
t.Logf("has left: %v", hasLeft)
t.Logf("has up: %v", hasUp)
if !hasRight {
t.Errorf("expected cell to have right")
}
if !hasDown {
t.Errorf("expected cell to have down")
}
if hasLeft {
t.Errorf("expected cell to not have left")
}
if hasUp {
t.Errorf("expected cell to not have up")
}
}