Question: Part (a). In this part, you are to construct a world that has beepers spread out along row 2 between column 1 and a wall
Part (a). In this part, you are to construct a world that has beepers spread out along row 2 between column 1 and a wall to the East. This wall can be anywhere along row 2. In any one location, there can be at most 1 beeper. BB should start at coordinates (1, 2) facing East.
Create a subroutine, called clear_row, that Has BB move East along row 2, picking up all beepers she finds until she reaches the wall. Create another subroutine, called bbreturn that moves BB back to the start of the row ending up facing East again. You can create other subroutines to help as well.
Make your code general; it must work if the beepers are placed in different cells and for different placement of the wall in row 2.



A starting world could look like this (sample world a1) 10 1 2 4 5 6 7 8 9 10 11 12 13 in which case, the final world would look like this with BB holding 6 beepers in bag 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
