-
Notifications
You must be signed in to change notification settings - Fork 0
/
crypto.rb
27 lines (27 loc) · 629 Bytes
/
crypto.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Implement methods for encrypting and decrypting a square code.
#
# Hint:
#
# "If man was meant to stay on the ground, God would have given us roots."
#
# is normalised to...
#
# "ifmanwasmeanttostayonthegroundgodwouldhavegivenusroots"
#
# then converted to a square where columns >= rows and columns - rows <= 1
#
# ifmanwas
# meanttos
# tayonthe
# groundgo
# dwouldha
# vegivenu
# sroots
#
# which when read top-down left to right gives...
#
# "imtgdvsfearwermayoogoanouuiontnnlvtwttddesaohghnsseoau"
#
# then spaced into row length tokens gives...
#
# "imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau"#