MicroLearnable actions codes for mable

PHOTO EMBED

Tue Mar 12 2024 09:47:46 GMT+0000 (Coordinated Universal Time)

Saved by @shiro #dart #programming

void action(){  
  turnRight(); move();
  
  if(isMableOnClam()){ /* Check if clams exist where Mable stand */
    // To pick up a clam
    pickUpClam();
  }
  else if(isMableOnDestination()){ /* Check if Mable is on a destination */
    // To put down all clams
    putDownClam();
    putDownClam();
    putDownClam();
    putDownClam();
  }
  else{ /* If there are no clams and Mable is not on the destination */
    // To move forward once
    move();
  }
  
  turnLeft(); move();

  if(isMableOnClam()){ /* Check if clams exist where Mable stand */
    // To pick up a clam
    pickUpClam();
  }
  else if(isMableOnDestination()){ /* Check if Mable is on a destination */
    // To put down all clams
    putDownClam();
    putDownClam();
    putDownClam();
    putDownClam();
  }
  else{ /* If there are no clams and Mable is not on the destination */
    // To move forward once
    move();
  }
  
  turnRight(); move();
  turnLeft(); move();
  turnRight(); move();
  
  if(isMableOnClam()){ /* Check if clams exist where Mable stand */
    // To pick up a clam
    pickUpClam();
  }
  else if(isMableOnDestination()){ /* Check if Mable is on a destination */
    // To put down all clams
    putDownClam();
    putDownClam();
    putDownClam();
    putDownClam();
  }
  else{ /* If there are no clams and Mable is not on the destination */
    // To move forward once
    move();
  }
  
  turnLeft(); move();
  
  if(isMableOnClam()){ /* Check if clams exist where Mable stand */
    // To pick up a clam
    pickUpClam();
  }
  else if(isMableOnDestination()){ /* Check if Mable is on a destination */
    // To put down all clams
    putDownClam();
    putDownClam();
    putDownClam();
    putDownClam();
  }
  else{ /* If there are no clams and Mable is not on the destination */
    // To move forward once
    move();
  }
  
  turnRight(); move();
  
  if(isMableOnClam()){ /* Check if clams exist where Mable stand */
    // To pick up a clam
    pickUpClam();
  }
  else if(isMableOnDestination()){ /* Check if Mable is on a destination */
    // To put down all clams
    putDownClam();
    putDownClam();
    putDownClam();
    putDownClam();
  }
  else{ /* If there are no clams and Mable is not on the destination */
    // To move forward once
    move();
  }
}
content_copyCOPY