Playfair cipher: Difference between revisions

m
J: fix clipped code
m (J: discard temps)
m (J: fix clipped code)
Line 249:
 
encrypt=:3 :0
,alt{~ref i. 2{."1 -.&' '"1 ~."1 (_2]\ norm y),"1 norm 'XQV'
)
 
decrypt=:3 :0
,ref{~alt i. 2{."1 -.&' '"1 ~."1 (_2]\ norm y),"1 norm 'XQV'
,)</lang>
 
We could obviously factor out a routine to clean the text and form pairs to use for both encrypt and decrypt, but it works well enough like it is.
6,962

edits