Playfair cipher: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: adjusted REXX program for the case of no arg before the ( not followed by a blank. -- ~~~~)
(→‎{{header|REXX}}: added another error check (cipher key can't contain the OMIT character). -- ~~~~)
Line 378: Line 378:
upper omit @abcU /*uppercase OMIT char & alphabet.*/
upper omit @abcU /*uppercase OMIT char & alphabet.*/
if pos(omit,newText)\==0 then call err 'TEXT can''t contain the "OMIT" character: ' omit
if pos(omit,newText)\==0 then call err 'TEXT can''t contain the "OMIT" character: ' omit
if pos(omit,newKey) \==0 then call err 'cipher key can''t contain the "OMIT" character: ' omit
fill=space(translate(@abcU,, omit), 0) /*elide OMIT char from alphabet. */
fill=space(translate(@abcU,, omit), 0) /*elide OMIT char from alphabet. */
xx='X'; if omit==xx then xx='Q' /*char used for double characters*/
xx='X'; if omit==xx then xx='Q' /*char used for double characters*/