1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-06 03:30:23 +00:00
QB64-PE/tests/qbasic_testcases/misc/rot13.bas
Matthew Kilgore 9ee89d6ff4 Add QBasic tests
These tests use a variety of sample code (with some of the larger files
removed, so they are not complete!) and verifies that they all compile
successfully.
2022-04-28 23:00:07 -04:00

11 lines
234 B
QBasic

'2007 mennonite
'public domain
z$="hello"
for n = 1 TO len(z$)
a$ = right$(left$(z$,n),1)
b$ = a$
c = asc(ucase$(a$))
if c > 64 and c < 91 then b$ = chr$((c - 65 + 13) mod 26 + 65)
if asc(a$) > 91 then b$ = lcase$(b$)
print b$;
next n