Skip to main content

Timeline for Print rotation-safe numbers

Current License: CC BY-SA 3.0

19 events
when toggle format what by license comment
Jan 1, 2015 at 18:32 comment added zabalajka Got 1 more byte on the regex.
Jan 1, 2015 at 18:30 history edited zabalajka CC BY-SA 3.0
deleted 2 characters in body
Jan 1, 2015 at 17:49 comment added zabalajka I was able to do the conditions, the rest is more or less your work. 102 if I could get away without correctly handling input (OP's requirement "How the input is read is up to you." gives a bit of freedom I'd say).
Jan 1, 2015 at 17:45 history edited zabalajka CC BY-SA 3.0
deleted 1 character in body
Jan 1, 2015 at 17:37 history edited zabalajka CC BY-SA 3.0
deleted 25 characters in body
Jan 1, 2015 at 17:23 history edited ProgramFOX CC BY-SA 3.0
edited body
Jan 1, 2015 at 17:21 history edited zabalajka CC BY-SA 3.0
added 54 characters in body
Jan 1, 2015 at 15:09 comment added edc65 Have a look pastebin.com/LDQxFKgx
Jan 1, 2015 at 14:43 comment added zabalajka @edc65 you're right about the regex (probably remnant of some earlier version); there was also one extra space -> 2 bytes in total. What do you have in mind with the console.log part? Modifying the inner expression r-i?: or replacing the console.log (I tried to build the whole string first and output everything at the end like this for(s='';...){... s+' '+n+(r-i?:)} s, but I ended up with exactly same length). And by too short you mean shorter than yours ;)
Jan 1, 2015 at 14:31 history edited zabalajka CC BY-SA 3.0
edited body
Dec 31, 2014 at 13:57 comment added edc65 Idea about the regexp: you need to check for 1 invalid char, not 1 ore more, so '+' is not needed.If you fiddle with your console.log expression you can save 8 bytes ... but then I think your answer would be too short
Dec 31, 2014 at 11:15 comment added zabalajka 6 bytes is total, thanks :) for(c of i=n+"") is quite logical when I see it, but I wouldn't think of it. c-6?B:A God forbid I ever put this into production code
Dec 31, 2014 at 11:07 history edited zabalajka CC BY-SA 3.0
deleted 19 characters in body
Dec 30, 2014 at 20:34 comment added edc65 also, usually Regexp.test(String) can be used instead of String.match(Regexp), 1 byte shorter.
Dec 30, 2014 at 20:30 comment added edc65 ...and c==6?A:B => c!=6=>B:A => c-6?B:A
Dec 30, 2014 at 20:28 comment added edc65 Bad pupil :) i=n+"";for(c of i) => for(c of i=n+"") save 2 bytes
Dec 30, 2014 at 15:02 history edited zabalajka CC BY-SA 3.0
added 1 character in body
Dec 30, 2014 at 14:51 history edited zabalajka CC BY-SA 3.0
Learned neat trick with `~` and `for (... of ...)` from @edc65
Dec 30, 2014 at 14:06 history answered zabalajka CC BY-SA 3.0