N
Nit Khair
in IRB,
ASCII = (0..255).map{|c| c.chr }
PRINTABLE = ASCII.grep(/[[rint:]]/)
PRINTABLE.length
However, inside the ruby program PRINTABLE.length only gives 95 !! ???
#!/opt/local/bin/ruby
ASCII = (0..255).map{|c| c.chr }
puts(ASCII.length)
PRINTABLE = ASCII.grep(/[[rint:]]/)
puts(PRINTABLE.length)
# -> 95 instead of 191
(Using ruby 1.8.7 on OS X 10.5.5, powerpc). Ran both from same Terminal.
Both use /opt/local/bin/ruby.
Why this difference? I ran irb with -f (so irbrc would not be loaded and
still got the same result, so its not some require that is causing the
difference).
p.s. sorry for cross-posting from roguelike thread -- this is getting
lost there.
ASCII = (0..255).map{|c| c.chr }
PRINTABLE = ASCII.grep(/[[rint:]]/)
PRINTABLE.length
However, inside the ruby program PRINTABLE.length only gives 95 !! ???
#!/opt/local/bin/ruby
ASCII = (0..255).map{|c| c.chr }
puts(ASCII.length)
PRINTABLE = ASCII.grep(/[[rint:]]/)
puts(PRINTABLE.length)
# -> 95 instead of 191
(Using ruby 1.8.7 on OS X 10.5.5, powerpc). Ran both from same Terminal.
Both use /opt/local/bin/ruby.
Why this difference? I ran irb with -f (so irbrc would not be loaded and
still got the same result, so its not some require that is causing the
difference).
p.s. sorry for cross-posting from roguelike thread -- this is getting
lost there.