Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def cipher26(message)
- x = 1
- y = 0
- characters = Array.new
- characters = ('a'..'z').to_a
- output = message[0]
- first_value = message[0].ord - 'a'.ord
- amount = first_value
- while (x < message.length)
- while (true)
- if (amount + y) % 26 == message[x].ord - 'a'.ord then
- output = output + characters[y]
- amount = amount + y
- break
- end
- y = y + 1
- end
- x = x + 1
- y = 0
- end
- return output
- end
Advertisement
Add Comment
Please, Sign In to add comment