September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
30
Task/Caesar-cipher/BASIC256/caesar-cipher.basic256
Normal file
30
Task/Caesar-cipher/BASIC256/caesar-cipher.basic256
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
# Caeser Cipher
|
||||
# basic256 1.1.4.0
|
||||
|
||||
dec$ = ""
|
||||
type$ = "cleartext "
|
||||
|
||||
input "If decrypting enter " + "<d> " + " -- else press enter > ",dec$ # it's a klooj I know...
|
||||
input "Enter offset > ", iOffset
|
||||
|
||||
if dec$ = "d" then
|
||||
iOffset = 26 - iOffset
|
||||
type$ = "ciphertext "
|
||||
end if
|
||||
|
||||
input "Enter " + type$ + "> ", str$
|
||||
|
||||
str$ = upper(str$) # a bit of a cheat really, however old school encryption is always upper case
|
||||
len = length(str$)
|
||||
|
||||
for i = 1 to len
|
||||
iTemp = asc(mid(str$,i,1))
|
||||
|
||||
if iTemp > 64 AND iTemp < 91 then
|
||||
iTemp = ((iTemp - 65) + iOffset) % 26
|
||||
print chr(iTemp + 65);
|
||||
else
|
||||
print chr(iTemp);
|
||||
end if
|
||||
|
||||
next i
|
||||
Loading…
Add table
Add a link
Reference in a new issue