Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/Rot-13/ZX-Spectrum-Basic/rot-13.basic
Normal file
17
Task/Rot-13/ZX-Spectrum-Basic/rot-13.basic
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
10 CLS
|
||||
20 INPUT "Enter a string: ", s$
|
||||
30 LET a$ = "": REM a$ is the encoded string
|
||||
40 FOR l = 1 TO LEN(s$)
|
||||
50 LET i$ = s$(l): REM i$ is the letter being worked on
|
||||
60 IF i$ < "A" OR i$ > "Z" THEN GO TO 100
|
||||
70 LET c$ = CHR$(CODE(i$) + 13): REM c$ is the encoded letter
|
||||
80 IF c$ > "Z" THEN LET c$ = CHR$(CODE(c$) - 26)
|
||||
90 GO TO 300
|
||||
100 IF i$ < "a" OR i$ > "z" THEN GO TO 200
|
||||
110 LET c$ = CHR$(CODE(i$) + 13)
|
||||
120 IF c$ > "z" THEN LET c$ = CHR$(CODE(c$) - 26)
|
||||
130 GO TO 300
|
||||
200 LET c$ = i$
|
||||
300 LET a$ = a$ + c$
|
||||
310 NEXT l
|
||||
320 PRINT a$
|
||||
Loading…
Add table
Add a link
Reference in a new issue