forked from moowahaha/tennis_kata_no_ifs
-
Notifications
You must be signed in to change notification settings - Fork 3
/
README
50 lines (34 loc) · 1.27 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Tennis Score Kata
==================
Taken from: http://codingdojo.org/cgi-bin/index.pl?KataTennis
Credit to: Stephen Hardisty, https://github.com/moowahaha
Goal
-----
The basic principle to calculate a tennis score. Easy.
To keep it simple, the tennis match only lasts for one game.
The game is turn based. Player one goes first, then player two.
Repeat until there is a winner.
At any time, you can check the score, it should be after a point has
been assigned.
When there is a winner, they should be declared and the game terminated.
BUT! You cannot use if's, unless's, case or other such flow control. Cheater.
Tests should be written first!
Tennis score link:
http://en.wikipedia.org/wiki/Tennis#Scoring
A sample rspec test has been submitted to get you started. Type:
$ bundle install
$ rake
Ingredients
----------
* Less than 10 people, no more than 5.
* A laptop.
* A projector or big TV screen
* A room far away from where people are trying to work quietly.
* Beer (optional in China)
Method
-------
* The kata starts with a pair at the laptop coding for 5 minutes.
* At the end of the 5 minutes, one of the pair moves off to be replaced
by an onlooker.
* Repeat until you are bored.
* Nobody should be at the computer for 2 consecutive turns (approx 10 minutes).