GithubHelp home page GithubHelp logo

bacon-kata's Introduction

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:

bacon-kata's People

Contributors

jonfuller avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

trikitrok

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.