diff --git a/conway/go/Makefile b/conway/go/Makefile new file mode 100644 index 0000000..e283d23 --- /dev/null +++ b/conway/go/Makefile @@ -0,0 +1,23 @@ +LIBS := \ + github.com/meatballhat/box-o-sand/conway/go +TARGETS := \ + $(LIBS) \ + github.com/meatballhat/box-o-sand/conway/go/conways-game-of-life + + +all: deps build + + +build: test + go install -x $(TARGETS) + + +test: + go test -x -v -test.parallel=4 $(LIBS) + + +deps: + go get -x $(TARGETS) + + +.PHONY: all build test deps diff --git a/conway/go/conway_test.go b/conway/go/conway_test.go new file mode 100644 index 0000000..c8b0945 --- /dev/null +++ b/conway/go/conway_test.go @@ -0,0 +1,16 @@ +package conway_test + +import ( + "testing" +) + +import ( + . "github.com/meatballhat/box-o-sand/conway/go" +) + +func TestNewGameOfLifeIsNonEmpty(t *testing.T) { + game := NewGameOfLife() + if game.Height < 1 || game.Width < 1 { + t.Fail() + } +} diff --git a/conway/go/conways-game-of-life/main.go b/conway/go/conways-game-of-life/main.go new file mode 100644 index 0000000..e0b87a2 --- /dev/null +++ b/conway/go/conways-game-of-life/main.go @@ -0,0 +1,5 @@ +package main + +func main() { + return +} diff --git a/conway/go/game_of_life.go b/conway/go/game_of_life.go new file mode 100644 index 0000000..f945798 --- /dev/null +++ b/conway/go/game_of_life.go @@ -0,0 +1,13 @@ +package conway + +type GameOfLife struct { + Height uint8 + Width uint8 +} + +func NewGameOfLife() *GameOfLife { + return &GameOfLife{ + Height: 16, + Width: 16, + } +}