8
1
It turns out that my toaster is a tad broken. It lost WiFi (You know, it's one of those newfangled smart toasters), and its been going bonkers! Since it no longer works, I've been having to hack into my breakfast's source code and run Plate.bread.toastAs(3);
every morning. Will you help?
My toaster takes one input: the amount of time you want to toast your bread. This is written as min:sec
, such as 5:45
or 0:40
(Up to 59:59
). It then returns a specific value for different levels of toastiness:
0:00-0:30 = Bread
0:31-1:00 = Warm Bread
1:01-2:00 = Toasty
2:01-3:30 = Burnt
3:31 and up = Brûlée (or Brulee)
But here's the catch: my toaster has a broken keyboard! Your code can't contain any semicolons or...colons. This might be harder than the toaster repairman said it would be...
Here are some test cases, so you can...test your cases?
0:00 = Bread
5:50 = Brulee or Brûlée
2:00 = Toasty
ChicknMcNuggets = Anything
-1:00 = Anything
0:60 = Anything
1 = Anything
60:00 = Anything
1:00:00 = Anything
Standard Loopholes are prohibited
All Acceptable Forms of Input/Output are accepted
My Toaster's new code cannot contain a semicolon (;) or colon (:)
This is code-golf, so the shortest answer (in each language) wins!
Is the time at most
59:59
? – xnor – 2018-11-03T02:47:22.400Oh, yes. Forgot to mention that! – Redwolf Programs – 2018-11-03T02:48:08.897
5Shouldn't it be
3:31 and up: Brulee
? – Mego – 2018-11-03T04:17:20.9503Where are all the golfing languages where colons wouldn't be used anyway? – Jo King – 2018-11-03T06:13:04.050
So how to test the cases? – l4m2 – 2018-11-03T11:30:37.287
1I have't realized until now why there aren't any Python submissions... – Redwolf Programs – 2018-11-03T13:43:42.513
1Can we take in input with a leading zero so that all inputs are 5 characters long? – Quintec – 2018-11-03T16:58:32.427
@Quintec Hmm...no, it should work with
11:05
or1:05
. Sorry. – Redwolf Programs – 2018-11-03T20:01:02.553I meant like 01:05 and 11:05 instead of 1:05- just to clarify, that’s a no, right – Quintec – 2018-11-03T20:49:59.513
@Quintec Yes, since it would make the code much shorter and pose a disadvantage to those which have already been submitted (Not to mention the fact that it would no longer be a big deal that there can be no colons). – Redwolf Programs – 2018-11-03T20:51:48.203
@RedwolfPrograms "I have't realized until now why there aren't any Python submissions...". Why? :-) – ElPedro – 2018-11-04T18:47:02.317
@ElPedro Colons – Redwolf Programs – 2018-11-04T18:48:42.517
@RedwolfPrograms. I know and that's why I put the smile on the end of my comment. It took me a while to work out how to avoid colons. For me that was what was the most interesting part about what what a good challenge anyway :) – ElPedro – 2018-11-04T18:55:55.753
Is the input suggested in this comment acceptable? The input is literally
– Giuseppe – 2018-11-08T23:07:36.1236:00
but that is evaluated by R to the vector[6, 5, 4, 3, 2, 1, 0]
.