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.