Program Assignment 1:
Due Fri. Sept. 9, 1:30pm
- Star: Write a function named star() that commands the robot to draw a five pointed star. Begin with a sequence of commands with hard coded values for the distances and the turn values. For full credit, paramaterize your function so that star takes a single parameter, length, whose value is the length of each of the line segments in the star. Bonus points will be given for a solution that uses loop iteration in the algorithm for drawing the star.
- Maze: For the given maze layed out on the back of the twister mat, write a function called maze() that, given the robot is placed at the correct starting position, will use "dead reckoning" to move the robot from the starting position to the ending position. Full credit will be given for solutions that use additional defined functions for moving forward a designated linear distance and turning a designated amount. (See your textbook for exercises resulting in these functions.)
- Dance: Choreograph a simple dance routine for your robot and define functions to carry it out. Make sure you divide the tasks into re-usable moves and as much as possible parameterize the moves so they can be used in customized ways in different steps. Use the building block idea to build more and more complex series of dance moves. Make sure the routine lasts for at least several seconds and it includes at least two repetitions of the entire sequence. You may also make use of the beep command you learned from the last section to incorporate some sounds into your choreography.