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