Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
21
Task/Caesar-cipher/Run-BASIC/caesar-cipher.basic
Normal file
21
Task/Caesar-cipher/Run-BASIC/caesar-cipher.basic
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
input "Gimme a ofset:";ofst ' set any offset you like
|
||||
|
||||
a$ = "Pack my box with five dozen liquor jugs"
|
||||
print " Original: ";a$
|
||||
a$ = cipher$(a$,ofst)
|
||||
print "Encrypted: ";a$
|
||||
print "Decrypted: ";cipher$(a$,ofst+6)
|
||||
|
||||
FUNCTION cipher$(a$,ofst)
|
||||
for i = 1 to len(a$)
|
||||
aa$ = mid$(a$,i,1)
|
||||
code$ = " "
|
||||
if aa$ <> " " then
|
||||
ua$ = upper$(aa$)
|
||||
a = asc(ua$) - 64
|
||||
code$ = chr$((((a mod 26) + ofst) mod 26) + 65)
|
||||
if ua$ <> aa$ then code$ = lower$(code$)
|
||||
end if
|
||||
cipher$ = cipher$;code$
|
||||
next i
|
||||
END FUNCTION
|
||||
Loading…
Add table
Add a link
Reference in a new issue