# # Post-lab 4: Class Challenge

In Lab 3 and 4 we applied programming basics to our knowledge of the servo and ultrasonic sensor hardware to develop general strategies for controlling the robot. After providing a first rough pseudocode outline of a solution to the class navigation challenge 1, your task is to build an algorithm optimized for speed together with your team.

## # Homework 1

To be done individually. Submit online.

Refer to this document for examples.

1. Pseudocode is a "text-based" detail (algorithmic) design tool. It is an artificial and informal language that helps programmers develop algorithms.  Provide a pseudocode for carrying out the class navigation challenge task.

2. Communicate in plain language your overall strategy for completing the task, describing the proposed logic for a sketch (program) outlined in your pseudocode.

## # Homework 2

To be done as a group OR as an individual as desired. Submit through online course platform as a *ino or .txt file, by the due date given.

Provide a solution to the class challenge, optimized for the shortest possible time, with the aim of completing it in 30 seconds or less. A further goal will be to iterate and improve this algorithm, avoiding if possible, the use of a hard-coded strategy to solve the class super challenge. I.e., you should be able to modify your code for a challenge with different coin distances from the walls and different gap distances between the walls.

Important: Try to write clean, readable code that is well-commented. Research guidelines for doing this. Some resources for general guidelines to get you started can be found here:

1. Arduino style guide
2. Coding and comment styles for programming. Notice here that different programming languages have different style conventions. Try to follow conventions for `C++`.

### # Class Challenge Guidelines

Teams will be scored based on the degree of completion of the task. The task must be completed in 30 seconds or less. Bonus will be given for the top time. A time penalty for not finishing the challenge in under 30 seconds will result in a 2 point deduction.

• 5/10 = robot moves, no coins collected
• 5.5/10 = 1 coin
• 6/10 = top coins
• 6.5/10 = top coins + successful turn
• 7.5/10 = top coins + 2 right coins
• 8/10 = all coins collected in over 30 seconds
• 10/10 = all coins collected in 30 seconds or less.
• +0.5 = fastest time