![]() Takes input as two integers with currying syntax (h)(m) h=>m=>console.log(`IT IS HALF TEN If strtr´s second parameter is no string, it will be interpreted as an ascii code.Thanks for golfing along with his excellent findings!Īt least 45 bytes are on his account 16 or more inspired by him.Ī Marvel Team Up! IT IS $w^$w^" ". Last, for anyone who wants to confirm this byte count, the only two byte token is sub(. Note 2: This prints the input just fine, but for asethetic reasons you probably want Pause at the end of the program to avoid the Done message upon program termination.Įdit: Byte count lowered because tokenized (see note on previous revision), also a bug is fixed thanks to Third, fixed a bug I found myself which would have costed 2 bytes but the optimization actually saved 1 byte overall, and I also realized that I am getting input so I don't need to call getTime (duh?). And no, in this case int( could not be interchanged with iPart(. Note 1: For TI-84+ you can replace Input with something like getTime:Ans(1->X:getTime:Ans(2->Y. Output(int(4+Ans),20fPart(Ans),sub("ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE TEN ELEVENTWELVE",6A-5,6 ![]() ![]() So make X be hours (anything >=0 will work correctly) and have Y be minutes. With no arguments, Input gets input by default into X and Y, similar to Prompt X,Y. Date is taken as input in order to support calcs earlier than TI-84, which do not have internal clocks. Pretty much perfect, since the TI-84 calcs have 8x16 letter displays, and this is 8x15. Output: (O'CLOCK and a lot of empty lines) Output: (do not use the TEN or FIVE on the first line when referring to the hours) ![]() Test cases Input: (the current local time is 19:20) In the measure of possible, please provide a link to an online interpreter of your language.This is code-golf so the shortest code wins!.The result may be either all uppercase or all lowercase, not a mix of both. If your language doesn't support printing in any way, it is allowed to simply "return" the expected text. If your language supports printing in any way, it must print the result (in a file, on the standard output, I don't mind).Your code may be a program, a function, a lambda but not snippet.If you support both, that's better but there's no bonus ) If you support no input, then you must use the current time. ), but no parameters are allowed if they're not related to the time to print. If you accept an input, the input will be the time to print in any valid format you want (string, list of integers, native time type your language support. Example: IT IS TENĭo not light up TEN on the first line or FIVE on the third line when these values refer to the hours. Relevant empty lines are still required to appear. Spaces relevant to keeping the text at the expected position must be kept. All irrelevant words are replaced by as many spaces as needed to keep the text where it is located in the template above.The word MINUTES must appear if FIVE, TEN or TWENTY are lit up in the minutes section (before "TO" or "PAST"). ![]() So if XX is a multiple of five, XX will be used from HH:(XX-2):00 until HH:(XX+2):59. So, for example, even though 17:52:38 really is closest to 17:55, but since the seconds are irrelevant, 17:52 is actually rounded down to 17:50, and the text printed is "IT IS TEN MINUTES TO SIX" (with relevant spacing). The rounding is done to the closest multiple of 5.
0 Comments
Leave a Reply. |