Description
The Caesar cipher is a cipher, where every letter in the alphabet will be rotated by a secret number.
If the rotation is \$7\$, then a
-> h
, g
-> n
, v
-> c
and z
-> g
.
Today, we're playing Caesar's Cipher with ASCII chars, (0-127 inclusive).
So, with rotation \$7\$, b
-> i
, Z
-> a
, x
-> DEL (127)
,
But, even if the encoder shifted the chars around the ASCII table, you know, that the original string consisted of only the lowercase, uppercase alphabet, and space.
Task
You're given a string of ASCII code points, your task is to print all of the possible original strings if the encoder only used the lowercase and the upper case alphabet (plus space) in the original string.
Rules
- The program must take the ASCII char codes of the encoded string as the input
- The encoded string is not constricted on lowercase, uppercase, and space, it can (because it's ASCII shifted) include ASCII chars
- The output must be all possible original strings (as a list, separated by newlines, etc.)
- Default loopholes apply
- Lowercase, uppercase, and space:
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
- This is code-golf, so the shortest answer wins!
Examples
[In]: [91, 111, 112, 122, 39, 112, 122, 39, 104, 39, 123, 108, 122, 123, 39, 116, 108, 122, 122, 104, 110, 108]
[Out]: This is a test message
[In]: [43, 35, 49, 49, 31, 37, 35]
MESSAGE
NFTTBHF
OGUUCIG
PHVVDJH
QIWWEKI
RJXXFLJ
SKYYGMK
TLZZHNL
message
nfttbhf
oguucig
phvvdjh
qiwweki
rjxxflj
skyygmk
tlzzhnl
[In]: [103, 123, 120, 51, 97, 124, 1, 120, 7, 120, 120, 1, 7, 123, 51, 85, 12, 7, 120]
[Out]: The Nineteenth Byte
[In]: [78, 82, 78, 78]
[Out]:
NRNN
OSOO
PTPP
QUQQ
RVRR
SWSS
TXTT
UYUU
VZVV
aeaa
bfbb
cgcc
dhdd
eiee
fjff
gkgg
hlhh
imii
jnjj
kokk
lpll
mqmm
nrnn
osoo
ptpp
quqq
rvrr
swss
txtt
uyuu
vzvv
AEAA
BFBB
CGCC
DHDD
EIEE
FJFF
GKGG
HLHH
IMII
JNJJ
KOKK
LPLL
MQMM