subject

Super Cleanup Karel CodeHS. I have the code down which works for two of the five worlds. I can't figure out how to get Karel back to the first Avenue facing East without running into a wall or loop. I have tried looking it up this is my last resort to find the rest of the code. function start(){
ballsTaken();
while(leftIsClear()){
endUpFacingEast();
ballsTaken();
if(rightIsClear()){
endUpFacingWest();
ballsTaken();
}else{
turnAround();
}
}
}
function ballsTaken(){
if(ballsPresent()){
takeBall();
}
while(frontIsClear()){
move();
if(ballsPresent()){
takeBall();
}
}
}
function endUpFacingEast(){
turnLeft();
move();
turnLeft();
}
function endUpFacingWest(){
turnRight();
move();
turnRight();
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
Digital information is stored using a series of ones and zeros. computers are digital machines because they can only read information as on or off –1 or 0. this method of computation is known as the system
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
When you mouse over and click to add a search term this(these) boolean operator(s) is(are) not implied. (select all that apply)?
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
What does 21 pilots middle aged name as a band 15 years prior to them naming their band 21 pilots?
Answers: 1
question
Computers and Technology, 24.06.2019 00:40
Use a software program or a graphing utility with matrix capabilities to solve the system of linear equations using an inverse matrix. x1 + 2x2 − x3 + 3x4 − x5 = 6 x1 − 3x2 + x3 + 2x4 − x5 = −6 2x1 + x2 + x3 − 3x4 + x5 = 3 x1 − x2 + 2x3 + x4 − x5 = −3 2x1 + x2 − x3 + 2x4 + x5 = 5
Answers: 3
You know the right answer?
Super Cleanup Karel CodeHS. I have the code down which works for two of the five worlds. I can't fig...
Questions
question
Physics, 29.10.2020 23:20
Questions on the website: 13722360