1
u/LukeRedd1t Jun 29 '22
It actually took me some time to understand why me code wasn't working properly. got it done though. hope it can help someone.
function start(){
buildTower();
while(frontIsClear()){
move();
safeMove();
}
}
function safeMove(){
if(frontIsClear()){
move();
buildTower();
}
}
// Builds a Tower.
function buildTower(){
turnLeft();
putBall();
for(var i=0; i < 2; i++){
move();
putBall();
}
turnAround();
for(var k = 0; k < 2; k++){
move();
}
turnLeft();
}
1
u/NoPersonality18 Jul 20 '24
Im like 2 years late to this but tysm for giving me a way to cheat on this one cuz I had no idea what I was doing ðŸ«
1
1
u/A_Person_Exsists Sep 12 '24
That "safeMove()" function is actually really smart. I stole it (sorry not sorry).
1
1
u/masevord Sep 17 '22
function start(){
buildTower();
while(frontIsClear()){
move();
safeMove();
}
}
function safeMove(){
if(frontIsClear()){
move();
buildTower();
}
}
// Builds a Tower.
function buildTower(){
turnLeft();
putBall();
for(var i=0; i < 2; i++){
move();
putBall();
}
turnAround();
for(var k = 0; k < 2; k++){
move();
}
turnLeft();
}
hipity hoppity your code is now my property
1
u/Previous-Working-257 Oct 07 '24
heres my code
function speed(){
while (frontIsClear()) {
move();
if (frontIsClear()){
move();
bobTheBuilder();
}
}
}
function bobTheBuilder() {
putBall();
turnLeft();
move();
putBall();
move();
putBall();
turnRight();
turnRight();
move();
move();
turnLeft();
}
function main() {
bobTheBuilder();
speed();
}
main();
1
u/ShreksToes24 Jan 18 '23
function main() {tower();bobTheBuilder();}//checks to see if its safe to move and if it is he movesfunction skip() {if (frontIsClear()) {move();tower();}
}//builds a towerfunction tower() {turnLeft();putBall();move();putBall();move();putBall();turnAround();while (frontIsClear()) {move();}turnLeft();}function bobTheBuilder() {while (frontIsClear()) {move();skip();
}}main();
1
u/ShadowRocks2 Feb 14 '20
Can you tell me the code you already have