tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
18
Task/Rot-13/ZX-Spectrum-Basic/rot-13.zx
Normal file
18
Task/Rot-13/ZX-Spectrum-Basic/rot-13.zx
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
5 REM Translation of the QBasic provided solution
|
||||
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