Skip to content

bakin-bacon/bacon-kata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

bacon-kata

Determine Perfect Bakin' Bacon Timing

The Bacon Method

The Bacon Method is a way to make perfect bacon, every time.

Bacon Method Summary:

  1. Put bacon on a cookie sheet (or other oven safe pan with sides)
  2. Put pan of bacon into cold oven
  3. Turn oven to 400 degrees Fahrenheit
  4. Cook bacon for 20 minutes

The main variable is time: how long should we cook the bacon?

The Bacon Algorithm

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.

Some examples

Base case (no previous bacon'ings)

Answer: 20 minutes

One bacon'ing (with just right feedback)

Duration Feedback
20:00 just right

Answer: 20 minutes

One bacon'ing (with too floppy feedback)

Duration Feedback
20:00 too floppy

Answer: 22 minutes

One bacon'ing (with too crispy feedback)

Duration Feedback
20:00 too crispy

Answer: 18 minutes

Multiple bacon'ings

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

Canonical Implementation

If you're looking for the canonical implementation (with tests) take a look here:

Releases

No releases published

Packages

No packages published