Timeline for Tips for golfing in Ruby
Current License: CC BY-SA 3.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 26, 2019 at 15:45 | comment | added | val - disappointed in SE | @SimplyBeautifulArt Your username checks out so well for this one. | |
| May 13, 2017 at 15:45 | comment | added | Simply Beautiful Art |
You can go beyond 126 using thinks like ☺ or ♫, or if you are crazy enough: ?﷽.ord=65021
|
|
| May 13, 2017 at 13:09 | comment | added | Simply Beautiful Art | So in 1.8, all I have to do is go ?~ and it will return 126? | |
| Jul 2, 2014 at 19:15 | comment | added | Not that Charles |
or, from @daniero's own answer, puts *$<
|
|
| May 24, 2014 at 16:26 | history | edited | kernigh | CC BY-SA 3.0 |
From http://codegolf.stackexchange.com/a/7089/4065 we know that map is shorter than each.
|
| Jul 17, 2013 at 20:01 | comment | added | daniero |
An even golfier way to implement cat is to leave the ruby file completely empty (0 bytes) and insist that it should be run from the command line with the -p flag.
|
|
| Mar 13, 2011 at 20:54 | vote | accept | grokus | ||
| Feb 9, 2011 at 16:48 | history | edited | sepp2k | CC BY-SA 2.5 |
Added note about single-character strings in 1.9
|
| Feb 3, 2011 at 22:59 | comment | added | Nemo157 |
You can use ?a.ord in 1.9, but that's still longer than the decimal.
|
|
| Feb 3, 2011 at 8:03 | comment | added | Hiato | ?x yields the ascii code in general, so you can realistically get all the printables to digits in two characters. 1.9 is different, 'a'.ord yields the ascii number, but is four bytes longer than the decimal version. | |
| Feb 2, 2011 at 13:09 | history | answered | sepp2k | CC BY-SA 2.5 |