30 lines
676 B
Plaintext
30 lines
676 B
Plaintext
input "Type some text to be encoded, then ENTER. ";tx$
|
|
|
|
tex$ = Rot13$(tx$)
|
|
print tex$
|
|
'check
|
|
print Rot13$(tex$)
|
|
|
|
wait
|
|
|
|
Function Rot13$(t$)
|
|
if t$="" then
|
|
Rot13$=""
|
|
exit function
|
|
end if
|
|
for i = 1 to len(t$)
|
|
c$=mid$(t$,i,1)
|
|
ch$=c$
|
|
if (asc(c$)>=asc("A")) and (asc(c$)<=asc("Z")) then
|
|
ch$=chr$(asc(c$)+13)
|
|
if (asc(ch$)>asc("Z")) then ch$=chr$(asc(ch$)-26)
|
|
end if
|
|
if (asc(c$)>=asc("a")) and (asc(c$)<=asc("z")) then
|
|
ch$=chr$(asc(c$)+13)
|
|
if (asc(ch$)>asc("z")) then ch$=chr$(asc(ch$)-26)
|
|
end if
|
|
rot$=rot$+ch$
|
|
next
|
|
Rot13$=rot$
|
|
end function
|