Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function start() {
- //It's way too complicated to explain now...
- cleanRowA();
- }
- function checkBall(){
- if(ballsPresent()){
- takeBall();
- }
- }
- function cleanRowA(){
- while(frontIsClear()){
- checkBall();
- move();
- }
- checkCorner();
- }
- function cleanRowB(){
- while(frontIsClear()){
- checkBall();
- move();
- }
- checkCorner2();
- }
- function checkCorner(){
- turnLeft();
- if(frontIsClear()){
- checkBall();
- move();
- checkBall();
- turnLeft();
- cleanRowB();
- }
- checkBall();
- }
- function checkCorner2(){
- turnRight();
- if(frontIsClear()){
- checkBall();
- move();
- checkBall();
- turnRight();
- cleanRowA();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement