Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function start(){//GO
- buildTower();
- while(frontIsClear()){
- if(frontIsClear()){
- buildTower();
- moveToTower();
- }
- }
- }
- function buildTower(){
- if(ballsPresent()){
- move();
- if(frontIsClear()){
- move();
- turnLeft();
- putBall();
- move();
- putBall();
- move();
- putBall();
- turnAround();
- move();
- move();
- turnLeft();
- }else{
- if(frontIsClear()){
- turnLeft();
- putBall();
- move();
- putBall();
- move();
- putBall();
- turnAround();
- move();
- move();
- turnLeft();
- }
- }
- }else{
- turnLeft();
- putBall();
- move();
- putBall();
- move();
- putBall();
- turnAround();
- move();
- move();
- turnLeft();
- }
- }
- function moveToTower(){
- checkWall();
- }
- function checkWall(){
- if(frontIsClear()){
- move();
- }
- if(frontIsClear()){
- move();
- buildTower();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement