On closer examination of the rules I notice Forty-All should in fact be Deuce

This commit is contained in:
Emily Bache committed 2012-01-04 19:52:03 +01:00
1 parent 34b36ec3f2
commit 926f8a2686
5 files changed
+12 -12

No files matched your search

+3 -3
View File
@@ -16,7 +16,7 @@ const std::string tennis_score(int p1Score, int p2Score) {
score = "Forty";
score += "-All";
}
if (p1Score==p2Score && p1Score>3)
if (p1Score==p2Score && p1Score>2)
score = "Deuce";
if (p1Score > 0 && p2Score==0)
@@ -106,8 +106,8 @@ TEST(TennisTest, ThirtyAll_2_2) {
}
TEST(TennisTest, FortyAll_3_3) {
EXPECT_EQ("Forty-All", tennis_score(3, 3));
TEST(TennisTest, Deuce_3_3) {
EXPECT_EQ("Deuce", tennis_score(3, 3));
}