Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
23
Task/Rot-13/S-lang/rot-13.slang
Normal file
23
Task/Rot-13/S-lang/rot-13.slang
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
variable old = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
|
||||
variable new = "NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm";
|
||||
|
||||
define rot13(s) {
|
||||
s = strtrans(s, old, new);
|
||||
return s;
|
||||
}
|
||||
|
||||
define rot13_stream(s) {
|
||||
variable ln;
|
||||
while (-1 != fgets(&ln, s))
|
||||
fputs(rot13(ln), stdout);
|
||||
}
|
||||
|
||||
if (__argc > 1) {
|
||||
variable arg, fp;
|
||||
foreach arg (__argv[[1:]]) {
|
||||
fp = fopen(arg, "r");
|
||||
rot13_stream(fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
rot13_stream(stdin);
|
||||
Loading…
Add table
Add a link
Reference in a new issue