Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Have statements in mind but need help with coding. Yes, I've seen the others but they're no help. 7 8 9 10 def.main(): .... exit_house()

image text in transcribedimage text in transcribed

Have statements in mind but need help with coding. Yes, I've seen the others but they're no help.

7 8 9 10 def.main(): .... exit_house() clear_around_house put_papers_down() go_to_bed() turn_off) 10 11 9 12 13 8 14 15 7 16 # Reeborg exit house def. exit_house(): ....while.left_is_clear(): turn_left move ( 17 18 6 19 20 5 21 22 #Reboorg.picks up newspapers def.clear_around_house(): .... while not on_beeper(): pick_beeper turn_left() 23 Street 24 25 26 27 2 28 29 # Reboorg.deposits.beepers def. puts_papers_down() : .... turn_off) # Walk forward. all the way to the wall def. corner(): .... while obstacle(): pick_beeper) 1 30 1 3 4 5 6 7 8 9 10 31 32 Avenue 33 34 35 36 37 # Pick up beeper def.pick_beepers_to_wall(): .... while on_beeper(): pick_beeper) ....while.front_is_clear(): move() .... while on_beeper(): pick_beeper() 38 39 40 41 1 Error Shutoff: User stop error:( Error Shutoff: User stop error() 42 2 43 44 #. Rotate Reeborg.90 degrees to the left BACKGROUND STORY: Once upon a time, Reeborg fell ill and was unable to leave his house for several days. During that time, the kid that delivers newspapers continued to deliver them in the usual manner; that is, fung about all around Reeborg's house. Finally one morning Reeborg decided he was well enough to get out of bed and pick up all the newspapers that were on his property. YOUR TASK: Program Reeborg to leave his house and pick up all the newspapers (beepers) that are on the perimeter of his property. Reeborg should then deposit all but one of these beepers in the vestibule of his house and then return to bed with the one beeper. Retaining that beeper in his pocket, he should face west and turn off. SITUATION DETAILS: In the initial situation, Reeborg is in his bed fac- ing some unknown direction. His bed is defined to be the extreme southwest corner of his house, vestibule excluded. The vestibule is a single corner that juts out from his house and has a one corner wide entrance to the house on one end and an exit on the other. The vestibule is walled on the other two sides. Reeborg's house is a rectangle guaranteed to be at least two corners high and wide. Except for the vestibule walls, there are no protusions or obstacles on the perimeter of the rectangle. There are no obstacles within the house. If any beepers are inside the house, they are to be ignored. Reeborg's property line includes only those corners that lie on the perimeter of his house. That is, only those corners that are adjacent horizontally, vertically, or diagonally to the walls of his house. This includes corners adjacent to the vestibule. More than one paper may have fallen on the same street corner. There will always be at least one paper on the perimeter. Ignore papers that are not on Reeborg's 1 property. Reeborg's property will never be restricted in such a way as to make it impossible for Reeborg to make a complete circuit around his property

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions