Re: Random Password

new topic     » goto parent     » topic index » view thread      » older message » newer message

irv mullins wrote:
> 
> Alex Blanchette wrote:
> > 
> > 
> > I'm trying to write a simple DOS program that makes a random 6 number
> > password
> > when you press enter, but for somereason it won't start when I press enter,
> > it just starts on its own and doesn't stop, is there a way I can fix this?
> > How do I get it to print six random numbers on one line if I can only use
> > one %d command in a puts() command?

Sorry, I left off the part about how to get 6 numbers on one line:)
nclude get.e

integer key, password

puts(1,"Press the enter key:")
key = wait_key()
puts(1,'\n') 

-- To generate 6 numbers, here's one way:

for i = 1 to 6 do
   password = rand(999999)
   printf(1,"%02d ",password)
end for


new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu