Post by DARKNIGHT on Feb 4, 2024 2:04:48 GMT -5
Hey Guys,
Just finished this code. for once, I am posting code to share. rather then something I need help with.
Just finished this code. for once, I am posting code to share. rather then something I need help with.
this code could be used as a password generator, or maybe the basis of an algorithm for encryption,
I guess. or what ever your imagination can come up with for its use.
the LB community Forum has really been there for me, so I thought I would give back a little.
Enjoy!
'*** CODE GENERATOR ***
[Gen_Nums]' Generate Random #'s
for a = 65 to 90
num=int(rnd(1)*9)+1' * Gen Random # used in Code Sequence
10 ltr=int(rnd(1)*9)+1' * Gen Random # for letter Assignment
' * Set Letter Assignment
if ltr=1 then let a$="a":if ltr=8 then let a$="h":if ltr=15 then let a$="o":if ltr=22 then let a$="v"
if ltr=2 then let a$="b":if ltr=9 then let a$="i":if ltr=16 then let a$="p":if ltr=23 then let a$="w"
if ltr=3 then let a$="c":if ltr=10 then let a$="j":if ltr=17 then let a$="q":if ltr=24 then let a$="x"
if ltr=4 then let a$="d":if ltr=11 then let a$="k":if ltr=18 then let a$="r":if ltr=25 then let a$="y"
if ltr=5 then let a$="e":if ltr=12 then let a$="l":if ltr=19 then let a$="s":if ltr=26 then let a$="z"
if ltr=6 then let a$="f":if ltr=13 then let a$="m":if ltr=20 then let a$="t"
if ltr=7 then let a$="g":if ltr=14 then let a$="n":if ltr=21 then let a$="u"
Xpos=int(rnd(1)*9)+1' * Generate Random Char placement
let code$=chr$(a);a$;num
' * Display Code on Scrn *
locate 5,3:print" GENERATED CODE:"
locate 5,5:print"|"
locate 20,5:print"|"
locate 5,4:print"----------------"
locate Xpos+6,5:print code$
locate 5,6:print"----------------"
next a
locate 6,7:input"press Enter ->";e$
cls
gosub [Gen_Nums]