You are on page 1of 2

// Paola Flores Ceballos

// 12 de febrero del 2022

class program {
void turnoeste() {
while(notFacingWest){
turnleft();
}
}
void detectwall(){
while(frontIsClear()){
move();
}
}
void turneste() {
while(notFacingEast){
turnleft();
}
}
void pickbeepers(){
while(frontIsClear()){
pickall();
move();
}
pickall();
}
void pickall(){
while(nextToABeeper){
pickbeeper();
}
}
void movenorth(){
while(rightIsBlocked){
move();
}
}
void jumpfence(){
move();
iterate(3) turnleft();
}
void movesouth(){
while(frontIsClear()){
move();
}
}
void putbeepers(){
while(anyBeepersInBeeperBag){
putbeeper();
}
}

program () {
turnoeste();
detectwall();
turneste();
pickbeepers();
turnleft();
movenorth();
turneste();
jumpfence();
movesouth();
putbeepers();
turnoff();
}
}

You might also like