may be my Enigma hacking has encyphered my brain also...but...
What is wrong with this code:
etwdata=[[1,2],[3,4],[5,6]] # only example data
etwdata.each{ |rot|
rot.each{ |val|
You wrote:
print (val + ?A).chr," " #...
Try this:
print( (val + ?A).chr, " " )
}
print "\n"
And adding a 2nd '}' might help, too.
Ruby's error message:
basicenigma4.rb:175: warning: don't put space before argument parentheses
The script didn't fail, it only gave you a warning.
For non-tivial combinations of method calls adding parentheseses is recommended, because otherwise it may be unclear what the result should be.
Sorry... but _I_ dont see anything wrong here...
....because there *is* nothing wrong, just sub-optimal.
----- Original Message -----
From: "Meino Christian Cramer" <Meino.Cramer@gmx.de>
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Sent: Friday, August 20, 2004 10:18 AM
Subject: Got stuck...
Hi,
may be my Enigma hacking has encyphered my brain also...but...
Other people have pointed the error out, but it's worth noting that
print is actually a method of Kernel, not a keyword, hence the need for
parens surrounding the entire argument.
martin
···
Meino Christian Cramer <Meino.Cramer@gmx.de> wrote:
Other people have pointed the error out, but it's worth noting that
print is actually a method of Kernel, not a keyword, hence the need for
parens surrounding the entire argument.
Well, the reason ruby was issuing a warning, at any rate
martin
···
ts <decoux@moulon.inra.fr> wrote:
> Other people have pointed the error out, but it's worth noting that
> print is actually a method of Kernel, not a keyword, hence the need for
> parens surrounding the entire argument.