Timeline for Mixed Number to an Improper Fraction
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 13, 2017 at 12:39 | history | edited | CommunityBot |
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
|
|
Dec 18, 2015 at 14:35 | comment | added | TessellatingHeckler | Oh yeah, just math! (That would be enough to beat a Perl answer, too) | |
Dec 18, 2015 at 13:48 | comment | added | AdmBorkBork |
@TessellatingHeckler Thanks for the regex assist. I've asked Downgoat for input. But $l,$n,$d=$args-split'\D';+$l*$d+$n;$d is shorter yet at 37, and logically follows the same pattern as here.
|
|
Dec 18, 2015 at 13:47 | history | edited | AdmBorkBork | CC BY-SA 3.0 |
Golfed two bytes thanks to TessellatingHeckler
|
Dec 18, 2015 at 3:03 | comment | added | TessellatingHeckler |
Hi, I think you can do -split ' |/' to save one character with a "match either this|or that" regex, or use -split '\D' to split on anything which isn't a digit and s(h)ave two characters. If @Downgoat is willing to be slightly flexible on the output format, '{0}*{2}+{1};{2}'-f($args-split'\D')|iex is 40 bytes and has much cooler output because the numbers are even one above the other!
|
|
Dec 17, 2015 at 19:46 | history | edited | AdmBorkBork | CC BY-SA 3.0 |
Regex split
|
Dec 17, 2015 at 19:28 | history | answered | AdmBorkBork | CC BY-SA 3.0 |