In the process of making a Caesar cipher with ruby, I would like to shift the hiragana "Rion" one character at a time. (After creating a method to shift all hiragana one character at a time.) And "n" is converted to "a".
Please write the details of the question here.
(Example) I am making a ●● system with PHP (CakePHP).
The following error message occurred while implementing the ■■ function.
chars = [* "a" .. "" "
text = "Rion"
crypted = text.tr (chars.join, chars.rotate (1) .join)
p cryptedError message
Does not shift one character at a time.
undefined method `rotate 'for # (NoMethodError) ### Corresponding source code
Enter the language name here
Please describe what you tried for the problem here.
I used ord rotate but it didn't respond well.
Please provide more detailed information here.
Answer # 1
The Ruby version seems to be old.The
-Ksoption is also old, maybe 1.8?
- ruby - i want to know the reason for implementing it in a class method or module when solving an exercise
- ruby on rails - i want to use yield in a method chain
- ruby - no method error rails
- ruby - i'm using the errors method, but i don't get an error message
- ruby on rails: undefined method ʻuser'for nil: about nomethoderror of nilclass
- ruby - undefined method `save'for nil: nilclass cannot be resolved
- ruby - improvement of nomethoderror undefined method `paginate'
- [ruby] "attr_accessor" i don't understand this method
- ruby on rails - [rails] i want to make it a helper method
- ruby - nomethoderror: undefined method `new'for: uglifier: symbol error on heroku deployment
- ruby on rails - [rails] i want to use each statement in a helper method
- the ruby on rails each method does not repeat well
- ruby - where method doesn't work
- ruby - the method defined in the model cannot be used
- ruby - undefined method `build_address' for order (table doesn't exist): class send data to db
- ruby on rails5 nomethoderror (undefined method `cart_items' for nil:nilclass) implementation of ec site cart function
- ruby - cannot save data by save method
- about ruby count method
- ruby on rails 6 - i want to resolve undefined method `' for nil:nilclass
- ruby undefined method `find_zone!' for time:class (nomethoderror) error