ADFGVX cipher: Difference between revisions
Content deleted Content added
Added Uiua solution |
→{{header|Uiua}}: Changed the algorithm |
||
Line 3,071:
Quick and simple solution for demonstration purposes.
<syntaxhighlight lang="uiua">
A ← ↯∞_2⊞⊟."ADFGVX"
▲P ← ↯[.√⧻].Shuffle"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
K ← "PACKHORSE"
Polybius ← setinv(/⊂⊡≡(⊚⌕):⊙:¤P A|⊏:P≡(⊢⊚⌕)⊙¤∩≡□↯∞_2:A)
SortByK ← setinv(⊏⍏⟜(⍉⬚" "↯⊟∞⧻)K|▽≠" "./⊂⍉⊏⍏⍏K)
Str ← setinv(/$"_ _"Sw/⊂≡(⊂:" ")|≡(⊢°□◇⬚" "↯⊟∞)/↥≡◇⧻.Sw)
Pt ← "ATTACKAT1200AM"
&p $"Key = _\nPolybius:\n_\nPlaintext = _"K↯⊟.√⧻.P Pt
&p
&p$"Plaintext = _" °Polybius °SortByK °Str
</syntaxhighlight>
Line 3,110 ⟶ 3,098:
Plaintext = ATTACKAT1200AM
Crypttext = GFX VVX GXV VGX FFF FVF FVXG FFF GGG
</pre>
=={{header|Wren}}==
{{libheader|Wren-ioutil}}
|