Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- F1 = moveForward();
- F2 = turnLeft();
- F3 = turnAround();
- F4 = turnRight();
- F5 = pickBeeper();
- F6 = dropBeeper();
- */
- /*--------------------------------- 1.1.1 ----------------------------------------------------*/
- void uTurn (){
- moveForward();
- turnLeft();
- repeat(3){
- moveForward();
- }
- turnLeft();
- moveForward();
- }
- void obtainArtifact(){
- turnRight();
- uTurn();
- pickBeeper();
- uTurn();
- dropBeeper();
- }
- /*--------------------------------- 1.1.2 ----------------------------------------------------*/
- void moveToWall(){
- repeat(9){
- moveForward();
- }
- }
- void defuseOneBomb(){
- moveToWall();
- pickBeeper();
- turnAround();
- moveToWall();
- turnAround();
- }
- /*--------------------------------- 1.1.3 ----------------------------------------------------*/
- void defuseTwoBombs(){
- defuseOneBomb();
- turnLeft();
- defuseOneBomb();
- }
- /*--------------------------------- 1.1.4 ----------------------------------------------------*/
- void practiceHomeRun(){
- repeat(4){
- moveToWall();
- pickBeeper();
- turnLeft();
- }
- }
- /*--------------------------------- 1.2.1 ----------------------------------------------------*/
- void climbOneStair(){
- turnLeft();
- moveForward();
- turnRight();
- moveForward();
- }
- void climbTheStairs(){
- moveForward();
- repeat(6){
- climbOneStair();
- }
- }
- /*--------------------------------- 1.2.2 ----------------------------------------------------*/
- void stepRight(){
- moveForward();
- turnRight();
- moveForward();
- }
- void fillTheHoles(){
- repeat(4){
- stepRight();
- dropBeeper();
- turnAround();
- stepRight();
- }
- }
- /*--------------------------------- 1.2.3 ----------------------------------------------------*/
- void saveTheFlower(){
- moveForward();
- pickBeeper();
- repeat(4){
- turnLeft();
- moveForward();
- moveForward();
- turnRight();
- moveForward();
- }
- dropBeeper();
- repeat(4){
- moveForward();
- turnRight();
- moveForward();
- moveForward();
- turnLeft();
- }
- }
- /*--------------------------------- 1.2.4 ----------------------------------------------------*/
- void sharpTurnLeft()
- {
- turnLeft();
- moveForward();
- turnLeft();
- }
- void sharpTurnRigth()
- {
- turnRight();
- moveForward();
- turnRight();
- }
- void mowOneRow()
- {
- repeat(6){
- moveForward();
- pickBeeper();
- }
- moveForward();
- }
- void mowTheLawn()
- {
- repeat(2){
- mowOneRow();
- sharpTurnLeft();
- mowOneRow();
- sharpTurnRigth();
- }
- mowOneRow();
- sharpTurnLeft();
- mowOneRow();
- }
- /*--------------------------------- 1.3.1 ----------------------------------------------------*/
- void harvestARow(){
- repeat(4){
- moveForward();
- pickBeeper();
- turnRight();
- moveForward();
- turnLeft();
- }
- }
- void harvestDoubleRows(){
- harvestARow();
- repeat(2) {
- moveForward();
- moveForward();
- turnLeft();
- }
- harvestARow();
- }
- void harvestTheField(){
- harvestDoubleRows();
- turnAround();
- harvestDoubleRows();
- }
- /*--------------------------------- 1.3.2 ----------------------------------------------------*/
- void repairTheStreet(){
- repeat(10){
- if(rightIsClear())
- {
- turnRight();
- moveForward();
- dropBeeper();
- turnAround();
- moveForward();
- turnRight();
- }
- if(frontIsClear())
- {
- moveForward();
- }
- }
- }
- /*--------------------------------- 1.3.3 ----------------------------------------------------*/
- void cleanRow(){
- repeat(10){
- if(onBeeper()){
- pickBeeper();
- }
- if(frontIsClear()){
- moveForward();
- }
- }
- }
- void cleanTheRoom(){
- repeat(5){
- cleanRow();
- sharpTurnLeft();
- cleanRow();
- if(rightIsClear()){
- sharpTurnRigth();
- }
- }
- }
- /*--------------------------------- 1.3.4 ----------------------------------------------------*/
- void tileTheFloor(){
- repeat(100)
- {
- dropBeeper();
- if(frontIsClear() && !beeperAhead()){
- moveForward();
- }
- else
- {
- turnLeft();
- moveForward();
- }
- }
- }
- /*--------------------------------- 1.4.1 ----------------------------------------------------*/
- void stealOlympicFire(){
- climbTheStairs();
- pickBeeper();
- moveForward();
- turnRight();
- repeat(6){
- moveForward();
- }
- turnLeft();
- moveForward();
- }
- /*--------------------------------- 1.4.2 ----------------------------------------------------*/
- void removeTheTiles(){
- repeat(100)
- {
- pickBeeper();
- if(!beeperAhead()){
- turnLeft();
- }
- moveForward();
- }
- }
- /*--------------------------------- 1.4.3 ----------------------------------------------------*/
- void walkTheLabyrinth(){
- repeat(99){
- if(!frontIsClear()){
- if(leftIsClear()){
- turnLeft();
- }
- else {
- turnRight();
- }
- }
- moveForward();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement