Skip to content

Commit 09f4760

Browse files
Clarify description of meetup (#2147)
* Clarify description of meetup There has been a lot of confusion around this exercise, especially for people who don't speak English as their native language. This attempts to explain very clearly where 'teenth' comes from, and how it pertains to recurring monthly meetup schedules. In doing this I have also made an executive decision to _not_ change the structure of the inputs (see #1069). This is because I don't believe that adding string parsing to get the pieces of the general description makes this exercise more interesting or fun. In order to keep the exercise focused on just the date munging, this instead changes the description to match more closely how the inputs are given. Closes #1786. Closes #1069. * Add specific dates to meetup examples Co-authored-by: Erik Schierboom <[email protected]> * Tweak meetup description for flow * Ensure consistent date format in meetup * Tweak description of meetup Co-authored-by: Erik Schierboom <[email protected]>
1 parent 8d3c0e2 commit 09f4760

File tree

1 file changed

+42
-10
lines changed

1 file changed

+42
-10
lines changed

exercises/meetup/description.md

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,51 @@
11
# Description
22

3-
In this exercise, you will be given a general description of a meetup date and then asked to find the actual meetup date.
3+
Recurring monthly meetups are generally scheduled on the given weekday of a given week each month.
4+
In this exercise you will be given the recurring schedule, along with a month and year, and then asked to find the exact date of the meetup.
45

5-
Examples of general descriptions are:
6+
For example a meetup might be scheduled on the _first Monday_ of every month.
7+
You might then be asked to find the date that this meetup will happen in January 2018.
8+
In other words, you need to determine the date of the first Monday of January 2018.
69

7-
- First Monday of January 2022
8-
- Third Tuesday of August 2021
9-
- Teenth Wednesday of May 2022
10-
- Teenth Sunday of July 2021
11-
- Last Thursday of November 2021
10+
Similarly, you might be asked to find:
11+
12+
- the third Tuesday of August 2019 (August 20, 2019)
13+
- the teenth Wednesday of May 2020 (May 13, 2020)
14+
- the fourth Sunday of July 2021 (July 25, 2021)
15+
- the last Thursday of November 2022 (November 24, 2022)
1216

1317
The descriptors you are expected to process are: `first`, `second`, `third`, `fourth`, `last`, `teenth`.
1418

1519
Note that descriptor `teenth` is a made-up word.
16-
There are exactly seven numbered days in a month that end with "teenth" ("thirteenth" to "nineteenth").
17-
Therefore, it is guaranteed that each day of the week (Monday, Tuesday, ...) will have exactly one numbered day ending with "teenth" each month.
1820

19-
For example, if given "First Monday of January 2022", the correct meetup date is January 3, 2022.
21+
It refers to the seven numbers that end in '-teen' in English: 13, 14, 15, 16, 17, 18, and 19.
22+
But general descriptions of dates use ordinal numbers, e.g. the _first_ Monday, the _third_ Tuesday.
23+
24+
For the numbers ending in '-teen', that becomes:
25+
26+
- 13th (thirteenth)
27+
- 14th (fourteenth)
28+
- 15th (fifteenth)
29+
- 16th (sixteenth)
30+
- 17th (seventeenth)
31+
- 18th (eighteenth)
32+
- 19th (nineteenth)
33+
34+
So there are seven numbers ending in '-teen'.
35+
And there are also seven weekdays (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday).
36+
Therefore, it is guaranteed that each day of the week (Monday, Tuesday, ...) will have exactly one numbered day ending with "teen" each month.
37+
38+
If asked to find the teenth Saturday of August, 1953 (or, alternately the "Saturteenth" of August, 1953), we need to look at the calendar for August 1953:
39+
40+
```plaintext
41+
August 1953
42+
Su Mo Tu We Th Fr Sa
43+
1
44+
2 3 4 5 6 7 8
45+
9 10 11 12 13 14 15
46+
16 17 18 19 20 21 22
47+
23 24 25 26 27 28 29
48+
30 31
49+
```
50+
51+
The Saturday that has a number ending in '-teen' is August 15, 1953.

0 commit comments

Comments
 (0)