ADFGVX cipher: Difference between revisions
m
→{{header|J}}
(J) |
m (→{{header|J}}) |
||
Line 380:
echo D=: P XVGFDA W E
ATTACKAT1200AM</lang>
That said, note that we could also eliminate spaces from the encrypted text, as they are recoverable if we have the code word.
<lang J>spaces=: {{deb y#inv~,0,.(/:n){*|:_9]\>:i.#y=.y-.' '}}
echo S=: E-.' '
FFFFGFFFFGXDXDGFDGGXDXXXAGAD
P spaces W S
FFF FGF FFF GXD XDG FDGG XDX XXA GAD</lang>
(Technically, we do not need the Polybius square to recover the spaces, but it's passed as an argument here for symmetry.)
=={{header|Julia}}==
|