mardi 28 juin 2016

why .times is being difficult - Ruby

Can someone please explain to me why the Ruby function .times is being difficult

str.chars.map{|letter| num.times{letter.next}}

is producing just the number (num) for however many letters were in the word instead of moving each letter down the alphabet (.next) that many times. I know it seems simple but from what i understand of .times this is the way to use it but something like this has happened many.times....that was a joke.

Aucun commentaire:

Enregistrer un commentaire