Got stuck

Hi,

may be my Enigma hacking has encyphered my brain also...but...

ruby is enigmatic sometimes...

What is wrong with this code:

etwdata=[[1,2],[3,4],[5,6]] # only example data

etwdata.each{ |rot|
rot.each{ |val|
   print (val + ?A).chr," " # here ruby

yes, that is puzzling.
if you do it in reverse (like your enigma :-), it works

  print " ", (val + ?A).chr

Eg...

c:\family\ruby>cat a1.rb
etwdata=[[1,2],[3,4],[5,6]] # only example data
etwdata.each do |pair|
        pair.each do |val|
                print " ",(val + ?A).chr
        end
        print "\n"
end

c:\family\ruby>ruby a1.rb
B C
D E
F G

fails...error message below...
}
print "\n"

Ruby's error message:

basicenigma4.rb:175: warning: don't put space before
argument parentheses

careful w messages. They are written by humans, not compilers :slight_smile:

Sorry... but _I_ dont see anything wrong here...

Imnsho, I'd say it's a bug... probably under code block parsing...

Ruby.use!
Meino

kind regards -botp

···

Meino Christian Cramer [mailto:Meino.Cramer@gmx.de] wrote: