Explanation of Solution
Step1: Move to the corner of the room with the wall or window on the right side.
Step 2: Set the value of the “windowCount” to zero.
Step 3: Set the value of the “side_count” to zero.
Step 4: While what in the front is not a window or a wall,
Step 5: move forward one unit and turn left.
Step 6: Loop while what in the front is not a window or a wall, move forward one unit
Step 7: while the “side_count < 4”
Step 8: Examine the first square of the wall and turn right.
Step 9: Set the value of “last_seen= what is in the front of the robot” and turn right.
Step 10: Examine every square and the incrementing window when the robot moves from the window to wall that is to the end of the window.
Step 11: Loop while what in the front is not a window or a wall, move forward one square and turn left.
Step 12: if the “wall is in front AND last_seen =windows”
Step 13: Add one to the window count...
Want to see the full answer?
Check out a sample textbook solutionChapter 1 Solutions
Big Java, Binder Ready Version: Early Objects
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education