home *** CD-ROM | disk | FTP | other *** search
- 10 CLS
- 20 PRINT "Do you wish to read documentation before proceeding ? (Y/N) ";
- 30 S$ = INKEY$
- 40 IF S$ = "" THEN GOTO 30
- 50 IF S$ = "y" OR S$ = "Y" THEN GOSUB 740
- 60 PRINT
- 70 CLEAR
- 80 CLS
- 90 INPUT "Enter a number to represent bottom of range : ",B
- 100 INPUT "Enter a number to represent top of range : ",T
- 110 IF T >0 AND B >T THEN GOTO 120 ELSE GOTO 130
- 120 PRINT:PRINT "Top of rang must be greater than bottom of range.":GOSUB 1080:GOTO 60
- 130 IF T >9999999! THEN GOTO 140 ELSE GOTO 150
- 140 PRINT:PRINT "Number entered for top of range is out of processing range.":GOSUB 1080:GOTO 60
- 150 IF B >9999999! THEN GOTO 160 ELSE GOTO 170
- 160 PRINT:PRINT "Number entered for bottom of range is out of processing range.":GOSUB 1080:GOTO 60
- 170 IF T >0 AND B >0 THEN GOTO 200
- 180 INPUT "Enter number of digits for output : ",D%
- 190 IF T <=0 THEN GOTO 320
- 200 IF T >0 THEN GOSUB 570
- 210 IF B >0 THEN GOSUB 650
- 220 IF T >0 AND D% >E% THEN GOTO 230 ELSE GOTO 250
- 230 PRINT:PRINT "Number of digits for output must not excede the number of digits in"
- 240 PRINT "the top range entry." :GOSUB 1080:GOTO 60
- 250 IF T >0 AND D% =E% THEN GOTO 320
- 260 GOSUB 540
- 270 M = I*10+1
- 280 P = INT(M)
- 290 IF T >0 AND P >E% THEN GOTO 250
- 300 IF B >0 AND P <L% THEN GOTO 250
- 310 D% = P
- 320 FOR W = 1 TO D%
- 330 GOSUB 540
- 340 V = V + (I*10^W)
- 350 NEXT W
- 360 N = INT(V)
- 370 IF B = 0 AND T = 0 THEN GOTO 450
- 380 IF N <B THEN GOTO 430
- 390 IF T >0 AND N >T THEN GOTO 430
- 400 IF N >=B THEN GOTO 410 ELSE GOTO 430
- 410 IF T >0 THEN GOTO 420 ELSE GOTO 450
- 420 IF N <=T THEN GOTO 450 ELSE GOTO 430
- 430 V = 0
- 440 GOTO 320
- 450 PRINT N
- 460 PRINT "Would you like to try another set of numbers ? (Y/N) ";
- 470 A$ = INKEY$
- 480 IF A$ ="" THEN GOTO 470
- 490 IF A$ = "Y" OR A$ ="y" THEN GOTO 60
- 500 IF A$ = "N" OR A$ = "n" THEN CLS
- 510 PRINT "Controled Random Number Generator by J. Johnson"
- 520 PRINT "Copyright 1992 Red Moon Software"
- 530 END
- 540 RANDOMIZE TIMER
- 550 I = RND(X)
- 560 RETURN
- 570 IF T <=9999999! THEN E% = 7
- 580 IF T <=999999! THEN E% = 6
- 590 IF T <=99999! THEN E% = 5
- 600 IF T <=9999 THEN E% = 4
- 610 IF T <=999 THEN E% = 3
- 620 IF T <=99 THEN E% = 2
- 630 IF T <=9 THEN E% = 1
- 640 RETURN
- 650 IF B <=9999999! THEN L% = 7
- 660 IF B <=999999! THEN L% = 6
- 670 IF B <=99999! THEN L% = 5
- 680 IF B <=9999 THEN L% = 4
- 690 IF B <=999 THEN L% = 3
- 700 IF B <=99 THEN L% = 2
- 710 IF B <=9 THEN L% = 1
- 720 RETURN
- 730 PRINT:PRINT:PRINT:PRINT:PRINT
- 740 PRINT:PRINT:PRINT:PRINT:PRINT
- 750 PRINT " This program will generate a random number defined by your input to the"
- 760 PRINT " initial program prompts. The first of which will ask you for a number"
- 770 PRINT " representing the bottom of the user defined range (lowest number to accept)."
- 780 PRINT " The second will ask for a number to represent the top of the range (highest"
- 790 PRINT " number to accept). The third will ask for the number of digits required for"
- 800 PRINT " output (how many digits do you need ?). If you provide input to both the"
- 810 PRINT " first and second prompts, the the third prompt will not appear."
- 820 PRINT
- 830 PRINT " You may wish to skip one of the first two prompts to create a lower or"
- 840 PRINT " higher bound to the output. For instance, if you wanted a three digit number"
- 850 PRINT " that is not lower than 25, then you would answer the first prompt with 25,"
- 860 PRINT " leave the second prompt empty (press the ENTER key), and enter 3 to the third"
- 870 PRINT " prompt. If you wanted a 2 digit number that is no higher than 80, then you"
- 880 PRINT " would leave the first prompt empty, enter 80 to the second prompt, and enter"
- 890 PRINT " 2 to the third prompt."
- 900 PRINT
- 910 PRINT " To create a hi/low range for the generated number, just enter the low"
- 920 PRINT " number at the first prompt and the high number at the second prompt. To"
- 930 PRINT " create any 5 digit number, leave the first 2 prompts empty and enter 5 to the"
- 940 PRINT " the third prompt."
- 950 PRINT:GOSUB 1080
- 960 PRINT:PRINT : PRINT "Limitations:"
- 970 PRINT:PRINT " - Bottom and Top of range inputs cannot excede 9,999,999."
- 980 PRINT:PRINT " - Top of range value must be higher than the value of the bottom"
- 990 PRINT " range."
- 1000 PRINT:PRINT " - The number of digits required for output cannot excede the"
- 1010 PRINT " number of digits in the top of range value."
- 1020 PRINT:PRINT " - Tight ranges (i.e. bottom range = 3 and top of range = 6) will"
- 1030 PRINT " require a much longer period of time to process than wide ranges"
- 1040 PRINT " (i.e. bottom of range = 120 and top of range =1000).
- 1050 PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT
- 1060 PRINT:GOSUB 1080
- 1070 RETURN
- 1080 PRINT:PRINT "Press any key to continue...";
- 1090 S$ = INKEY$
- 1100 IF S$ = "" THEN GOTO 1090
- 1110 RETURN