Cleaning better and using chars with more contrast.

cat-town
Dan Buch 12 years ago
parent df55a809f1
commit 0ac0b4cab9

@ -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

@ -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)
}

Loading…
Cancel
Save