-
-
Notifications
You must be signed in to change notification settings - Fork 550
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add swift-scheduling
exercise
#2536
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only reviewed docs
Co-authored-by: Anastasios Chatzialexiou <[email protected]>
Co-authored-by: Anastasios Chatzialexiou <[email protected]>
Co-authored-by: Anastasios Chatzialexiou <[email protected]>
Co-authored-by: Anastasios Chatzialexiou <[email protected]>
Co-authored-by: Anastasios Chatzialexiou <[email protected]>
Co-authored-by: Anastasios Chatzialexiou <[email protected]>
"meetingStart": "2023-04-19T00:00:00", | ||
"description": "Q4" | ||
}, | ||
"expected": "2023-12-29T08:00:00" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about a test case that wraps around to the next year?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that idea. I think it makes the most sense to have that as part of the ASAP tests. I'll add it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second hand, the quarters suggestion is good! I've updated the description, I'll add the test cases later. Could you check if the description makes sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added test cases too
I don't know if anyone has time for it, but it would be great if someone could build an implementation to verify the test cases are correct. |
It'll take me a bit - but I can take a stab at doing one for Python. |
| `"NOW"` | - | Two hours after the meeting started | | ||
| `"ASAP"` | Before 12:00 | Today at 17:00 | | ||
| `"ASAP"` | After 12:00 | Tomorrow at 12:00 | | ||
| `"EOW"` | Monday, Tuesday, or Wednesday | Friday at 5:00 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5am or 5pm?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests say 17:00
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
"meetingStart": "2001-04-09T09:00:00", | ||
"description": "Q4" | ||
}, | ||
"expected": "2001-12-28T08:00:00" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My implementation says 2001-12-31 is the last workday of this quarter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, fixed
https://gist.github.com/IsaacG/08211c0b4769419e297f3b898a07d6dc |
I've updated! |
| `"ASAP"` | Before 12:00 | Today at 17:00 | | ||
| `"ASAP"` | After 12:00 | Tomorrow at 12:00 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think people might complain that it's unclear how to categorize exactly 12:00
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair point! I'll update to a less ambiguous time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant that between the two categories "Before 12:00" and "After 12:00", the time "exactly at 12:00" isn't contained in either of them 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! I also think that 12:00 might be ambiguous between AM and PM. I'll tweak it a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated
I implemented the exercise in Elixir: https://github.com/exercism/elixir/pull/1551/files#diff-a0012d9d95c9713c1480d9f5ae9408ade5ab4bd412a65f3d7b69ed5d880e298d All the tests made sense and I had a great time solving the exercise. I think students will be very happy to practice date times in a more advanced way ❤️ |
I think the data looks reasonable ;) |
I've updated noon (12:00) to 13:00 to reduce any possible confusion between AM and PM and I've made ASAP use before and after or at (which was previously unspecified). Maybe one final check? |
https://gist.github.com/IsaacG/e7e628532af521a505b3336ee0a09458 My updated solution seems to work fine with the test data. |
Just needs two approvals then 🙂 |
It would appear that it needs I might have the Python version return the delivery dates in a format different from the input ISO, in order to have a little practice with Also wondering if it would be rude to include leap year scenarios or not..... |
That sounds totally reasonable.
Not at all. I'll add such a test case. |
Apologies for the delay, @ErikSchierboom -- test case validated. 😄 |
No problem. Thanks for the validation |
This is a proposal to add new date-based exercise. The primary goal is to have more date-based exercises. This exercise requires students to convert strings to dates, and will need to add date arithmetic. I'm open to any improvements, so please consider this a starting point.
As a PoC, I've implemented it in C#: exercism/csharp#2397