MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/codehs/comments/n2arhx/extra_karel_puzzles/
r/codehs • u/Gullible_Routine2356 • May 01 '21
5 comments sorted by
1
Plss help me with this......The due is today!!!!
2
i know this is late but for anyone looking for the code:
function start(){checkRows();buildTarget();}function checkRows(){while(noBallsPresent()){if(frontIsClear()){move();} else {moveToNewRow();}}}function moveToNewRow(){turnLeft();move();turnLeft();while(frontIsClear()){move();}turnAround();}function buildTarget(){takeBall();for(var i = 0; i< 4; i++){buildWing();turnLeft();}putBall();}function buildWing(){layBalls();goToCenter();}function layBalls(){while(frontIsClear()){move();putBall();}}function goToCenter(){turnAround();while(ballsPresent()){move();}turnAround();}
1 u/Altruistic-Durian49 Nov 17 '23 what about the other one the winding yellow road
what about the other one the winding yellow road
have you figured it out yet
0
[deleted] — view deleted comment
1 u/[deleted] Sep 14 '22 Did bro do it?
Did bro do it?
1
u/Gullible_Routine2356 May 01 '21
Plss help me with this......The due is today!!!!
2
u/RandomRedditYurd May 10 '23
i know this is late but for anyone looking for the code:
function start(){
checkRows();
buildTarget();
}
function checkRows(){
while(noBallsPresent()){
if(frontIsClear()){
move();
} else {
moveToNewRow();
}
}
}
function moveToNewRow(){
turnLeft();
move();
turnLeft();
while(frontIsClear()){
move();
}
turnAround();
}
function buildTarget(){
takeBall();
for(var i = 0; i< 4; i++){
buildWing();
turnLeft();
}
putBall();
}
function buildWing(){
layBalls();
goToCenter();
}
function layBalls(){
while(frontIsClear()){
move();
putBall();
}
}
function goToCenter(){
turnAround();
while(ballsPresent()){
move();
}
turnAround();
}
1
u/Altruistic-Durian49 Nov 17 '23
have you figured it out yet
0
u/[deleted] Dec 16 '21
[deleted] — view deleted comment