### PROGRAM STUB FOR  BASE TEN ADDITION
### ADDING TWO THREE DIGIT NUMBERS
### SEE BELOW FOR PORTIONS STUDENTS SHOULD MODIFY AS LAB EXERCISE
### NOTE: INTENT IS THAT THIS SHOULD RUN UNDER

###  AUXILIARY MODE  ####

# utility subroutines
define turn_north {
    while (not_facing_north) {
        turn_left
    }
}

define turn_south {
    while (not_facing_south) {
        turn_left
    }
}

define turn_east {
     while (not_facing_east) {
         turn_left
     }
}

define turn_west {
    while (not_facing_west) {
         turn_left
    }
}

define turn_around {
    turn_left
    turn_left
}

define turnright {
     turn_left
     turn_left
     turn_left
}

### PART 1: STUDENTS HAVE TO FILL IN THE FOLLOWING
#Choose a bag to keep the sum in.
define add_digit_to_sum {


}
### END OF PART 1


### PART 2:  STUDENTS HAVE TO FILL IN THE FOLLOWING ROUTINE AND
### ADD ANY ADDITIONAL ROUTINES THEY NEED TO FINISH
define put_digit_and_save_carry {

}
### END OF PART 2.

# this routine takes BB to the spot above of the next column of digits.
define go_to_next_column {
      turn_around
      move
      move
      move
      turn_west
      move
      turn_south
}

#main program
#assumes robot starts just above
#the inputs, facing south.

define main {
# add three columns --
# the fourth iteration is in case of a carry out

    do (4) {
          move
          add_digit_to_sum
          move
          add_digit_to_sum
          move
          put_digit_and_save_carry
          go_to_next_column
    }

}
