I suppose that this could have been called STARS AND STRIPES, the difference as you will see when you run this colourful eye test.
Two pictures, composed of stars and stripes, in red, white and blue appear on the screen, and you will be asked to identify which of the items is different.
How to play
Items are keyed as follows:
Red Stripe | 1 |
White stripe | 2 |
Blue stripe | 3 |
Red star | 4 |
White star | 5 |
Blue star | 6 |
To help you, numbers previously keyed in are displayed in brackets. When all the numbers required have been keyed in a further tune will be played. Just hope that it is high pitched for a correct answer.
To continue, or stop, press Y or N or RETURN.
At conclusion you will see your score sheet showing tries, correct answers and time/average taken.
Programming hints
YOU might find the routine PROC_STAR useful in your non-commercial programs as it draws a star. You just have to specify the bottom left-hand corner of the star (X,Y), the width of the bottom of the star (W), the height of the star (H) and the colour that it is to be displayed in
(CL).
You could make the puzzle easier by increasing the range of possible values for the shapes that are going to be different. The function FNM(MIN,MAX) is used to define the minimum and maximum value of any shape. Remember if you increase the MAX value you must reduce MIN by the same value, or the picture will extend beyond the allocated area.
10 REM SPOT THE DIFFERENCE 20 REM COPYRIGHT (C) G.LUDINSKI 1983 30 MODE5:VDU23;8202;0;0;0;19,1,0;0;19 ,2,0;0;19,3,0;0; 40 DIM WH(6),AN$(6) 50 60 TIME=0:CR=0:NQ=0 70 GOTO240 80 REM 90 REM RANDOM NUMBER IN RANGE 100 REM 110 DEF FNM(MIN,MAX)=INT((MAX-MIN)*RND (1)+MIN) 120 REM 130 REM U.D.G. CALCULATOR 140 REM 150 DEF FNB(N$) 160 TF=0 170 FOR L=0 TO 7 180 TF=TF+(2^L)*VAL(MID$(N$,8-L,1)) 190 NEXTL 200 =TF 210 REM 220 REM STARS AND STRIPES 230 REM 240 VDU23,224,30,30,30,30,30,30,30,30 250 VDU23,225,0,FNB("00010000"),FNB("0 0111000"),FNB("11111110"),FNB("01111100" ),FNB("01101100"),FNB("11000110"),FNB("1 0000010") 260 RI$=CHR$(224):ST$=CHR$(225) 270 REM 280 REM START 290 REM 300 CLS 310 NQ=NQ+1 320 REM 330 REM FRAMEWORK 340 REM 350 GCOL 0,3:COLOUR3:COLOUR128 360 MOVE0,256:DRAW1279,256 370 DRAW1279,1023:DRAW0,1023:DRAW0,256 380 MOVE640,256:DRAW640,1023 390 REM 400 REM DRAW PATTERNS 410 REM 420 NZ=0 430 FOR I=1 TO 6 440 WH(I)=INT(2*RND(1)) 450 IF WH(I)=1 THEN NZ=NZ+1 460 NEXTI 470 IFNZ=0 THEN GOTO430 480 FOR S=0 TO 1 490 FOR J=1 TO 3 500 IF S<>0 THEN GOTO580 510 X=FNM(J*160-80,160*(J+1)-80) 520 W=FNM(20,80) 530 IJ=J 540 CL=J:IF J=2 THEN CL=3 550 IF J=3 THEN CL=2 560 PROC_STRIPE(X,W,CL) 570 PROC_STRIPE(X+640+(WH(IJ)*FNM( 20,40)),W+(WH(IJ)*FNM(20,40)),CL) 580 IF S<>1 THEN GOTO680 590 X=FNM(160,480) 600 Y=FNM(256,896) 610 W=FNM(80,2*(640-X)/3) 620 H=FNM(128,768-Y) 630 IJ=J+3 640 CL=J:IF J=2 THEN CL=3 650 IF J=3 THEN CL=2 660 PROC_STAR(X,Y,W,H,CL) 670 PROC_STAR(X+640+(WH(IJ)*FNM(20 ,40)),Y+(WH(IJ)*FNM(20,40)),W+(WH(IJ)*FN M(20,40)),H+(WH(IJ)*FNM(20,40)),CL) 680 NEXT J 690 NEXT S 700 REM 710 REM QUESTION 720 REM 730 PRINTTAB(0,25)"Which are different ?";:COLOUR1:PRINT" 1. ";RI$;:COLOUR3:P RINT" 2. ";RI$;:COLOUR2:PRINT" 3. ";RI$ 740 COLOUR1:PRINT" 4. ";ST$;:COLOUR3 :PRINT" 5. ";ST$;:COLOUR2:PRINT" 6. ";ST $ 750 VDU19,1,1;0;19,2,4;0;19,3,7;0;:PRO C_ANSWER 760 COLOUR3 770 IR$="" 780 FOR I=1 TO (LEN(A$)+1)/2 790 I$=INKEY$(0):IF I$="" THEN GOTO7 90 800 PRINTI$;" (";IR$;")"; 810 KI=0 820 FOR K=1 TO NA 830 IF I$=AN$(K) THEN AN$(K)="0":K I=1:SOUND 1,-15,101,10:IR$=IR$+I$ 840 NEXT K 850 IF K-0 THEN PRINT" X" ELSE PRINT 860 RB$=INKEY$(100):VDU11:PRINT" ":VDU11 870 NEXT I 880 FOR I=1 TO NA 890 IF AN$(I)<>"0" THEN GOTO 920 900 NEXTI 910 GOTO 930 920 PRINT'"No, ans=";A$:SOUND 1,-15,73 ,10:SOUND 1,-15,69,5:GOTO940 930 PRINT'"Yes, you're right":SOUND 1, -15,101,30:CR=CR+1 940 PRINT'"More (Y/N)"; 950 INPUT R$:VDU19,1,0;0;19,2,0;0;19,3 ,0;0; 960 IF R$<> "N" THEN GOTO 300 970 REM 980 REM SCORE SHEET 990 REM 1000 CLS:PRINT:PRINT"Spot the differenc e":FOR I=1 TO 9:PRINT:NEXTI 1010 PRINT:PRINT"Puzzles attempted=";NQ 1020 PRINT:PRINT"Puzzles correct=";CR 1030 PRINT:PRINT"Time taken=";INT(TIME/ 100):PRINT"secs" 1040 IF CR<>0 THEN PRINT:PRINT"Time/puz zle=";INT(TIME/(CR*100)):PRINT"secs" 1050 PRINTTAB(0,25);:VDU19,3,7;0;:END 1060 DEFPROC_STRIPE(X,W,CL) 1070 GCOL 0,CL 1080 MOVE X,256:MOVE X+W,256 1090 PLOT 85,X,1024 1100 PLOT 85,X+W,1024 1110 ENDPROC 1120 DEFPROC_STAR(X,Y,W,H,CL) 1130 GCOL 0,CL 1140 MOVE X+(W/2),Y+(H/3) 1150 MOVE X,Y:PLOT 85,X+(W/2),Y+H 1160 MOVE X+(W/2),Y+(H/3) 1170 MOVE X+W,Y:PLOT 85,X+(W/2),Y+H 1180 MOVE X+(W/2),Y+(H/3) 1190 MOVE X-(W/2),Y+(2*H/3):PLOT 85,X+( 3*W/2),Y+(2*H/3) 1200 ENDPROC 1210 DEFPROC_ANSWER 1220 A$="":IM=0 1230 FOR L=1 TO 6 1240 IF WH(L)=1 THEN IM=IM+1:AN$(IM)= STR$(L):A$=A$+STR$(L)+"," 1250 NEXT L 1260 A$=LEFT$(A$,LEN(A$)-1) 1270 NA=IM 1280 ENDPROC 1290 REM