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