Skip to content

Commit c78f443

Browse files
ErikSchierboomglennj
authored andcommitted
Sync the meetup exercise's docs with the latest data. (exercism#353)
1 parent 93dae1e commit c78f443

File tree

2 files changed

+38
-26
lines changed

2 files changed

+38
-26
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,24 @@
11
# Instructions
22

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.
3+
Your task is to find the exact date of a meetup, given a month, year, weekday and week.
54

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.
5+
There are five week values to consider: `first`, `second`, `third`, `fourth`, `last`, `teenth`.
6+
7+
For example, you might be asked to find the date for the meetup on the first Monday in January 2018 (January 1, 2018).
98

109
Similarly, you might be asked to find:
1110

1211
- the third Tuesday of August 2019 (August 20, 2019)
1312
- the teenth Wednesday of May 2020 (May 13, 2020)
1413
- the fourth Sunday of July 2021 (July 25, 2021)
1514
- the last Thursday of November 2022 (November 24, 2022)
15+
- the teenth Saturday of August 1953 (August 15, 1953)
1616

17-
The descriptors you are expected to process are: `first`, `second`, `third`, `fourth`, `last`, `teenth`.
18-
19-
Note that descriptor `teenth` is a made-up word.
20-
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)
17+
## Teenth
3318

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.
19+
The teenth week refers to the seven days in a month that end in '-teenth' (13th, 14th, 15th, 16th, 17th, 18th and 19th).
3720

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:
21+
If asked to find the teenth Saturday of August, 1953, we check its calendar:
3922

4023
```plaintext
4124
August 1953
@@ -48,4 +31,4 @@ Su Mo Tu We Th Fr Sa
4831
30 31
4932
```
5033

51-
The Saturday that has a number ending in '-teen' is August 15, 1953.
34+
From this we find that the teenth Saturday is August 15, 1953.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Introduction
2+
3+
Every month, your partner meets up with their best friend.
4+
Both of them have very busy schedules, making it challenging to find a suitable date!
5+
Given your own busy schedule, your partner always double-checks potential meetup dates with you:
6+
7+
- "Can I meet up on the first Friday of next month?"
8+
- "What about the third Wednesday?"
9+
- "Maybe the last Sunday?"
10+
11+
In this month's call, your partner asked you this question:
12+
13+
- "I'd like to meet up on the teenth Thursday; is that okay?"
14+
15+
Confused, you ask what a "teenth" day is.
16+
Your partner explains that a teenth day, a concept they made up, refers to the days in a month that end in '-teenth':
17+
18+
- 13th (thirteenth)
19+
- 14th (fourteenth)
20+
- 15th (fifteenth)
21+
- 16th (sixteenth)
22+
- 17th (seventeenth)
23+
- 18th (eighteenth)
24+
- 19th (nineteenth)
25+
26+
As there are also seven weekdays, it is guaranteed that each day of the week has _exactly one_ teenth day each month.
27+
28+
Now that you understand the concept of a teenth day, you check your calendar.
29+
You don't have anything planned on the teenth Thursday, so you happily confirm the date with your partner.

0 commit comments

Comments
 (0)