Playfair cipher: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: performed some subroutine statement reductions. -- ~~~~)
(→‎{{header|REXX}}: add output from ooRexx)
Line 371: Line 371:
if _\=='' then call err 'too many arguments specified.'
if _\=='' then call err 'too many arguments specified.'
if newX=='' then call err 'PHRASE is empty or has no letters'
if newX=='' then call err 'PHRASE is empty or has no letters'
if length(noX)\==1 then call err '"ommitted" letter must be only one letter'
if length(noX)\==1 then call err '"omitted" letter must be only one letter'
if length(newK)<3 then call err 'cypher key is too short, must be > 1 character.'
if length(newK)<3 then call err 'cypher key is too short, must be > 1 character.'
if \datatype(noX,'M') then call err '"omitted" letter must be a Latin alphabet letter.'
if \datatype(noX,'M') then call err '"omitted" letter must be a Latin alphabet letter.'
Line 441: Line 441:
plain text= HI DE HC EG PL DI NN HE NI EN EN NI MP
plain text= HI DE HC EG PL DI NN HE NI EN EN NI MP
</pre>
</pre>
After the usual replacements for $, @, #, and x= I ran the program on ooRexx with the following correct results:
<pre> old cypher= Playfair example
new cypher= PLAYFIREXM
old phrase= Hide the gold in the tree stump!!
new phrase= HIDETHEGOLDINTHETREESTUMP
new digram= HI DE TH EG OL DI NT HE TR EE ST UM P

cypher text= BM OD ZB XD NA BE KU DM UI XM MO UV IF
plain text= HI DE TH EG OL DI NT HE TR EX ES TU MP</pre>


=={{header|Tcl}}==
=={{header|Tcl}}==