TIP: Click on subject to list as thread! ANSI
echo: quik_bas
to: TERRY RETT
from: NICK ANDRE
date: 1998-04-15 22:50:00
subject: Re: random letters

TR> does any one know how to get qbasic to generate random letters , like you 
w
TR> use to make a program which would generate random pass words ,(txt)  or 
.ba
TR> source, i can get it to generate random numbers just not letters ???
TR> 
TR> thank's t.rett
Try this one out. It will generate a random letter password of 10 characters.
I used something like this one in one of my old role-playing games I made for
my Commodore Vic-20, it should work on PC's without any problems.
If the DO...LOOP doesn't work, simply replace with IF and THEN statements.
'Secret agent password subroutine.
'By Nick Andre.
FOR I=1 TO 20                   'Begins main loop.
 DO                             'Begin a sub-loop to pick a letter.
  C=INT(RND(1)*255)+1           'Get a random number between 0 and 255.
 LOOP UNTIL C>65 AND C<96       'Between Ascii 65 and 96 are capital letters.
 A$=A$+CHR$(C)                  'Append A$ with Ascii character "C".
NEXT I                          'Loops until we have 20 characters.
PRINT "Your new password is: ";A$; " to enter the secret lair!"
TTYL!
Nick.
--- Renegade v5-11 Exp
---------------
* Origin: Andre Computers OS/2 (1:252/0)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.