Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/Rot-13/CLU/rot-13.clu
Normal file
22
Task/Rot-13/CLU/rot-13.clu
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
rot13 = proc (c: char) returns (char)
|
||||
base: int
|
||||
letter: bool := false
|
||||
if c>='A' & c<='Z' then
|
||||
base := char$c2i('A')
|
||||
letter := true
|
||||
elseif c>='a' & c<='z' then
|
||||
base := char$c2i('a')
|
||||
letter := true
|
||||
end
|
||||
if ~letter then return(c) end
|
||||
return(char$i2c((char$c2i(c)-base+13)//26+base))
|
||||
end rot13
|
||||
|
||||
start_up = proc ()
|
||||
po: stream := stream$primary_output()
|
||||
pi: stream := stream$primary_input()
|
||||
while true do
|
||||
stream$putc(po,rot13(stream$getc(pi)))
|
||||
except when end_of_file: break end
|
||||
end
|
||||
end start_up
|
||||
Loading…
Add table
Add a link
Reference in a new issue