Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Caesar-cipher/PL-I/caesar-cipher.pli
Normal file
20
Task/Caesar-cipher/PL-I/caesar-cipher.pli
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
caesar: procedure options (main);
|
||||
declare cypher_string character (52) static initial
|
||||
((2)'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
|
||||
declare (text, encyphered_text) character (100) varying,
|
||||
offset fixed binary;
|
||||
|
||||
get edit (text) (L); /* Read in one line of text */
|
||||
get list (offset);
|
||||
if offset < 1 | offset > 25 then signal error;
|
||||
put skip list ('Plain text=', text);
|
||||
|
||||
encyphered_text = translate(text, substr(cypher_string, offset+1, 26),
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZ' );
|
||||
put skip list ('Encyphered text=', encyphered_text);
|
||||
|
||||
text = translate(encyphered_text, substr(cypher_string, 27-offset, 26),
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZ' );
|
||||
put skip list ('Decyphered text=', text);
|
||||
|
||||
end caesar;
|
||||
Loading…
Add table
Add a link
Reference in a new issue