Skip to content

Commit 0919599

Browse files
committed
Update Tournament readme with more details
Based on the conversation here: exercism/rust#122 This addresses a few problems that @ijanos had - What do the column headers mean? - How are points awarded? - What is the input format? There's still a need for a default test json file, but that can come in a different PR.
1 parent d082f7d commit 0919599

File tree

1 file changed

+56
-5
lines changed

1 file changed

+56
-5
lines changed

tournament.md

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,66 @@
11
Tally the results of a small football competition. Based on an input file
2-
containing which team played against which and what the outcome was
2+
containing which team played against which and what the outcome was
33
create a file with a table like this:
44

55
```
66
Team | MP | W | D | L | P
77
Devastating Donkeys | 3 | 2 | 1 | 0 | 7
8-
Allegoric Alaskians | 3 | 2 | 0 | 1 | 6
8+
Allegoric Alaskans | 3 | 2 | 0 | 1 | 6
99
Blithering Badgers | 3 | 1 | 0 | 2 | 3
1010
Courageous Californians | 3 | 0 | 1 | 2 | 1
1111
```
1212

13-
The outcome should be ordered by points, descending. To keep things simple ties
14-
are broken by looking at the number of wins and if that doesn't solve anything
15-
by ordering the team names alphabetically.
13+
What do those abbreviations mean?
14+
15+
- MP: Matches Played
16+
- W: Matches Won
17+
- D: Matches Drawn (Tied)
18+
- L: Matches Lost
19+
- P: Points
20+
21+
A win earns a team 3 points. A draw earns 1. A loss earns 0.
22+
23+
The outcome should be ordered by points, descending. Ties are broken by
24+
first looking at the number of wins then by ordering the team names
25+
alphabetically.
26+
27+
###
28+
29+
Input
30+
31+
Your tallying program will receive input that looks like:
32+
33+
```
34+
Allegoric Alaskans;Blithering Badgers;win
35+
Devastating Donkeys;Courageous Californians;draw
36+
Devastating Donkeys;Allegoric Alaskans;win
37+
Courageous Californians;Blithering Badgers;loss
38+
Blithering Badgers;Devastating Donkeys;loss
39+
Allegoric Alaskans;Courageous Californians;win
40+
```
41+
42+
The result of the match refers to the first team listed. So this line
43+
44+
```
45+
Allegoric Alaskans;Blithering Badgers;win
46+
```
47+
48+
Means that the Allegoric Alaskans beat the Blithering Badgers.
49+
50+
This line:
51+
52+
```
53+
Courageous Californians;Blithering Badgers;loss
54+
```
55+
56+
Means that the Blithering Badgers beat the Courageous Californians.
57+
58+
And this line:
59+
60+
```
61+
Devastating Donkeys;Courageous Californians;draw
62+
```
63+
64+
Means that the Devastating Donkeys and Courageous Californians tied.
65+
66+
Your program should only accept inputs that follow this format.

0 commit comments

Comments
 (0)