|
1 | 1 | 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 |
3 | 3 | create a file with a table like this:
|
4 | 4 |
|
5 | 5 | ```
|
6 | 6 | Team | MP | W | D | L | P
|
7 | 7 | Devastating Donkeys | 3 | 2 | 1 | 0 | 7
|
8 |
| -Allegoric Alaskians | 3 | 2 | 0 | 1 | 6 |
| 8 | +Allegoric Alaskans | 3 | 2 | 0 | 1 | 6 |
9 | 9 | Blithering Badgers | 3 | 1 | 0 | 2 | 3
|
10 | 10 | Courageous Californians | 3 | 0 | 1 | 2 | 1
|
11 | 11 | ```
|
12 | 12 |
|
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