Qbasicnews.com
July 21, 2018, 06:55:28 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: 'Program to generate "sentences" random  (Read 8893 times)
lrcvs
Member
*
Posts: 56


« on: August 20, 2009, 12:36:41 PM »

'Program to generate "sentences" random
'lrcvs 20.08.09

'Possible uses:
'to sort files
'fill arrays....


CLS
FOR h = 1 TO 10 'Number of sentences
l = 10 'Number of words
j = 0
WHILE j < l
z$ = ""
RANDOMIZE TIMER
a = INT(RND * 100)
IF a > 64 THEN b = a
IF b < 91 THEN c = b
IF a > 64 AND b < 91 THEN z$ = CHR$(b): y$ = z$
FOR n = 1 TO 10
RANDOMIZE TIMER
a = INT(RND * 100)
IF a > 64 THEN b = a
IF b < 91 THEN c = b
IF a > 64 AND b < 91 THEN z$ = z$ + CHR$(b)
NEXT n
k$ = k$ + z$ + " "
j = j + 1
IF LEFT$(k$, 1) = " " THEN MID$(k$, 1) = y$
WEND
PRINT k$
k$ = ""
NEXT h
END


Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!