Qbasicnews.com
'Program to generate "sentences" random - Printable Version

+- Qbasicnews.com (http://qbasicnews.com/newforum)
+-- Forum: General (http://qbasicnews.com/newforum/forum-6.html)
+--- Forum: General/Misc (http://qbasicnews.com/newforum/forum-18.html)
+---- Forum: General Programming (http://qbasicnews.com/newforum/forum-20.html)
+---- Thread: 'Program to generate "sentences" random (/thread-10224.html)



'Program to generate "sentences" random - lrcvs - 08-20-2009

'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