// Up command. func Up() { canMoveUp := moveUp() if canMoveUp { fillRandom() C.cls() plot() } }
// Right command. func Right() { canMoveRight := moveRight() if canMoveRight { fillRandom() C.cls() plot() } }
// Left command. func Left() { canMoveLeft := moveLeft() if canMoveLeft { fillRandom() C.cls() plot() } }
// Down command. func Down() { canMoveDown := moveDown() if canMoveDown { fillRandom() C.cls() plot() } }
func moveDirection(direction int) { canMove := moveOneStep(direction) if canMove { fillRandom() C.cls() plot() } }
func init() { fillRandom() fillRandom() C.cls() plot() }