asked 14.8k views
1 vote
1.16.7 Debug Big Tower I need help completing the script.

asked
User John Day
by
7.9k points

1 Answer

3 votes

function start(){ if (facingNorth()) { buildTower(); }else{ turnNorth(); }// This function has karel face north, no matter what direction // karel starts facing. function turnNorth(){ if (facingWest ()) { turnRight(); buildTower(); }else{ if (facingSouth ()){ turnLeft(); turnLeft(); buildTower (); }else{ if (facingEast() ){ turnLeft (); buildTower(); } } } }/ This function builds a tower all the way to the top of the world. function buildTower ( ){ putBall (); while(frontIsClear ()) { move () ; putBall (); } }function turnRight(){ turnLeft(); turnLeft(); turnLeft(); } }

You can do the spacing and indentation

answered
User Guy Cothal
by
8.2k points