# CSCI 107 Assignment 7

- Due Date: Friday, November 2nd no later than 11:59 p.m.
- You must complete this assignment individually.
- Submission Instructions: Upload your solution, renamed
**YourFirstName-YourLastName-Assignment7.py** to the
BrightSpace Assignment 7 Dropbox.
- Deadline Reminder: Once the submission deadline passes, BrightSpace
will no longer accept your submission and you will no longer be able
to earn credit. Thus, if you are not able to fully complete the
assignment, submit whatever you have before the deadline so that
partial credit can be earned.

## Manufactoria

Check out the logic game
Manufactoria and
see if you can solve the first three puzzles. Feel free
to solve additional puzzles if you like!

For this assignment, we will use Python to simulate the game
of Manufactoria to solve two different problems. Use
manufactoria.py, renamed according to
the instructions above, as the starting point.
The strings to be simulated will consist of some combination of
reds ("r") and blues ("b"). For example, the string "brrbb" represents
the following sequence of colors: first blue, then red, then red, then
blue and finally blue.

## The Assignment - 100 points

### Requirements and Grading

- 40 points - The function four_or_more_reds is correct.
The function should accept any string that contain four or
more reds. For example, "rbrbrbr" should be accepted but "bbrrrbb"
should not be. For each incorrect answer, 10 points will be
deducted.
*Note: Your solution might be tested using different
inputs than the ones that appear in the provided code.*
- 40 points - The function alternating_colors is correct.
Let "x" be the starting symbol (either "r" or "b") and let "y"
be the other color ("r" if "x" is "b" and "b" if "x" is "r").
The function should accept strings that conform to
the following pattern: empty-string, x, xy, xyx, xyxy, etc.
For each incorrect answer, 10 points will be deducted.
*Note: Your solution might be tested with different inputs
than the ones that appear in the provided code.*
- 10 points - The Python solution is easy to understand and
does not contain unnecessary code.
- 10 points - Comments are used appropriately in the solution.