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