Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
25
Task/Caesar-cipher/Chipmunk-Basic/caesar-cipher.basic
Normal file
25
Task/Caesar-cipher/Chipmunk-Basic/caesar-cipher.basic
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
10 rem Caesar cipher
|
||||
20 cls
|
||||
30 dec$ = ""
|
||||
40 type$ = "cleartext "
|
||||
50 print "If decrypting enter "+"<d> "+" -- else press enter "; : input dec$
|
||||
60 input "Enter offset > ",ioffset
|
||||
70 if dec$ = "d" then
|
||||
80 ioffset = 26-ioffset
|
||||
90 type$ = "ciphertext "
|
||||
100 endif
|
||||
110 print "Enter "+type$+"> ";
|
||||
120 input cad$
|
||||
130 cad$ = ucase$(cad$)
|
||||
140 longitud = len(cad$)
|
||||
150 for i = 1 to longitud
|
||||
160 itemp = asc(mid$(cad$,i,1))
|
||||
170 if itemp > 64 and itemp < 91 then
|
||||
180 itemp = ((itemp-65)+ioffset) mod 26
|
||||
190 print chr$(itemp+65);
|
||||
200 else
|
||||
210 print chr$(itemp);
|
||||
220 endif
|
||||
230 next i
|
||||
240 print
|
||||
250 end
|
||||
Loading…
Add table
Add a link
Reference in a new issue