J
Jack W.
Hi all,
Just started looking at Ruby the last couple of days, so as a starter I
tried to convert a little PHP function I've made into some ruby code.
But I get following error when I tried to run on Linux:
caesarCiper.rb:7:in `caesarCipher': undefined method `ord' for
"a":String (NoMethodError)
from caesarCiper.rb:5:in `each'
from caesarCiper.rb:5:in `caesarCipher'
from caesarCiper.rb:42
I guess I need to make the c variable to a character before calling the
ord method on it? -but I don't know the method to do so.
Please help me, and please tell me if I'm wrong.
Oh, and some of the rest of the code might be very wrong to - just can't
debug that untill this error is gone
- jack
Attachments:
http://www.ruby-forum.com/attachment/6063/caesarCipher.php
http://www.ruby-forum.com/attachment/6064/caesarCiper.rb
Just started looking at Ruby the last couple of days, so as a starter I
tried to convert a little PHP function I've made into some ruby code.
But I get following error when I tried to run on Linux:
caesarCiper.rb:7:in `caesarCipher': undefined method `ord' for
"a":String (NoMethodError)
from caesarCiper.rb:5:in `each'
from caesarCiper.rb:5:in `caesarCipher'
from caesarCiper.rb:42
I guess I need to make the c variable to a character before calling the
ord method on it? -but I don't know the method to do so.
Please help me, and please tell me if I'm wrong.
Oh, and some of the rest of the code might be very wrong to - just can't
debug that untill this error is gone
- jack
Attachments:
http://www.ruby-forum.com/attachment/6063/caesarCipher.php
http://www.ruby-forum.com/attachment/6064/caesarCiper.rb