Cleaning better and using chars with more contrast.

This commit is contained in:
Dan Buch 2012-12-11 18:43:15 -05:00
parent df55a809f1
commit 0ac0b4cab9
2 changed files with 10 additions and 7 deletions

View File

@ -4,20 +4,18 @@ TARGETS := \
$(LIBS) \
github.com/meatballhat/box-o-sand/conway/conways-game-of-life
all: deps build
build: test
go install -x $(TARGETS)
clean:
go clean -x -i $(TARGETS)
test:
go test -x -v -test.parallel=4 $(LIBS)
deps:
go get -x $(TARGETS)
.PHONY: all build test deps
.PHONY: all build clean deps test

View File

@ -10,6 +10,11 @@ import (
"time"
)
const (
DEAD_CELL = "■"
LIVE_CELL = " "
)
func init() {
rand.Seed(time.Now().UTC().UnixNano())
}
@ -284,7 +289,7 @@ func (state *GameState) String() string {
for y := 0; y < height; y++ {
var cells []string
for x := 0; x < width; x++ {
stringVal := "■"
stringVal := DEAD_CELL
value, err := state.Get(x, y)
if err != nil {
@ -292,7 +297,7 @@ func (state *GameState) String() string {
}
if value == 1 {
stringVal = "□"
stringVal = LIVE_CELL
}
cells = append(cells, stringVal)
}