More TDD Kata’s

The Bowling Game Kata

  1. Gutter game scores zero – When you roll all misses, you get a total
    score of zero.
  2. All ones scores 20 – When you knock down one pin with each ball, your
    total score is 20.
  3. A spare in the first frame, followed by three pins, followed by
    all misses scores 16.
  4. A strike in the first frame, followed by three and then four pins,
    followed by all misses, scores 24.
  5. A perfect game (12 strikes) scores 300.

The String Calculator Kata

  1. An empty string returns zero
  2. A single number returns the value
  3. Two numbers, comma delimited, returns the sum
  4. Two numbers, newline delimited, returns the sum
  5. Three numbers, delimited either way, returns the sum
  6. Negative numbers throw an exception
  7. Numbers greater than 1000 are ignored
  8. A single char delimiter can be defined on the first line (e.g. //# for a
    ‘#’ as the delimiter)
  9. A multi char delimiter can be defined on the first line (e.g. //[###] for
    ‘###’ as the delimiter)
  10. Many single or multi-char delimiters can be defined (each wrapped in square
    brackets)

The Fizz Buzz Kata

  1. Any number divisible by three is replaced by the word fizz
  2. Any number divisible by five is replaced by the word buzz
  3. Numbers divisible by both three and five become fizzbuzz

See also:

http://codekata.pragprog.com
http://codingdojo.org
amirrajan.net