Category : BASIC Source Code
Archive   : FLESHOFF.ZIP
Filename : FLESHOFF.ASC

 
Output of file : FLESHOFF.ASC contained in archive : FLESHOFF.ZIP
100 REM Fleshler-Hoffman Number Generator
110 REM implementation by RFG
120 REM ---------------------------------------------------------------------
130 REM REF:
140 REM Fleshler, M., and Hoffman, H.S. (1962) A progression for generating
150 REM variable interval schedules. Journal of the Experimental Analysis
160 REM of Behavior, 5, 529-530.
170 REM ---------------------------------------------------------------------
180 REM C is a number counter for screen pauses
190 C=0
200 C1$=CHR$(15)+CHR$(29)
210 C2$=CHR$(46)
220 CLS
230 PRINT " *** FLESHLER-HOFFMAN SEQUENCE GENERATOR ***"
240 PRINT
250 INPUT "Enter number of samples";N
260 INPUT "Enter mean sample value";M
270 CLS
280 PRINT"Generating distribution.";
290 DIM I(N)
300 L=M
310 GOSUB 750
320 FOR X=1 TO N
330 IF (X/10)=INT(X/10) THEN PRINT C1$;
340 REM The next two statement avoids a log(0) error
350 Z=N-X
360 IF Z=0 THEN Z=.000001
370 I(X)=M*(1+LOG(N)+(Z)*LOG(Z)-(N-X+1)*LOG(N-X+1))
380 REM Approximate round to thousandths
390 I(X)=INT((I(X)+.0005)*1000)/1000
400 IF (X/20)=INT(X/20) THEN SOUND 349,1:PRINT C2$;
410 REM Figure mean and range of distribution
420 T=T+I(X)
430 IF L>I(X) THEN L=I(X)
440 IF H 450 NEXT X
460 CLS
470 GOSUB 750
480 FOR X=1 TO N
490 PRINT I(X),
500 C=C+1
510 IF C=110 THEN GOSUB 670
520 NEXT X
530 GOSUB 670
540 PRINT
550 PRINT"Mean of distribution =";T/N;
560 PRINT" Range of distribution is ";L;"-";H
570 PRINT
580 GOSUB 750
590 GOSUB 750
600 PRINT
610 PRINT
620 PRINT " -- Do you want to generate another distribution [Y/N] ? --";
630 A$=INKEY$
640 IF A$="" THEN 630
650 IF A$="Y" OR A$="y" THEN RUN ELSE 660
660 END
670 REM Wait for a keypress subroutine
680 C=0
690 PRINT
700 PRINT" ";
710 GOSUB 750
720 IF INKEY$="" THEN 720
730 CLS
740 RETURN
750 REM Audio signal subroutine
760 SOUND 261,1:SOUND 523,1
770 RETURN


  3 Responses to “Category : BASIC Source Code
Archive   : FLESHOFF.ZIP
Filename : FLESHOFF.ASC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/