[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Got stuck...
From:       Stephan_Kämper <Stephan.Kaemper () Schleswig-Holstein ! de>
Date:       2004-08-20 9:30:55
Message-ID: 2olul9Fbf5doU1 () uni-berlin ! de
[Download RAW message or body]

Meino Christian Cramer wrote:
> Hi,
> 
>  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. ;-)

Happy rubying

Stephan


--
Stephan Kämper/IT-Beratung  http://www.stephankaemper.de
Qualitätssicherung   /   Softwaretest   /   Datenanalyse

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic