From 9ed28a943a63e325f3107d184fc2cd6dfdbd49ea Mon Sep 17 00:00:00 2001 From: Peter Tseng Date: Fri, 14 Jan 2022 15:01:41 +0000 Subject: [PATCH 1/4] meetup: improve descriptions by saying why each case is tested descriptions show whether a date is the first, last, or an arbitrary middle date of the week. This helps understand why certain cases are selected. Closes https://github.com/exercism/problem-specifications/issues/974 --- exercises/meetup/canonical-data.json | 190 +++++++++++++-------------- 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/exercises/meetup/canonical-data.json b/exercises/meetup/canonical-data.json index 8f3c1cd86b..f051fe1a4e 100644 --- a/exercises/meetup/canonical-data.json +++ b/exercises/meetup/canonical-data.json @@ -3,7 +3,7 @@ "cases": [ { "uuid": "d7f8eadd-d4fc-46ee-8a20-e97bd3fd01c8", - "description": "monteenth of May 2013", + "description": "when teenth Monday is the 13th, the first day of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -15,7 +15,7 @@ }, { "uuid": "f78373d1-cd53-4a7f-9d37-e15bf8a456b4", - "description": "monteenth of August 2013", + "description": "when teenth Monday is the 19th, the last day of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -27,7 +27,7 @@ }, { "uuid": "8c78bea7-a116-425b-9c6b-c9898266d92a", - "description": "monteenth of September 2013", + "description": "when teenth Monday is some day in the middle of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -39,7 +39,7 @@ }, { "uuid": "cfef881b-9dc9-4d0b-8de4-82d0f39fc271", - "description": "tuesteenth of March 2013", + "description": "when teenth Tuesday is the 19th, the last day of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -51,7 +51,7 @@ }, { "uuid": "69048961-3b00-41f9-97ee-eb6d83a8e92b", - "description": "tuesteenth of April 2013", + "description": "when teenth Tuesday is some day in the middle of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -63,7 +63,7 @@ }, { "uuid": "d30bade8-3622-466a-b7be-587414e0caa6", - "description": "tuesteenth of August 2013", + "description": "when teenth Tuesday is the 13th, the first day of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -75,7 +75,7 @@ }, { "uuid": "8db4b58b-92f3-4687-867b-82ee1a04f851", - "description": "wednesteenth of January 2013", + "description": "when teenth Wednesday is some day in the middle of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -87,7 +87,7 @@ }, { "uuid": "6c27a2a2-28f8-487f-ae81-35d08c4664f7", - "description": "wednesteenth of February 2013", + "description": "when teenth Wednesday is the 13th, the first day of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -99,7 +99,7 @@ }, { "uuid": "008a8674-1958-45b5-b8e6-c2c9960d973a", - "description": "wednesteenth of June 2013", + "description": "when teenth Wednesday is the 19th, the last day of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -111,7 +111,7 @@ }, { "uuid": "e4abd5e3-57cb-4091-8420-d97e955c0dbd", - "description": "thursteenth of May 2013", + "description": "when teenth Thursday is some day in the middle of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -123,7 +123,7 @@ }, { "uuid": "85da0b0f-eace-4297-a6dd-63588d5055b4", - "description": "thursteenth of June 2013", + "description": "when teenth Thursday is the 13th, the first day of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -135,7 +135,7 @@ }, { "uuid": "ecf64f9b-8413-489b-bf6e-128045f70bcc", - "description": "thursteenth of September 2013", + "description": "when teenth Thursday is the 19th, the last day of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -147,7 +147,7 @@ }, { "uuid": "ac4e180c-7d0a-4d3d-b05f-f564ebb584ca", - "description": "friteenth of April 2013", + "description": "when teenth Friday is the 19th, the last day of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -159,7 +159,7 @@ }, { "uuid": "b79101c7-83ad-4f8f-8ec8-591683296315", - "description": "friteenth of August 2013", + "description": "when teenth Friday is some day in the middle of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -171,7 +171,7 @@ }, { "uuid": "6ed38b9f-0072-4901-bd97-7c8b8b0ef1b8", - "description": "friteenth of September 2013", + "description": "when teenth Friday is the 13th, the first day of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -183,7 +183,7 @@ }, { "uuid": "dfae03ed-9610-47de-a632-655ab01e1e7c", - "description": "saturteenth of February 2013", + "description": "when teenth Saturday is some day in the middle of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -195,7 +195,7 @@ }, { "uuid": "ec02e3e1-fc72-4a3c-872f-a53fa8ab358e", - "description": "saturteenth of April 2013", + "description": "when teenth Saturday is the 13th, the first day of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -207,7 +207,7 @@ }, { "uuid": "d983094b-7259-4195-b84e-5d09578c89d9", - "description": "saturteenth of October 2013", + "description": "when teenth Saturday is the 19th, the last day of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -219,7 +219,7 @@ }, { "uuid": "d84a2a2e-f745-443a-9368-30051be60c2e", - "description": "sunteenth of May 2013", + "description": "when teenth Sunday is the 19th, the last day of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -231,7 +231,7 @@ }, { "uuid": "0e64bc53-92a3-4f61-85b2-0b7168c7ce5a", - "description": "sunteenth of June 2013", + "description": "when teenth Sunday is some day in the middle of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -243,7 +243,7 @@ }, { "uuid": "de87652c-185e-4854-b3ae-04cf6150eead", - "description": "sunteenth of October 2013", + "description": "when teenth Sunday is the 13th, the first day of the teenth week", "property": "meetup", "input": { "year": 2013, @@ -255,7 +255,7 @@ }, { "uuid": "2cbfd0f5-ba3a-46da-a8cc-0fe4966d3411", - "description": "first Monday of March 2013", + "description": "when first Monday is some day in the middle of the first week", "property": "meetup", "input": { "year": 2013, @@ -267,7 +267,7 @@ }, { "uuid": "a6168c7c-ed95-4bb3-8f92-c72575fc64b0", - "description": "first Monday of April 2013", + "description": "when first Monday is the 1st, the first day of the first week", "property": "meetup", "input": { "year": 2013, @@ -279,7 +279,7 @@ }, { "uuid": "1bfc620f-1c54-4bbd-931f-4a1cd1036c20", - "description": "first Tuesday of May 2013", + "description": "when first Tuesday is the 7th, the last day of the first week", "property": "meetup", "input": { "year": 2013, @@ -291,7 +291,7 @@ }, { "uuid": "12959c10-7362-4ca0-a048-50cf1c06e3e2", - "description": "first Tuesday of June 2013", + "description": "when first Tuesday is some day in the middle of the first week", "property": "meetup", "input": { "year": 2013, @@ -303,7 +303,7 @@ }, { "uuid": "1033dc66-8d0b-48a1-90cb-270703d59d1d", - "description": "first Wednesday of July 2013", + "description": "when first Wednesday is some day in the middle of the first week", "property": "meetup", "input": { "year": 2013, @@ -315,7 +315,7 @@ }, { "uuid": "b89185b9-2f32-46f4-a602-de20b09058f6", - "description": "first Wednesday of August 2013", + "description": "when first Wednesday is the 7th, the last day of the first week", "property": "meetup", "input": { "year": 2013, @@ -327,7 +327,7 @@ }, { "uuid": "53aedc4d-b2c8-4dfb-abf7-a8dc9cdceed5", - "description": "first Thursday of September 2013", + "description": "when first Thursday is some day in the middle of the first week", "property": "meetup", "input": { "year": 2013, @@ -339,7 +339,7 @@ }, { "uuid": "b420a7e3-a94c-4226-870a-9eb3a92647f0", - "description": "first Thursday of October 2013", + "description": "when first Thursday is another day in the middle of the first week", "property": "meetup", "input": { "year": 2013, @@ -351,7 +351,7 @@ }, { "uuid": "61df3270-28b4-4713-bee2-566fa27302ca", - "description": "first Friday of November 2013", + "description": "when first Friday is the 1st, the first day of the first week", "property": "meetup", "input": { "year": 2013, @@ -363,7 +363,7 @@ }, { "uuid": "cad33d4d-595c-412f-85cf-3874c6e07abf", - "description": "first Friday of December 2013", + "description": "when first Friday is some day in the middle of the first week", "property": "meetup", "input": { "year": 2013, @@ -375,7 +375,7 @@ }, { "uuid": "a2869b52-5bba-44f0-a863-07bd1f67eadb", - "description": "first Saturday of January 2013", + "description": "when first Saturday is some day in the middle of the first week", "property": "meetup", "input": { "year": 2013, @@ -387,7 +387,7 @@ }, { "uuid": "3585315a-d0db-4ea1-822e-0f22e2a645f5", - "description": "first Saturday of February 2013", + "description": "when first Saturday is another day in the middle of the first week", "property": "meetup", "input": { "year": 2013, @@ -399,7 +399,7 @@ }, { "uuid": "c49e9bd9-8ccf-4cf2-947a-0ccd4e4f10b1", - "description": "first Sunday of March 2013", + "description": "when first Sunday is some day in the middle of the first week", "property": "meetup", "input": { "year": 2013, @@ -411,7 +411,7 @@ }, { "uuid": "1513328b-df53-4714-8677-df68c4f9366c", - "description": "first Sunday of April 2013", + "description": "when first Sunday is the 7th, the last day of the first week", "property": "meetup", "input": { "year": 2013, @@ -423,7 +423,7 @@ }, { "uuid": "49e083af-47ec-4018-b807-62ef411efed7", - "description": "second Monday of March 2013", + "description": "when second Monday is some day in the middle of the second week", "property": "meetup", "input": { "year": 2013, @@ -435,7 +435,7 @@ }, { "uuid": "6cb79a73-38fe-4475-9101-9eec36cf79e5", - "description": "second Monday of April 2013", + "description": "when second Monday is the 8th, the first day of the second week", "property": "meetup", "input": { "year": 2013, @@ -447,7 +447,7 @@ }, { "uuid": "4c39b594-af7e-4445-aa03-bf4f8effd9a1", - "description": "second Tuesday of May 2013", + "description": "when second Tuesday is the 14th, the last day of the second week", "property": "meetup", "input": { "year": 2013, @@ -459,7 +459,7 @@ }, { "uuid": "41b32c34-2e39-40e3-b790-93539aaeb6dd", - "description": "second Tuesday of June 2013", + "description": "when second Tuesday is some day in the middle of the second week", "property": "meetup", "input": { "year": 2013, @@ -471,7 +471,7 @@ }, { "uuid": "90a160c5-b5d9-4831-927f-63a78b17843d", - "description": "second Wednesday of July 2013", + "description": "when second Wednesday is some day in the middle of the second week", "property": "meetup", "input": { "year": 2013, @@ -483,7 +483,7 @@ }, { "uuid": "23b98ce7-8dd5-41a1-9310-ef27209741cb", - "description": "second Wednesday of August 2013", + "description": "when second Wednesday is the 14th, the last day of the second week", "property": "meetup", "input": { "year": 2013, @@ -495,7 +495,7 @@ }, { "uuid": "447f1960-27ca-4729-bc3f-f36043f43ed0", - "description": "second Thursday of September 2013", + "description": "when second Thursday is some day in the middle of the second week", "property": "meetup", "input": { "year": 2013, @@ -507,7 +507,7 @@ }, { "uuid": "c9aa2687-300c-4e79-86ca-077849a81bde", - "description": "second Thursday of October 2013", + "description": "when second Thursday is another day in the middle of the second week", "property": "meetup", "input": { "year": 2013, @@ -519,7 +519,7 @@ }, { "uuid": "a7e11ef3-6625-4134-acda-3e7195421c09", - "description": "second Friday of November 2013", + "description": "when second Friday is the 8th, the first day of the second week", "property": "meetup", "input": { "year": 2013, @@ -531,7 +531,7 @@ }, { "uuid": "8b420e5f-9290-4106-b5ae-022f3e2a3e41", - "description": "second Friday of December 2013", + "description": "when second Friday is some day in the middle of the second week", "property": "meetup", "input": { "year": 2013, @@ -543,7 +543,7 @@ }, { "uuid": "80631afc-fc11-4546-8b5f-c12aaeb72b4f", - "description": "second Saturday of January 2013", + "description": "when second Saturday is some day in the middle of the second week", "property": "meetup", "input": { "year": 2013, @@ -555,7 +555,7 @@ }, { "uuid": "e34d43ac-f470-44c2-aa5f-e97b78ecaf83", - "description": "second Saturday of February 2013", + "description": "when second Saturday is another day in the middle of the second week", "property": "meetup", "input": { "year": 2013, @@ -567,7 +567,7 @@ }, { "uuid": "a57d59fd-1023-47ad-b0df-a6feb21b44fc", - "description": "second Sunday of March 2013", + "description": "when second Sunday is some day in the middle of the second week", "property": "meetup", "input": { "year": 2013, @@ -579,7 +579,7 @@ }, { "uuid": "a829a8b0-abdd-4ad1-b66c-5560d843c91a", - "description": "second Sunday of April 2013", + "description": "when second Sunday is the 14th, the last day of the second week", "property": "meetup", "input": { "year": 2013, @@ -591,7 +591,7 @@ }, { "uuid": "501a8a77-6038-4fc0-b74c-33634906c29d", - "description": "third Monday of March 2013", + "description": "when third Monday is some day in the middle of the third week", "property": "meetup", "input": { "year": 2013, @@ -603,7 +603,7 @@ }, { "uuid": "49e4516e-cf32-4a58-8bbc-494b7e851c92", - "description": "third Monday of April 2013", + "description": "when third Monday is the 15th, the first day of the third week", "property": "meetup", "input": { "year": 2013, @@ -615,7 +615,7 @@ }, { "uuid": "4db61095-f7c7-493c-85f1-9996ad3012c7", - "description": "third Tuesday of May 2013", + "description": "when third Tuesday is the 21st, the last day of the third week", "property": "meetup", "input": { "year": 2013, @@ -627,7 +627,7 @@ }, { "uuid": "714fc2e3-58d0-4b91-90fd-61eefd2892c0", - "description": "third Tuesday of June 2013", + "description": "when third Tuesday is some day in the middle of the third week", "property": "meetup", "input": { "year": 2013, @@ -639,7 +639,7 @@ }, { "uuid": "b08a051a-2c80-445b-9b0e-524171a166d1", - "description": "third Wednesday of July 2013", + "description": "when third Wednesday is some day in the middle of the third week", "property": "meetup", "input": { "year": 2013, @@ -651,7 +651,7 @@ }, { "uuid": "80bb9eff-3905-4c61-8dc9-bb03016d8ff8", - "description": "third Wednesday of August 2013", + "description": "when third Wednesday is the 21st, the last day of the third week", "property": "meetup", "input": { "year": 2013, @@ -663,7 +663,7 @@ }, { "uuid": "fa52a299-f77f-4784-b290-ba9189fbd9c9", - "description": "third Thursday of September 2013", + "description": "when third Thursday is some day in the middle of the third week", "property": "meetup", "input": { "year": 2013, @@ -675,7 +675,7 @@ }, { "uuid": "f74b1bc6-cc5c-4bf1-ba69-c554a969eb38", - "description": "third Thursday of October 2013", + "description": "when third Thursday is another day in the middle of the third week", "property": "meetup", "input": { "year": 2013, @@ -687,7 +687,7 @@ }, { "uuid": "8900f3b0-801a-466b-a866-f42d64667abd", - "description": "third Friday of November 2013", + "description": "when third Friday is the 15th, the first day of the third week", "property": "meetup", "input": { "year": 2013, @@ -699,7 +699,7 @@ }, { "uuid": "538ac405-a091-4314-9ccd-920c4e38e85e", - "description": "third Friday of December 2013", + "description": "when third Friday is some day in the middle of the third week", "property": "meetup", "input": { "year": 2013, @@ -711,7 +711,7 @@ }, { "uuid": "244db35c-2716-4fa0-88ce-afd58e5cf910", - "description": "third Saturday of January 2013", + "description": "when third Saturday is some day in the middle of the third week", "property": "meetup", "input": { "year": 2013, @@ -723,7 +723,7 @@ }, { "uuid": "dd28544f-f8fa-4f06-9bcd-0ad46ce68e9e", - "description": "third Saturday of February 2013", + "description": "when third Saturday is another day in the middle of the third week", "property": "meetup", "input": { "year": 2013, @@ -735,7 +735,7 @@ }, { "uuid": "be71dcc6-00d2-4b53-a369-cbfae55b312f", - "description": "third Sunday of March 2013", + "description": "when third Sunday is some day in the middle of the third week", "property": "meetup", "input": { "year": 2013, @@ -747,7 +747,7 @@ }, { "uuid": "b7d2da84-4290-4ee6-a618-ee124ae78be7", - "description": "third Sunday of April 2013", + "description": "when third Sunday is the 21st, the last day of the third week", "property": "meetup", "input": { "year": 2013, @@ -759,7 +759,7 @@ }, { "uuid": "4276dc06-a1bd-4fc2-b6c2-625fee90bc88", - "description": "fourth Monday of March 2013", + "description": "when fourth Monday is some day in the middle of the fourth week", "property": "meetup", "input": { "year": 2013, @@ -771,7 +771,7 @@ }, { "uuid": "ddbd7976-2deb-4250-8a38-925ac1a8e9a2", - "description": "fourth Monday of April 2013", + "description": "when fourth Monday is the 22nd, the first day of the fourth week", "property": "meetup", "input": { "year": 2013, @@ -783,7 +783,7 @@ }, { "uuid": "eb714ef4-1656-47cc-913c-844dba4ebddd", - "description": "fourth Tuesday of May 2013", + "description": "when fourth Tuesday is the 28th, the last day of the fourth week", "property": "meetup", "input": { "year": 2013, @@ -795,7 +795,7 @@ }, { "uuid": "16648435-7937-4d2d-b118-c3e38fd084bd", - "description": "fourth Tuesday of June 2013", + "description": "when fourth Tuesday is some day in the middle of the fourth week", "property": "meetup", "input": { "year": 2013, @@ -807,7 +807,7 @@ }, { "uuid": "de062bdc-9484-437a-a8c5-5253c6f6785a", - "description": "fourth Wednesday of July 2013", + "description": "when fourth Wednesday is some day in the middle of the fourth week", "property": "meetup", "input": { "year": 2013, @@ -819,7 +819,7 @@ }, { "uuid": "c2ce6821-169c-4832-8d37-690ef5d9514a", - "description": "fourth Wednesday of August 2013", + "description": "when fourth Wednesday is the 28th, the last day of the fourth week", "property": "meetup", "input": { "year": 2013, @@ -831,7 +831,7 @@ }, { "uuid": "d462c631-2894-4391-a8e3-dbb98b7a7303", - "description": "fourth Thursday of September 2013", + "description": "when fourth Thursday is some day in the middle of the fourth week", "property": "meetup", "input": { "year": 2013, @@ -843,7 +843,7 @@ }, { "uuid": "9ff1f7b6-1b72-427d-9ee9-82b5bb08b835", - "description": "fourth Thursday of October 2013", + "description": "when fourth Thursday is another day in the middle of the fourth week", "property": "meetup", "input": { "year": 2013, @@ -855,7 +855,7 @@ }, { "uuid": "83bae8ba-1c49-49bc-b632-b7c7e1d7e35f", - "description": "fourth Friday of November 2013", + "description": "when fourth Friday is the 22nd, the first day of the fourth week", "property": "meetup", "input": { "year": 2013, @@ -867,7 +867,7 @@ }, { "uuid": "de752d2a-a95e-48d2-835b-93363dac3710", - "description": "fourth Friday of December 2013", + "description": "when fourth Friday is some day in the middle of the fourth week", "property": "meetup", "input": { "year": 2013, @@ -879,7 +879,7 @@ }, { "uuid": "eedd90ad-d581-45db-8312-4c6dcf9cf560", - "description": "fourth Saturday of January 2013", + "description": "when fourth Saturday is some day in the middle of the fourth week", "property": "meetup", "input": { "year": 2013, @@ -891,7 +891,7 @@ }, { "uuid": "669fedcd-912e-48c7-a0a1-228b34af91d0", - "description": "fourth Saturday of February 2013", + "description": "when fourth Saturday is another day in the middle of the fourth week", "property": "meetup", "input": { "year": 2013, @@ -903,7 +903,7 @@ }, { "uuid": "648e3849-ea49-44a5-a8a3-9f2a43b3bf1b", - "description": "fourth Sunday of March 2013", + "description": "when fourth Sunday is some day in the middle of the fourth week", "property": "meetup", "input": { "year": 2013, @@ -915,7 +915,7 @@ }, { "uuid": "f81321b3-99ab-4db6-9267-69c5da5a7823", - "description": "fourth Sunday of April 2013", + "description": "when fourth Sunday is the 28th, the last day of the fourth week", "property": "meetup", "input": { "year": 2013, @@ -927,7 +927,7 @@ }, { "uuid": "1af5e51f-5488-4548-aee8-11d7d4a730dc", - "description": "last Monday of March 2013", + "description": "last Monday in a month with four Mondays", "property": "meetup", "input": { "year": 2013, @@ -939,7 +939,7 @@ }, { "uuid": "f29999f2-235e-4ec7-9dab-26f137146526", - "description": "last Monday of April 2013", + "description": "last Monday in a month with five Mondays", "property": "meetup", "input": { "year": 2013, @@ -951,7 +951,7 @@ }, { "uuid": "31b097a0-508e-48ac-bf8a-f63cdcf6dc41", - "description": "last Tuesday of May 2013", + "description": "last Tuesday in a month with four Tuesdays", "property": "meetup", "input": { "year": 2013, @@ -963,7 +963,7 @@ }, { "uuid": "8c022150-0bb5-4a1f-80f9-88b2e2abcba4", - "description": "last Tuesday of June 2013", + "description": "last Tuesday in another month with four Tuesdays", "property": "meetup", "input": { "year": 2013, @@ -975,7 +975,7 @@ }, { "uuid": "0e762194-672a-4bdf-8a37-1e59fdacef12", - "description": "last Wednesday of July 2013", + "description": "last Wednesday in a month with five Wednesdays", "property": "meetup", "input": { "year": 2013, @@ -987,7 +987,7 @@ }, { "uuid": "5016386a-f24e-4bd7-b439-95358f491b66", - "description": "last Wednesday of August 2013", + "description": "last Wednesday in a month with four Wednesdays", "property": "meetup", "input": { "year": 2013, @@ -999,7 +999,7 @@ }, { "uuid": "12ead1a5-cdf9-4192-9a56-2229e93dd149", - "description": "last Thursday of September 2013", + "description": "last Thursday in a month with four Thursdays", "property": "meetup", "input": { "year": 2013, @@ -1011,7 +1011,7 @@ }, { "uuid": "7db89e11-7fbe-4e57-ae3c-0f327fbd7cc7", - "description": "last Thursday of October 2013", + "description": "last Thursday in a month with five Thursdays", "property": "meetup", "input": { "year": 2013, @@ -1023,7 +1023,7 @@ }, { "uuid": "e47a739e-b979-460d-9c8a-75c35ca2290b", - "description": "last Friday of November 2013", + "description": "last Friday in a month with five Fridays", "property": "meetup", "input": { "year": 2013, @@ -1035,7 +1035,7 @@ }, { "uuid": "5bed5aa9-a57a-4e5d-8997-2cc796a5b0ec", - "description": "last Friday of December 2013", + "description": "last Friday in a month with four Fridays", "property": "meetup", "input": { "year": 2013, @@ -1047,7 +1047,7 @@ }, { "uuid": "61e54cba-76f3-4772-a2b1-bf443fda2137", - "description": "last Saturday of January 2013", + "description": "last Saturday in a month with four Saturdays", "property": "meetup", "input": { "year": 2013, @@ -1059,7 +1059,7 @@ }, { "uuid": "8b6a737b-2fa9-444c-b1a2-80ce7a2ec72f", - "description": "last Saturday of February 2013", + "description": "last Saturday in another month with four Saturdays", "property": "meetup", "input": { "year": 2013, @@ -1071,7 +1071,7 @@ }, { "uuid": "0b63e682-f429-4d19-9809-4a45bd0242dc", - "description": "last Sunday of March 2013", + "description": "last Sunday in a month with five Sundays", "property": "meetup", "input": { "year": 2013, @@ -1083,7 +1083,7 @@ }, { "uuid": "5232307e-d3e3-4afc-8ba6-4084ad987c00", - "description": "last Sunday of April 2013", + "description": "last Sunday in a month with four Sundays", "property": "meetup", "input": { "year": 2013, @@ -1095,7 +1095,7 @@ }, { "uuid": "0bbd48e8-9773-4e81-8e71-b9a51711e3c5", - "description": "last Wednesday of February 2012", + "description": "when last Wednesday in February in a leap year is the 29th", "property": "meetup", "input": { "year": 2012, @@ -1107,7 +1107,7 @@ }, { "uuid": "fe0936de-7eee-4a48-88dd-66c07ab1fefc", - "description": "last Wednesday of December 2014", + "description": "last Wednesday in December that also happens to be the last day of the year", "property": "meetup", "input": { "year": 2014, @@ -1119,7 +1119,7 @@ }, { "uuid": "2ccf2488-aafc-4671-a24e-2b6effe1b0e2", - "description": "last Sunday of February 2015", + "description": "when last Sunday in February in a non-leap year is not the 29th", "property": "meetup", "input": { "year": 2015, @@ -1131,7 +1131,7 @@ }, { "uuid": "00c3ce9f-cf36-4b70-90d8-92b32be6830e", - "description": "first Friday of December 2012", + "description": "when first Friday is the 7th, the last day of the first week", "property": "meetup", "input": { "year": 2012, From 848ca1fefa70bb25bbfdbc1e34ee66970277d7f6 Mon Sep 17 00:00:00 2001 From: Peter Tseng Date: Fri, 14 Jan 2022 15:05:02 +0000 Subject: [PATCH 2/4] meetup: add code to write new descriptions This helps understand the logic used to write the new descriptions. --- exercises/meetup/newdesc.rb | 69 +++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 exercises/meetup/newdesc.rb diff --git a/exercises/meetup/newdesc.rb b/exercises/meetup/newdesc.rb new file mode 100644 index 0000000000..01d4259622 --- /dev/null +++ b/exercises/meetup/newdesc.rb @@ -0,0 +1,69 @@ +require 'json' + +j = JSON.parse(File.read(File.join(__dir__, 'canonical-data.json'))) + +def ord(n) + case n + when 1; '1st' + when 2; '2nd' + when 3; '3rd' + when 21; '21st' + when 22; '22nd' + when 23; '23rd' + when 31; '31st' + else "#{n}th" + end +end + +def mod_desc_for_range(c, week, first, last) + raise "bad #{c['input']['week']} != #{week}" if c['input']['week'] != week + + if c['expected'].end_with?('-%02d' % first) + c['description'] = "when #{week} #{c['input']['dayofweek']} is the #{ord(first)}, the first day of the #{week} week" + elsif c['expected'].end_with?('-%02d' % last) + c['description'] = "when #{week} #{c['input']['dayofweek']} is the #{ord(last)}, the last day of the #{week} week" + else + c['description'] = "when #{week} #{c['input']['dayofweek']} is some day in the middle of the #{week} week" + end +end + +j['cases'].each { |c| + case c['input']['week'] + when 'teenth'; mod_desc_for_range(c, 'teenth', 13, 19) + when 'first'; mod_desc_for_range(c, 'first', 1, 7) + when 'second'; mod_desc_for_range(c, 'second', 8, 14) + when 'third'; mod_desc_for_range(c, 'third', 15, 21) + when 'fourth'; mod_desc_for_range(c, 'fourth', 22, 28) + when 'last' + month = Integer(c['expected'].split(?-, 3)[1], 10) + day = Integer(c['expected'].split(?-, 3)[2], 10) + dow = c['input']['dayofweek'] + if month == 2 && day == 29 + c['description'] = "when last #{dow} in February in a leap year is the 29th" + elsif month == 2 && day == 22 + c['description'] = "when last #{dow} in February in a non-leap year is not the 29th" + elsif month == 12 && day == 31 + c['description'] = "last #{dow} in December that also happens to be the last day of the year" + else + c['description'] = "last #{dow} in a month with #{day > 28 ? 'five' : 'four'} #{dow}s" + end + else + $stderr.puts("no new description for #{c['description']}") + end +} + +seen = {} +# dedup by notating some cases with "another" +j['cases'].each { |c| + desc = c['description'] + if seen[desc] + new_desc = desc.include?('some day') ? desc.sub('some day', 'another day') : desc.sub('a month with', 'another month with') + raise "couldn't fix #{desc}" if new_desc == desc + raise "tried to fix #{desc} but even #{new_desc} was already seen" if seen[new_desc] + seen[new_desc] = true + c['description'] = new_desc + end + seen[desc] = true +} + +puts JSON.pretty_generate(j) From 0e8f28e446c538a56a70b38297bd4ade6003b0e7 Mon Sep 17 00:00:00 2001 From: Peter Tseng Date: Sun, 6 Feb 2022 08:28:02 +0000 Subject: [PATCH 3/4] Revert "meetup: add code to write new descriptions" This reverts commit 848ca1fefa70bb25bbfdbc1e34ee66970277d7f6. There is no need to keep this code permanently; it is a one time run and once it is run it is done. --- exercises/meetup/newdesc.rb | 69 ------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 exercises/meetup/newdesc.rb diff --git a/exercises/meetup/newdesc.rb b/exercises/meetup/newdesc.rb deleted file mode 100644 index 01d4259622..0000000000 --- a/exercises/meetup/newdesc.rb +++ /dev/null @@ -1,69 +0,0 @@ -require 'json' - -j = JSON.parse(File.read(File.join(__dir__, 'canonical-data.json'))) - -def ord(n) - case n - when 1; '1st' - when 2; '2nd' - when 3; '3rd' - when 21; '21st' - when 22; '22nd' - when 23; '23rd' - when 31; '31st' - else "#{n}th" - end -end - -def mod_desc_for_range(c, week, first, last) - raise "bad #{c['input']['week']} != #{week}" if c['input']['week'] != week - - if c['expected'].end_with?('-%02d' % first) - c['description'] = "when #{week} #{c['input']['dayofweek']} is the #{ord(first)}, the first day of the #{week} week" - elsif c['expected'].end_with?('-%02d' % last) - c['description'] = "when #{week} #{c['input']['dayofweek']} is the #{ord(last)}, the last day of the #{week} week" - else - c['description'] = "when #{week} #{c['input']['dayofweek']} is some day in the middle of the #{week} week" - end -end - -j['cases'].each { |c| - case c['input']['week'] - when 'teenth'; mod_desc_for_range(c, 'teenth', 13, 19) - when 'first'; mod_desc_for_range(c, 'first', 1, 7) - when 'second'; mod_desc_for_range(c, 'second', 8, 14) - when 'third'; mod_desc_for_range(c, 'third', 15, 21) - when 'fourth'; mod_desc_for_range(c, 'fourth', 22, 28) - when 'last' - month = Integer(c['expected'].split(?-, 3)[1], 10) - day = Integer(c['expected'].split(?-, 3)[2], 10) - dow = c['input']['dayofweek'] - if month == 2 && day == 29 - c['description'] = "when last #{dow} in February in a leap year is the 29th" - elsif month == 2 && day == 22 - c['description'] = "when last #{dow} in February in a non-leap year is not the 29th" - elsif month == 12 && day == 31 - c['description'] = "last #{dow} in December that also happens to be the last day of the year" - else - c['description'] = "last #{dow} in a month with #{day > 28 ? 'five' : 'four'} #{dow}s" - end - else - $stderr.puts("no new description for #{c['description']}") - end -} - -seen = {} -# dedup by notating some cases with "another" -j['cases'].each { |c| - desc = c['description'] - if seen[desc] - new_desc = desc.include?('some day') ? desc.sub('some day', 'another day') : desc.sub('a month with', 'another month with') - raise "couldn't fix #{desc}" if new_desc == desc - raise "tried to fix #{desc} but even #{new_desc} was already seen" if seen[new_desc] - seen[new_desc] = true - c['description'] = new_desc - end - seen[desc] = true -} - -puts JSON.pretty_generate(j) From cf75f155066e810353c4e8e4a0ea3f7ffd824e5c Mon Sep 17 00:00:00 2001 From: Peter Tseng Date: Sun, 6 Feb 2022 11:17:30 +0000 Subject: [PATCH 4/4] meetup: "also happens to be" -> "is also" Co-authored-by: Victor Goff --- exercises/meetup/canonical-data.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exercises/meetup/canonical-data.json b/exercises/meetup/canonical-data.json index f051fe1a4e..0ae124b685 100644 --- a/exercises/meetup/canonical-data.json +++ b/exercises/meetup/canonical-data.json @@ -1107,7 +1107,7 @@ }, { "uuid": "fe0936de-7eee-4a48-88dd-66c07ab1fefc", - "description": "last Wednesday in December that also happens to be the last day of the year", + "description": "last Wednesday in December that is also the last day of the year", "property": "meetup", "input": { "year": 2014,