1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-07-05 10:00:23 +00:00
qb64/programs/samples/misc/rot13.bas

11 lines
244 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