No need to worry about speed, works fast on a 400MHZ
Code: Select all
INPUT "Number to search for"; numtolookfor
LET search$ = "-":
WHILE numoftimes <> 999
LET num = INT(RND * 998) + 1
IF num = numtolookfor THEN timesfound = timesfound + 1
numoftimes = numoftimes + 1
'-----marker1
WEND
PRINT "The number"; numtolookfor; "was found"; timesfound; "times."
'-----marker2
If you want to store the variables, this is what you need to do:
Where marker 1 is, insert:
Code: Select all
LET SEARCH$ = SEARCH$ + LTRIM$(RTRIM$(STR$(NUM)))+"-"
Where marker 2 is, insert:
Code: Select all
INPUT "View list";yorn$
IF UCASE$(yorn$) = "Y" OR UCASE$(YORN$) = "YES" THEN PRINT SEARCH$
(the two marker spots are untested, but should work)