You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 05-bowling-scores/README.md
+35-2
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,11 @@ The league captain diligently tracked player scores each week in a mobile app on
6
6
7
7
However, three challenges exist:
8
8
9
-
1. The phone app is limited to exporting JSON data but the web application only supports importing CSV data.
9
+
1. The phone app is limited to exporting JSON data but the web application only supports importing CSV data, and organized differently (see below).
10
10
2. The JSON data uses bowling codes (e.g. `'X'` for denoting a strike) however the CVS import only supports numeric values.
11
11
3. The league captain doesn't quite trust the website operator and would like you to compute game scores and player season averages that she can verify the website against later.
12
12
13
-
## Some Tips on the Data
13
+
## Some Tips on the JSON Data
14
14
15
15
- A player game is represented as a list of 10 sublists:
16
16
- The 10 sublists represent the 10 frames of a bowling game.
@@ -22,6 +22,39 @@ However, three challenges exist:
22
22
-`'-'` is a miss of all pins (either roll)
23
23
- Each player bowled 3 games per week played. If a member didn't play a particular night, all game data for that night is replaced by the string `"absent"`. The JSON data reflects these weekly groups of three games, however that grouping structure is not needed for the CSV import.
24
24
25
+
## Expected CSV Data
26
+
27
+
The CSV importer is finicky and requires the CSV data conform to a particular structure to be processed:
28
+
29
+
Each player game is represented as a line in the CSV, split into 22-23 cells:
30
+
31
+
- 1 cell for the player name
32
+
- 18 cells for the first 9 frames, with a cell for each of the 2 rolls per frame
33
+
- 3 cells for the 10th frame with a possible 3 rolls
34
+
- 1 cell for the game score (optional)
35
+
36
+
Cells where a roll is not normally taken should be left blank (e.g. the second roll of a frame after a **strike**).
37
+
38
+
Rows should be grouped by weekly game instead of by player as they are in the JSON data.
39
+
40
+
Each new week group should have a header row with the text `"# Week nn"` where _nn_ is the week number starting from a count of `1`.
41
+
42
+
Blank rows are ignored by the CSV importer and are safe to use to separate weekly data.
0 commit comments