Skip to main content
new guidance => newlines == BAD!
Source Link

Ruby - N=45N=48

Let Ruby be Ruby and embrace the wrap-around penalty.
N=45N=48 foreval "for c in '! '..'~' do putc c end   #{('i'.ord-'.'.ord).chr} for c in '! '..'~' do putc ('~'.ord+'! '.ord-c.ord).chr endend"

or

eval "('! '..'~').selecteach { |c| putc c }
  #{('i'.ord-'.'.ord).chr} ('! '..'~').selecteach { |c| putc ('~'.ord+'! '.ord-c.ord).chr }"

(The select isn't natural, but each has an 'a' in it.)

Old:
N=72 {straight-line scoring} <- 72 ('.'-'u')
N=68 {wrap-around scoring} <- 29 ('!'-'=') + 36 ('['-'~') + 3invalid newlines

format = 67.chr
format << 42.chr
a = []
for i in 33..126 do a << i end
t = a.dup
for i in 33..126 do a << t.pop end
puts a.pack format

There's some flailing in here to avoid the 'v' in "reverse" that hurts the wrap-around score. I left it in because I'm fond of the pack("C*") hack.

Ruby - N=45

Let Ruby be Ruby and embrace the wrap-around penalty.
N=45 for c in '!'..'~' do putc c end  for c in '!'..'~' do putc ('~'.ord+'!'.ord-c.ord).chr end

or

('!'..'~').select { |c| putc c }
 ('!'..'~').select { |c| putc ('~'.ord+'!'.ord-c.ord).chr }

(The select isn't natural, but each has an 'a' in it.)

Old:
N=72 {straight-line scoring} <- 72 ('.'-'u')
N=68 {wrap-around scoring} <- 29 ('!'-'=') + 36 ('['-'~') + 3

format = 67.chr
format << 42.chr
a = []
for i in 33..126 do a << i end
t = a.dup
for i in 33..126 do a << t.pop end
puts a.pack format

There's some flailing in here to avoid the 'v' in "reverse" that hurts the wrap-around score. I left it in because I'm fond of the pack("C*") hack.

Ruby - N=48

Let Ruby be Ruby and embrace the wrap-around penalty.
N=48 eval "for c in ' '..'~' do putc c end #{('i'.ord-'.'.ord).chr} for c in ' '..'~' do putc ('~'.ord+' '.ord-c.ord).chr end"

or

eval "(' '..'~').each { |c| putc c } #{('i'.ord-'.'.ord).chr} (' '..'~').each { |c| putc ('~'.ord+' '.ord-c.ord).chr }"



Old:
N=72 {straight-line scoring} <- 72 ('.'-'u') + invalid newlines

format = 67.chr
format << 42.chr
a = []
for i in 33..126 do a << i end
t = a.dup
for i in 33..126 do a << t.pop end
puts a.pack format

There's some flailing in here to avoid the 'v' in "reverse". I left it in because I'm fond of the pack("C*") hack.

Another, more rubyish, alternative.
Source Link

Ruby - N=45

Let Ruby be Ruby and embrace the wrap-around penalty.
N=45 for c in '!'..'~' do putc c end for c in '!'..'~' do putc ('~'.ord+'!'.ord-c.ord).chr end
 

or

Old:
('!'..'~').select { |c| putc c }
('!'..'~').select { |c| putc ('~'.ord+'!'.ord-c.ord).chr }

 

(The select isn't natural, but each has an 'a' in it.)

Old:
N=72 {straight-line scoring} <- 72 ('.'-'u')
N=68 {wrap-around scoring} <- 29 ('!'-'=') + 36 ('['-'~') + 3

N=72 {straight-line scoring} N=68 {wrap-around scoring} format = 67.chr format << 42.chr a = [] for i in 33..126 do a << i end t = a.dup for i in 33..126 do a << t.pop end puts a.pack format
format = 67.chr
format << 42.chr
a = []
for i in 33..126 do a << i end
t = a.dup
for i in 33..126 do a << t.pop end
puts a.pack format

There's some flailing in here to avoid the 'v' in "reverse" that hurts the wrap-around score. I left it in because I'm fond of the pack("C*") hack.

Ruby - N=45

Let Ruby be Ruby and embrace the wrap-around penalty.
N=45 for c in '!'..'~' do putc c end for c in '!'..'~' do putc ('~'.ord+'!'.ord-c.ord).chr end
  Old:
  N=72 {straight-line scoring} N=68 {wrap-around scoring} format = 67.chr format << 42.chr a = [] for i in 33..126 do a << i end t = a.dup for i in 33..126 do a << t.pop end puts a.pack format

There's some flailing in here to avoid the 'v' in "reverse" that hurts the wrap-around score. I left it in because I'm fond of the pack("C*") hack.

Ruby - N=45

Let Ruby be Ruby and embrace the wrap-around penalty.
N=45 for c in '!'..'~' do putc c end for c in '!'..'~' do putc ('~'.ord+'!'.ord-c.ord).chr end

or

('!'..'~').select { |c| putc c }
('!'..'~').select { |c| putc ('~'.ord+'!'.ord-c.ord).chr }

(The select isn't natural, but each has an 'a' in it.)

Old:
N=72 {straight-line scoring} <- 72 ('.'-'u')
N=68 {wrap-around scoring} <- 29 ('!'-'=') + 36 ('['-'~') + 3

format = 67.chr
format << 42.chr
a = []
for i in 33..126 do a << i end
t = a.dup
for i in 33..126 do a << t.pop end
puts a.pack format

There's some flailing in here to avoid the 'v' in "reverse" that hurts the wrap-around score. I left it in because I'm fond of the pack("C*") hack.

new code, new scoring
Source Link

Ruby - N=72N=45

N = 'u'.ord Let Ruby be Ruby and embrace the wrap- '.'around penalty.ord + 1 
format = 67.chr
format << 42.chr
a = []
for i in 33..126 do a << i end
t = a.dup
for i in 33..126 do a << t.pop end
puts a.pack format
N=45 for c in '!'..'~' do putc c end for c in '!'..'~' do putc ('~'.ord+'!'.ord-c.ord).chr end
Old:
N=72 {straight-line scoring} N=68 {wrap-around scoring} format = 67.chr format << 42.chr a = [] for i in 33..126 do a << i end t = a.dup for i in 33..126 do a << t.pop end puts a.pack format

I thrashed around with a couple of scripting languages and Ruby seems to be the lowest scoring alternative because parentheses are avoidable. '.' and the 'u' in "puts" seem unavoidable, so the only difficult part is limiting the use of non-aphanumeric characters to the set "./:;<=>?@[]^_`". There's some extra flailing in here to avoid the 'v' in "reverse" that hurts the wrap-around score. I left it in because I'm fond of the pack("C*") hack.

Ruby - N=72

N = 'u'.ord - '.'.ord + 1
format = 67.chr
format << 42.chr
a = []
for i in 33..126 do a << i end
t = a.dup
for i in 33..126 do a << t.pop end
puts a.pack format

I thrashed around with a couple of scripting languages and Ruby seems to be the lowest scoring alternative because parentheses are avoidable. '.' and the 'u' in "puts" seem unavoidable, so the only difficult part is limiting the use of non-aphanumeric characters to the set "./:;<=>?@[]^_`". There's some extra flailing to avoid the 'v' in "reverse".

Ruby - N=45

Let Ruby be Ruby and embrace the wrap-around penalty. 
N=45 for c in '!'..'~' do putc c end for c in '!'..'~' do putc ('~'.ord+'!'.ord-c.ord).chr end
Old:
N=72 {straight-line scoring} N=68 {wrap-around scoring} format = 67.chr format << 42.chr a = [] for i in 33..126 do a << i end t = a.dup for i in 33..126 do a << t.pop end puts a.pack format

There's some flailing in here to avoid the 'v' in "reverse" that hurts the wrap-around score. I left it in because I'm fond of the pack("C*") hack.

Source Link
Loading