Determine Perfect Bakin' Bacon Timing
The Bacon Method is a way to make perfect bacon, every time.
Bacon Method Summary:
- Put bacon on a cookie sheet (or other oven safe pan with sides)
- Put pan of bacon into cold oven
- Turn oven to 400 degrees Fahrenheit
- Cook bacon for 20 minutes
The main variable is time: how long should we cook the bacon?
Goal: find the optimal bacon cooking time.
Some requirements:
- Starting point is 20 minutes, 400 degrees.
- Each time the bacon-maker makes bacon, the bacon-maker provides feedback and tells you the bacon was too crispy, too floppy, or just right.
- If the bacon was too crispy the time should be adjusted to be less.
- If the bacon was too floppy the time should be adjust to be more.
- If the bacon was just right, the time should not be adjusted.
- Time adjustment should be cut in half each time the user changes their answer from too crispy to too floppy or vice versa.
- Time adjustments should start at 2:00.
- Time adjustments should be no less than 0:30.
Answer: 20 minutes
Duration | Feedback |
---|---|
20:00 | just right |
Answer: 20 minutes
Duration | Feedback |
---|---|
20:00 | too floppy |
Answer: 22 minutes
Duration | Feedback |
---|---|
20:00 | too crispy |
Answer: 18 minutes
Duration | Feedback |
---|---|
20:00 | too crispy |
18:00 | too crispy |
16:00 | too floppy |
17:00 | too crispy |
16:30 | perfect |
16:30 | too crispy |
Answer: 16 minutes
If you're looking for the canonical implementation (with tests) take a look here: