Question: Search Search PowerPoint Review View Help Comments Catch up A a A ' B - B Lab 1 - Problem 1 Chase the Robot lives

Search
Search PowerPoint
Review
View
Help
Comments
Catch up
AaA'B-B
Lab 1- Problem 1
Chase the Robot lives in the world on the next slide. We want Chase to double the number of beepers on a corner (dot) in the world. Provide the algorithm needed to double the pile of beepers. You can assume the following:
There is a finite number of beepers on the corner directly in front of Chase
Chase has an infinite number of beepers in the bag
Chase understands the following commands:
move()- takes one step forward
turnLeft()- turns left 90 degrees
pickUpBeeper()- picks up 1 beeper from the floor and puts it in the bag
putBeeper()- puts one beeper on the floor from the bag
repeat x times / End - statements between the x and the End will be repeated x times
while ?/ End - statements between the ? Condition and the End will repeat as long as the ? Condition returns true
Chase knows how to do the following tests
beepersPresent()- returns true if there is at least 1 beeper on the spot Chase is standing
1
 Search Search PowerPoint Review View Help Comments Catch up AaA'B-B Lab

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!