Exemplo n.º 1
0
// Up command.
func Up() {
	canMoveUp := moveUp()
	if canMoveUp {
		fillRandom()
		C.cls()
		plot()
	}
}
Exemplo n.º 2
0
// Right command.
func Right() {
	canMoveRight := moveRight()
	if canMoveRight {
		fillRandom()
		C.cls()
		plot()
	}
}
Exemplo n.º 3
0
// Left command.
func Left() {
	canMoveLeft := moveLeft()
	if canMoveLeft {
		fillRandom()
		C.cls()
		plot()
	}
}
Exemplo n.º 4
0
// Down command.
func Down() {
	canMoveDown := moveDown()
	if canMoveDown {
		fillRandom()
		C.cls()
		plot()
	}
}
Exemplo n.º 5
0
func moveDirection(direction int) {
	canMove := moveOneStep(direction)
	if canMove {
		fillRandom()
		C.cls()
		plot()
	}
}
Exemplo n.º 6
0
func init() {
	fillRandom()
	fillRandom()
	C.cls()
	plot()
}