Question: Not sure how to start this problem from my Discrete Structures and Algorithms classs? Suppose you have a robot that you are trying to program

Not sure how to start this problem from my Discrete Structures and Algorithms classs?Not sure how to start this problem from my Discrete Structures and

Suppose you have a robot that you are trying to program to paint floor patterns for you. This robot can only understand a few simple commands: 1. F: move forward one space 2. R: turn right 90 3. L: turn left 90 4. P: paint the floor underneath For example, the program "F F P tells the robot to move two steps forward and then paint the floor directly underneath it. 1. Write a program that paints the floor pattern below. Assume that X means that tile should be painted and that the robot always begins in the bottom left corner facing upwards. How long is your program in terms of number of commands? If the floor was of size n-by-n, give a big-O estimate for how long your program would be to paint the same pattern. Hint first try writing a program for a 5-by-5 floor then a 6-by-6 floor and see if you can find a pattern Suppose you have a robot that you are trying to program to paint floor patterns for you. This robot can only understand a few simple commands: 1. F: move forward one space 2. R: turn right 90 3. L: turn left 90 4. P: paint the floor underneath For example, the program "F F P tells the robot to move two steps forward and then paint the floor directly underneath it. 1. Write a program that paints the floor pattern below. Assume that X means that tile should be painted and that the robot always begins in the bottom left corner facing upwards. How long is your program in terms of number of commands? If the floor was of size n-by-n, give a big-O estimate for how long your program would be to paint the same pattern. Hint first try writing a program for a 5-by-5 floor then a 6-by-6 floor and see if you can find a pattern

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!