STATSPAINTER


YOU are the director of Rockets Unlimited, and yesterday you were very pleased in the way the company was going. Then these officious accountants came, studied the figures and reckoned you were making a loss.

All weekend the sales figures are preying on your mind. Even while you are painting the fence you are trying to find out where the accountants went wrong. Sometimes you get so lost in thought that you end up painting the bird on the fence. If you do, it chirps in disapproval. If you can work accurately and quickly, you will find out where the accountants went wrong, and you will be able to prove to them that Rockets Unlimited is the success you always knew it was.


How to play

The questions are on the modes and medians of a given set of numbers. The mode of a set of numbers is the number occurring most frequently. The median of a set of numbers is the middle number. The numbers are arranged in ascending order. Just key in the answer without pressing RETURN.

If you're right you may move on to the next question by pressing RETURN. If you are wrong, or take too long to answer, the bird ends up by getting painted. After nine consecutive correct answers you find out where the accountants went wrong.

Programming hints

You can make the program easier by allowing more time to answer each question. To do this increase the 30 in line 370.

If you wish to use the graphics but to set different types of questions, replace procedures PROC_STAT, PROC_ MODE and PROC_MEDIAN. Assign the question to Q$, the answer to A$ and the hint to H$. Questions in this program must have answers one digit or letter long. This
could be changed though by changing the input routine at line 370.


   10 REM STATS PAINTER
   20 REM COPYRIGHT (C) G.LUDINSKI 1983
   30 MODE5:VDU23;8202;0;0;0;
   40 DIM D(15),C(5)
   50 CLS
   60 VDU 19,0,4,0,0,0,19,2,2,0,0,0
   70 GOTO 200
   80 REM
   90 REM U.D.G. CALCULATOR
  100 REM
  110 DEF FNB(N$)
  120 TF=0
  130 FOR L=0 TO 7
  140 TF=TF+(2^L)*VAL(MID$(N$,8-L,1))
  150 NEXT L
  160 =TF
  170 REM
  180 REM BIRD SHAPE
  190 REM
  200 VDU 23,224,FNB("01100000"),FNB("11
100000"),FNB("00110000"),FNB("00111000")
,FNB("00111100"),FNB("00011110"),FNB("00
001011"),FNB("00001011")
  210 REM
  220 REM DRAW FENCE
  230 REM
  240 FORJ=1 TO 9
  250 COLOUR128:CLS
  260 GCOL 0,2:PROC_BLOCK(0,0,1280,450)
  270 GCOL 0,3
  280 FOR I=0 TO 1240 STEP 100
  290 PROC_BLOCK(I,400,50,200)
  300 NEXT I
  310 PROC_BLOCK(0,420,1280,20):PROC_BLO
CK(0,550,1280,20)
  320 COLOUR3:COLOUR128:PRINTTAB(19,12);
CHR$(224)
  330 COLOUR3:COLOUR130
  340 PROC_STAT
  350 PRINTTAB(0,21);Q$
  360 GCOL0,1:I=-100:I$="":ID=0
  370 I$=INKEY$(30):IF I$="" OR ID=1 THE
N I=I+100:PROC_BLOCK(I,400,50,200):IF I<
1140 THEN GOTO 370
  380 IF I$=A$ AND ID=0 THEN PRINT''"Yes
, you're right":GOTO420
  390 IF I<1000 THEN PRINT I$;:ID=1:GOTO
370
  400 COLOUR1:COLOUR128:PRINTTAB(19,12);
CHR$(128):FORII=1TO3:SOUND1,-15,250,4:SO
UND1,0,0,1:SOUND1,-15,250,4:SOUND1,0,0,2
:NEXT:COLOUR3:COLOUR130
  410 PRINTTAB(0,26);"No,";H$
  420 COLOUR3:PRINTTAB(0,30)"Hit Return 
for more";:INPUT RB$
  430 IF I$<>A$ THEN 250
  440 NEXTJ
  450 PRINTTAB(0,27)"Eureka! You found  
 it. Get on the phonequick!             
";:GOTO810
  460 REM
  470 DEFPROC_BLOCK(X,Y,W,H)
  480 MOVE X,Y:MOVE X+W,Y
  490 PLOT 85,X,Y+H
  500 PLOT 85,X+W,Y+H
  510 ENDPROC
  520 DEFPROC_STAT
  530 MC=0:DN=1:MO=0:W=RND(2)
  540 FORI=1TO5
  550   C(I)=INT(RND(1)*4):IF C(I)=MC TH
EN 550
  560   IF C(I)>MC THEN MC=C(I):MO=I
  570   IF C(I)=0 THEN 620
  580   FOR JJ=DN TO DN+C(I)-1
  590     D(JJ)=I
  600   NEXTJJ
  610   DN=DN+C(I)
  620 NEXTI
  630 IF DN/2=INT(DN/2) THEN DN=DN+1:D(D
N)=6
  640 D$="":FORI=1TODN:D$=D$+STR$(D(I))+
",":NEXT:D$=LEFT$(D$,(DN*2)-1)
  650 TH$="th":MM=INT(DN/2)+1:IF MM=1 TH
EN TH$="st"
  660 IF MM=2 THEN TH$="nd"
  670 IF MM=3 THEN TH$="rd"
  680 IF W=1 THEN PROC_MODE
  690 IF W=2 THEN PROC_MEDIAN
  700 ENDPROC
  710 DEFPROC_MODE
  720 Q$="What is the mode of "+D$
  730 A=MO:A$=STR$(MO)
  740 H$="there are more  "+A$+"s"
  750 ENDPROC
  760 DEFPROC_MEDIAN
  770 Q$="What is the median  of "+D$
  780 A=D(1+INT(DN/2)):A$=STR$(A)
  790 H$=A$+" is middle no."
  800 ENDPROC
  810 END