Problem 784. Cody Computer Part 4 : Are you a morning Cody player Addicted ?
Solution Stats
Problem Comments
-
5 Comments
Aurelien, it might be nice if the assert had an error message (eg assert(isequal(y,y_correct),sprintf('%s','Time is ',datestr(now,'hh')))
So, does this only work if you are clicking 'Submit' between 7 and 9 EST?
Nope. Tried at 7:08 AM EST, and got it wrong. What time zone are we dealing with here?
Thanks Richard for the tip. I have now added the assert that you suiggested. In France it seems that you can solve it between 9 and 11 o'clock . I guess that these + 2 hours correspond to the difference with UTC (or GMT) .
That's why I used the NaN on my Prime Time problem that's similar to this one. isequal with NaN will return false. :-)
Solution Comments
-
2 Comments
I had to submit my solution at 4:30 am local time to be between 7 and 9...too sleepy to think about that :-)
Ok!! this IS an argument! ;-)
-
1 Comment
this can be toped! ;-)
-
3 Comments
At last, a bright side to having a screaming baby wake you up at an ungodly hour: An honest solution to a Cody problem. :-)
excellent!
hahahaha :-)
-
2 Comments
This one is correct anytime.
true! I won't change the test suite because your trick is really nice ;)
Problem Recent Solvers77
Suggested Problems
-
Check to see if a Sudoku Puzzle is Solved
302 Solvers
-
2348 Solvers
-
212 Solvers
-
Similar Triangles - find the height of the tree
231 Solvers
-
Check if number exists in vector
7359 Solvers
More from this Author30
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!