Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def stolenLunch(note)
- x = 0
- output = ""
- characters = ('a'..'j').to_a
- while (x < note.length)
- if note[x] >= '0' and note[x] <= '9' then
- output = output + characters[note[x].to_i]
- elsif note[x] >= 'a' and note[x] <= 'j' then
- output = output + (note[x].ord - 'a'.ord).to_s
- else
- output = output + note[x]
- end
- x = x + 1
- end
- return output
- end
Advertisement
Add Comment
Please, Sign In to add comment