Compucolor.org – Virtual Media

Listing of file='CONCEN.BAS;01' on disk='vmedia/sampler-3.31.78-sector.ccvf'

1 REM
2 REM
3 REM
4 REM
5 CLEAR 5
6 Q9= PEEK (32936)
10 SQ= 15:DL= 1
15 DIM R(SQ),V(SQ),S(1),G(1)
20 DEF FN R(X)= INT (X* RND (1)+ 1)
100 GOSUB 10000:GOSUB 11000
200 GOSUB 1000
210 PL= FN R(2)- 1
300 PL= 1- PL
310 IF M> SQTHEN 900
320 GOSUB 3000
330 IF V(G(0))+ V(G(1))= TTHEN 400
340 S(PL)= S(PL)- 1:GOSUB 2400
350 PLOT 6,5,3,28,28:PRINT "NO MATCH":GOSUB 2900
360 GOSUB 2700:GOSUB 2800
370 IF Q9< > 0THEN LOAD "MENU;1":RUN 5
390 GOTO 300
400 S(PL)= S(PL)+ 2:GOSUB 2400
410 PLOT 6,6,3,30,28:PRINT "MATCH":GOSUB 2900
420 M= M+ 2:GOSUB 2600:GOSUB 2800:IF Q9< > 7THEN 310
430 GOTO 370
899 END :REM
900 REM
998 GOTO 200
999 REM
1000 M= 0
1002 IF Q9= 0THEN 1010
1004 T= 10
1006 FOR HH= 1TO 1000:NEXT HH
1008 GOTO 1050
1010 PLOT 6,6,3,0,28:INPUT "PLEASE SELECT A NUMBER FROM 2 TO 999: ";A$
1015 IF VAL (A$)< 2OR VAL (A$)> 999THEN LOAD "MENU;1":RUN
1020 T= INT (VAL (A$)):IF T< 2OR T> 999THEN GOSUB 2950:GOTO 1010
1050 GOSUB 2000:GOSUB 2500
1099 RETURN
1999 REM
2000 PLOT 6,0,12,14,6,32
2010 FOR I= 0TO 16STEP 2:PLOT 3,13,I:PRINT SPC( 38)"":NEXT
2020 FOR Z= 0TO SQ:GOSUB 2100:NEXT
2030 PLOT 6,2,3,27,18:PRINT "SUM TO"T
2040 FOR P= 0TO 1:Q= 44* P:PLOT 17+ P,3,Q,20:PRINT "PLAYER"P+ 1"  SCORE "S(P)
2050 FOR S= 1TO 2:PLOT 3,Q,20+ S+ S:PRINT "SELECTION"S":":NEXT :NEXT
2090 RETURN
2100 GOSUB 2300:PLOT 6,52:PRINT "   "CHR$ (65+ Z)"   ":RETURN
2200 GOSUB 2300:PLOT 6,11:A$= STR$ (V(Z)):A= LEN (A$)
2210 PRINT SPC( (7- A)/ 2);A$;SPC( (8- A)/ 2)"":RETURN
2300 PLOT 3,15+ 9* (3AND Z),2+ (12AND Z):RETURN
2399 REM
2400 FOR P= 0TO 1:PLOT 6,1+ P,3,16+ 44* P,20:PRINT S(P):NEXT :RETURN
2499 REM
2500 FOR I= 0TO SQ:R(I)= I:NEXT
2510 FOR I= SQTO 1STEP - 1:J= FN R(I+ 1)- 1:K= R(I):R(I)= R(J):R(J)= K:NEXT
2520 FOR I= 0TO INT (SQ/ 2):J= FN R(T+ 1)- 1:V(R(I))= J:V(R(SQ- I))= T- J:NEXT
2530 RETURN
2599 REM
2600 FOR S= 0TO 1:V(G(S))= - 1:NEXT :RETURN
2699 REM
2700 FOR S= 0TO 1:Z= G(S):GOSUB 2100:NEXT :RETURN
2799 REM
2800 FOR S= 0TO 1:GOSUB 2850:NEXT :RETURN
2850 PLOT 6,7,3,13+ 44* PL,22+ S+ S:PRINT SPC( 5)"":RETURN
2899 REM
2900 FOR D= 1TO DL* 500:NEXT
2950 PLOT 6,0,3,0,28:PRINT SPC( 63)"":RETURN
2999 REM
3000 G(1)= - 1:FOR S= 0TO 1
3001 IF Q9= 0THEN 3010
3002 PLOT 6,7,3,13+ 44* PL,22+ S+ S:IF S= 0THEN A$= "A"
3003 IF S= 1THEN A$= "K"
3004 PRINT A$:Z= ASC (MID$ (A$,1,1))- 65
3005 GOTO 3020
3010 PLOT 6,7,3,13+ 44* PL,22+ S+ S:INPUT "";A$:Z= ASC (MID$ (A$,1,1))- 65
3020 IF Z> = 0AND Z< = SQTHEN 3100
3030 PLOT 6,5,3,19,28:PRINT "ENTER A LETTER FROM A TO "CHR$ (65+ SQ)
3040 GOSUB 2900:GOSUB 2850:GOTO 3001
3100 IF V(Z)> = 0THEN 3200
3110 PLOT 6,3,3,19,28:PRINT CHR$ (65+ Z)" HAS ALREADY BEEN MATCHED"
3120 GOTO 3040
3200 IF Z< > G(1- S)THEN 3300
3210 PLOT 6,5,3,24,28:PRINT "YOU JUST CHOSE "CHR$ (65+ Z):GOTO 3040
3300 G(S)= Z:GOSUB 2200
3390 NEXT :RETURN
9999 REM
10000 PLOT 6,6,12,14,3,20,0
10010 PRINT "C O N C E N T R A T I O N"
10020 PLOT 18,3,12,2
10030 PRINT "A GAME OF MEMORY AND SKILL FOR TWO PLAYERS"
10040 REM
10050 RETURN
10999 REM
11000 PLOT 15,3,0,6
11010 PRINT "	TO PLAY CONCENTRATION, ONE PLAYER SELECTS A NUMBER"
11020 PRINT "FROM 2 TO 999.  THIS NUMBER IS THE SUM REQUIRED FOR TWO"
11030 PRINT "POSITIONS TO MATCH."
11040 PRINT "	I'LL GENERATE 8 PAIRS OF NUMBERS THAT ADD UP TO THE"
11050 PRINT "SUM AND PLACE THEM AT RANDOM ON A PLAYING BOARD WITH"
11060 PRINT "16 LETTERED POSITIONS FROM A TO P."
11070 PRINT "	THE FIRST PLAYER (CHOSEN AT RANDOM) SELECTS TWO"
11080 PRINT "POSITIONS, ONE AT A TIME.  AS EACH POSITION IS SELECTED,"
11090 PRINT "I'LL REVEAL THE NUMBER IN THAT POSITION. THE"
11100 PRINT "PLAYER THEN SELECTS A SECOND POSITION TRYING TO FIND THE"
11110 PRINT "PAIR OF NUMBERS WHICH ADD UP TO THE ORIGINAL SUM."
11120 PRINT "IF YOU ARE SUCCESSFUL, I'LL ADD 2 TO YOUR SCORE AND"
11130 PRINT "LET YOU SELECT ANOTHER PAIR."
11140 PRINT "	IF YOU FAIL TO MATCH, I'LL TELL YOU THAT YOU HAVE"
11150 PRINT "NO MATCH, LET YOU LOOK AT THE VALUES IN BOTH POSITIONS"
11160 PRINT "FOR A SHORT TIME, AND WIPE THE NUMBERS OFF THE SCREEN."
11170 PRINT "I'LL SUBTRACT 1 FROM YOUR SCORE AND LET YOUR OPPONENT"
11180 PRINT "HAVE A CHANCE TO SELECT.  (YOU CAN TELL WHICH PLAYER IS"
11190 PRINT "SELECTING BY WATCHING THE CURSOR -- THE TWO BLINKING"
11200 PRINT "WHITE HORIZONTAL LINES.)"
11210 PRINT "	WHEN THE BOARD HAS BEEN CORRECTLY MATCHED, I'LL ASK"
11220 PRINT "FOR A NEW SUM TO BE CHOSEN, AND GENERATE A NEW GAME."
11999 RETURN