Timeline for Sort-a-number. Sorta
Current License: CC BY-SA 3.0
18 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 30, 2014 at 20:53 | comment | added | Glenn Randers-Pehrson | Keeping backward compatibility: If "sorta" contains "bc<<<$1", then "sorta 5" and "sorta 3 ' ' " still work. But it's no shorter than the current implementation. And there are no points to be gained by increasing the speed of the program. Thanks, though; I was looking for a 2-byte equivalent of "echo" but overlooked "bc". | |
Mar 30, 2014 at 20:41 | comment | added | Dennis |
Bash is sooo inefficient for this task! If you switch to bc and read from STDIN, you can use an empty script or one containing solely the shebang #!/usr/bin/bc (which isn't included in the character count). This will break backward compatibility though; you'll have to teach your userbase to use -l , -q or -w for reversing the output.
|
|
Mar 29, 2014 at 3:50 | history | edited | Glenn Randers-Pehrson | CC BY-SA 3.0 |
Put "echo $*" in a "sorta" script.
|
Mar 29, 2014 at 3:16 | history | edited | Glenn Randers-Pehrson | CC BY-SA 3.0 |
Updated "usage" to also accept the "-e" option as suggested.
|
Mar 29, 2014 at 3:15 | comment | added | Glenn Randers-Pehrson | Never mind, you are right, "-e" would work as well as "". I'd have to rewrite the user manual though, and for backward compabibility I'd have to continue to accept "". | |
Mar 29, 2014 at 2:46 | history | edited | Glenn Randers-Pehrson | CC BY-SA 3.0 |
Mention that reversing is an option
|
Mar 29, 2014 at 2:41 | comment | added | Glenn Randers-Pehrson | "-e " would cost another 3 bytes. "" doesn't cost anything. | |
Mar 29, 2014 at 2:14 | comment | added | Heiko Oberdiek |
@kojiro: For example, -e could be used as argument for the reverse output.
|
|
Mar 29, 2014 at 1:32 | history | edited | Glenn Randers-Pehrson | CC BY-SA 3.0 |
changed "cat" to "echo" so it would work.
|
Mar 29, 2014 at 1:32 | comment | added | Digital Trauma | Legendary abuse of rules. +1 | |
Mar 29, 2014 at 1:21 | history | edited | Glenn Randers-Pehrson | CC BY-SA 3.0 |
debugging: use echo not cat, costs one extra byte.
|
Mar 29, 2014 at 1:20 | comment | added | Glenn Randers-Pehrson | The argument can be whatever I want. I chose the empty string. I'll add an example. | |
Mar 29, 2014 at 1:18 | comment | added | kojiro | Hmm, the rules state that you have to give another argument to reverse the sort. What is that argument? | |
Mar 29, 2014 at 1:17 | comment | added | Glenn Randers-Pehrson | The whole thing is undeserved; why pick on the sorting? | |
Mar 29, 2014 at 1:15 | history | edited | Glenn Randers-Pehrson | CC BY-SA 3.0 |
note that it avoids iteration-of-digits hackery.
|
Mar 29, 2014 at 1:13 | comment | added | Kaya |
Allowing yourself the -10 for sorting a single digit 'both ways' feels rather undeserved.
|
|
Mar 29, 2014 at 1:11 | comment | added | Doorknob | Haha; nice trick, but it's still the losing answer out of all the (also rule-bending) answers so far ;) | |
Mar 29, 2014 at 1:08 | history | answered | Glenn Randers-Pehrson | CC BY-SA 3.0 |