Closed Tsovak closed 10 months ago
Hi! Thanks for the feedback!
I don't really understand your idea.
Implementation with if-else
is the correct solution. But not the only one. There can be many correct solutions. But to the user when viewing the "correct solution" is displayed solution with if-else
.
Your solution using match
is almost correct too. The test fails because the interval 0...=22
includes 22
, and the task expects strictly less (...before 10PM
).
Tests do not check the code match, but how the program works. So it doesn't matter how exactly the user solved the task.
And as a "correct answer" that the user can look up, it is enough to specify one of them (it doesn't affect the check). The authors of the course chose the if-else
Does it become clearer after my answer? Is this issue still relevant?
yes, it does
the task Common Collections / Options / Use Option description:
The suggestion is to have 2 different functions with match and the current implementation. Does it make sense?
the current implementation is:
one more implementation is: