10 COMMON DK$, VERSION$   :REM - COMMON VARIABLES FOR CHAINING TO INSTRUCTIONS
20 VERSION$="WHEEL-EX.BAS"
30 CLS$=CHR$(26)           	:REM - CLEAR SCREEN
40 ESC$=CHR$(27)		:REM - ESCAPE
50 SET$=ESC$+"s"		:REM - `SET' USED TO SET WINDOWS
60 H$=CHR$(96)			:REM - `BLOCK' GRAPHIC CHARACTER
70 REM ----------------------------------
80 REM  DEFINE VARIOUS EXECUTIVE WINDOWS
90 REM
100 W0$=ESC$+"s"+"0"		:REM - SET WINDOW "0" (FULL SCREEN)
110 PRINT ESC$+"z"+"1"+CHR$(10+32)+CHR$(42+32)+CHR$(11+32)+CHR$(61+32) :REM- #1
120 PRINT ESC$+"z"+"2"+CHR$(10+32)+CHR$(62+32)+CHR$(11+32)+CHR$(80+32) :REM- #2
130 PRINT ESC$+"z"+"3"+CHR$(11+32)+CHR$(0+32)+CHR$(24+32)+CHR$(80+32)  :REM- #3
140 PRINT ESC$+"z"+"4"+CHR$(8+32)+CHR$(62+32)+CHR$(14+32)+CHR$(80+32)  :REM- #4
150 REM ----------------------------------
160 REM   `SIGN ON MESSAGE'
170 PRINT W0$
180 PRINT CLS$
190 PRINT TAB(30) ESC$+"g" H$H$H$H$H$H$H$H$H$H$H$H$H$H$H$H$H$H$H$H$H$ ESC$+"G"
200 PRINT TAB(30) ESC$+"g" H$H$H$H$H$H$H$ ESC$+"G" " WHEEL " ESC$+"g" H$H$H$H$H$H$H$ ESC$+"G"
210 PRINT TAB(30) ESC$+"g" H$H$H$H$H$H$H$H$H$H$H$H$H$H$H$H$H$H$H$H$H$ ESC$+"G"
220 PRINT:PRINT:PRINT:PRINT TAB(19) "Osborne Executive, Version EXC 1.0, 1/20/86
230 PRINT:PRINT:PRINT:PRINT TAB(30) ESC$+"g" CHR$(19) ESC$+"G" " By D. D. Harrington
240 PRINT TAB(30) "Hoosier Osborne Group
250 FOR Z=1 TO 8:PRINT:NEXT
260 INPUT "Which Drive contains the `WHEEL' game and `Data' disk (A/B) :";DK$
270 IF DK$="" THEN 260
280 IF ASC(DK$)>91 THEN DK$=CHR$(ASC(DK$)-32)	:REM- CONVERT TO UPPER CASE
290 'IF DK$<>"A" AND DK$<>"B" THEN PRINT "Enter A or B": GOTO 260
300 INPUT"DO YOU NEED INSTRUCTIONS (Y/N)";YN$
310 IF YN$="Y" OR YN$="y" THEN 320 ELSE 330
320 CHAIN DK$+":WHEEL.INS",ALL
330 REM ----------------------------------
340 PRINT W0$			:REM - SET WINDOW "0" (FULL SCREEN)
350 REM- ROUTINE TO GET NEW PLAYERS NAMES
360 PRINT CLS$
370 INPUT "HOW MANY PLAYERS: ";Y%
380 IF Y%<1 THEN PRINT "ENTER THE `NUMBER' OF PLAYER":GOTO 370
390 REM ----------------------------------
400 REM- ROUTINE TO SELECT NUMBER OF GAMES `GM' TO PLAY
410 REM
420 PRINT:INPUT "HOW MANY GAMES DO YOU WANT TO PLAY IN THIS ROUND";GM
430 IF GM<1 THEN PRINT "ENTER `NUMBER' OF GAMES":GOTO 420
440 G1=1			:REM- SET INITIAL GAME = #1
450 REM -----------------------------------
460 REM- ROUTINE TO GET NAMES OF PLAYERS
470 REM
480 PRINT
490   FOR PX= 1 TO Y%
500	PRINT "ENTER NAME OF PLAYER #"PX" BELOW:"
510	INPUT PL$(PX)
520   NEXT
530  PRINT:PRINT
540 REM ----------------------------------
550 REM- INITIALIZE NEW GAME
560 REM
570  PRINT TAB(13) ESC$+"j" "PLEASE STANDBY WHILE NAMES ARE SAVED AND RANDOMIZED" ESC$+"k"
580  GOSUB 3500       :REM- SUBROUTINE TO RANDOMIZE PLAYERS TO BE SELECTED
590  PRINT:PRINT TAB(26) ESC$+")" ESC$+"^"ESC$+"j" " PLAYER #";PX;" WILL GO FIRST. " ESC$+"k" ESC$+"q" ESC$+"(" :FOR K=1 TO 3000:NEXT
600  CT%= 1	:REM- CT% IS PLAYER INPUT LETTER CKECKER. INITIALLY SET TO 
610		 REM-    ZERO SO CPU WILL PRINT BLANKS ON SCREEN
620 REM------------------------------------
630  PRINT:PRINT TAB(19) ESC$+"j" "PLEASE STANDBY FOR SELECTION OF CATEGORY" ESC$+"k"
640 REM ------------------------------------------------
650  DIM UL(26)	:REM- ARRAY FOR USED LETTERS = A, B, C, ..... Z (26 LETTERS)
660 REM
670 REM --------------------------------
680 REM- ROUINTE TO SELECT CATEGORY
690 REM
700  GOSUB 3380     :REM- GO GET RANDOM NUMBER
710  RD=INT(8*RND)	:REM- `8' CATAGORIES
720  IF RD >8 OR RD <=0 THEN 700
730 REM- USE RANDOM (RD) TO SELECT FILE$ (CATEGORY) TO OPEN
740  IF RD=1 THEN FILE$ ="TITLE"
750  IF RD=2 THEN FILE$ ="EVENT"
760  IF RD=3 THEN FILE$ ="PEOPLE"
770  IF RD=4 THEN FILE$ ="PHRASE"
780  IF RD=5 THEN FILE$ ="PLACE"
790  IF RD=6 THEN FILE$ ="THING"
800  IF RD=7 THEN FILE$ ="PERSON"
810  IF RD=8 THEN FILE$ ="QUOTE"
820 REM ---------------------------------
830 REM- ROUTINE TO 1st GET NUMBER OF RECORDS (I%) FROM DISK FILE,
840 REM  THEN TO READ INDIVIDUAL RECORDS (D$) FROM DISK FILE
850 REM
860  REM- OPEN UP SEQUENTIAL FILE NAMED FILE$
870	OPEN "I", #1, DK$+":"+ FILE$+".DAT"
880	  REM- 1st `RECORD' GIVES NUMBER OF RECORDS IN FILE
890		INPUT #1, I%     :REM- I% = NUMBER OF RECORDS IN FILE
900	  REM- NOW READ INDIVIDUAL RECORDS INTO ARRAY D$(Z)
910	 	DIM D$(I%)
920		FOR Z = 1 TO I%
930			INPUT #1, D$(Z)
940		NEXT Z
950	CLOSE #1
960 REM ----------------------------------
970 REM- ROUTINE TO SELECT ONE OF RECORDS FROM FILE$ FOR GAME
980 REM  USING RANDOM NUMBER
990 REM
1000   GOSUB 3380     :REM- GET RANDOM NUMBER
1010   IR%= I%         :REM- IR% USED TO GENERATE RANDOM NUMBER
1020  REM- GENERATE RANDOM NUMBER
1030   RD=INT(IR%*RND)
1040   IF RD > I% OR RD <=0 THEN 1000 :REM- SEE IF EXCEEDS NUMBER OF RECORDS; IF SO GET NEW RANDOM NUMBER
1050  REM- SET CATEGORY ITEM C$ = TO SELECTED RECORD (D$(RD))
1060   C$ = D$(RD)
1070 REM -----------------------------------
1080 REM- ROUTINE TO COUNT NUMBER OF CHARACTERS IN SELECTED ITEM C$
1090 REM
1100   L%=LEN(C$)
1110 REM -----------------------------------
1120 REM- DEMINSION ARRAY A$ EQUAL TO NUMBER OF CHARACTERS IN ITEM C$ AND
1130 REM  PUT IN ITEM C$ (NEED THIS ARRAY FOR COMPARISON TO ARRAY W$ BELOW)
1140 REM
1150   DIM A$(L%)
1160   FOR K=1 TO L%
1170       A$(K)= MID$(C$,K,1)
1180   NEXT K
1190 REM -----------------------------------
1200 REM- DEMINSION 2nd ARRAY W$ EQUAL TO NUMBER OF CHARACTER IN ITEM C$
1210 REM  TO BE USED TO PUT IN `BLANKS', HYPHENS, ETC FOR SCREEN DISPLAY
1220 REM
1230   DIM W$(L%)
1240   FOR K=1 TO L%
1250    REM
1260   REM- IF CHARACTER IN C$ IS A `LETTER', PRINT A `BLANK' ON SCREEN
1270    IF MID$(C$,K,1)>=CHR$(65) AND MID$(C$,K,1)<=CHR$(90) THEN W$(K)=CHR$(95)
1280   REM- IF CHARACTER IN C$ IS A `DASH', PRINT A `DASH'
1290    IF MID$(C$,K,1) = CHR$(45) THEN W$(K)=CHR$(45)
1300   REM- IF CHARACTER IN C$ IS A `HYPHEN', PRINT A `HYPHEN'
1310    IF MID$(C$,K,1) = CHR$(39) THEN W$(K)=CHR$(39)
1320   REM- IF CHARACTER IN C$ IS A `SPACE', PRINT A `SPACE'
1330    IF MID$(C$,K,1) = CHR$(32) THEN W$(K)=CHR$(32)
1340  NEXT
1350 REM ----------------------------------
1360 REM- ROUTINE TO PRINT CURRENT PLAYER & WINNINGS ON SCREEN
1370 REM
1380   TU$=""		:REM- RESET TU$ `BANKRUPT/LOSE TURN' = `NULL'
1390   GOSUB 4020	:REM- GET NEW VALUE S1% FOR EACH CORRECT LETTER
1400   PRINT CLS$
1410   PRINT W0$	:REM- SET WINDOW #0
1420   PRINT CLS$	:REM- CLEAR SCREEN FOR NEXT PLAYER IF USE WINDOWS
1430   GOSUB 5380      :REM- WINDOW #4 & PRINT "WHEEL VALUE"
1440   PRINT W0$	:REM- SET WINDOW #0
1450   PRINT "CURRENT PLAYER: "ESC$+"^" ESC$+"l" ;PL$(PX) ESC$+"q" ESC$+"m"  ; TAB(67) "GAME #";G1
1460   PRINT "CURRENT SCORE SO FAR THIS ROUND: $";S1%(PX)
1470 REM ----------------------------------
1480 REM- ROUTINE TO PRINT BLANKS AND CHARACTERS ON SCREEN
1490 REM- CT%= 0 WHEN PLAYER READY TO INPUT A LETTER
1500 REM- GOSUB 47000	:REM- WINDOW #0
1510   PRINT:PRINT
1520   PRINT TAB(15)
1530   FOR K=1 TO L%
1540	   IF W$(K)=CHR$(95) AND A$(K)=N$ THEN CT%=1  :REM- CORRECT GUESS !!
1550	   IF W$(K)=CHR$(95) AND A$(K)=N$ THEN W$(K)=N$
1560	   IF W$(K)=CHR$(95) AND W$(K)<>N$ THEN W$(K)=CHR$(95)
1570	   IF W$(K)=CHR$(39) THEN W$(K)=CHR$(39)
1580	   IF W$(K)=CHR$(32) THEN W$(K)=CHR$(32)
1590	   PRINT W$(K);                                :REM- THIS PRINT THE CHARACTER
1600   NEXT K
1610 REM -----------------------------
1620 REM- ROUTINE TO PRINT CATEGORY
1630 REM
1640   PRINT:PRINT
1650   PRINT TAB(15)
1660   PRINT "CATEGORY: ";FILE$
1670 REM -----------------------------
1680 REM- ROUTINE TO ASK PLAYER TO SPIN WHEEL
1690 REM
1700   IF CT%= 0 THEN 2200	  :REM- INCORRECT LETTER INPUT
1710   IF SI%(PX)= 0 AND CK$= "ONLY VOWELS REMAINING" THEN GOTO 2050
1720 REM -----------------------------
1730   PRINT
1740   INPUT "DO YOU WANT TO `SOLVE' IT  (Y/N): ";YN$
1750   IF YN$="y" THEN YN$="Y"
1760   IF YN$<>"Y" THEN N$= ""	     :REM- RESET FOR PREVIOUS VOWEL ENTRY
1770   IF YN$<>"Y" THEN SP$= "SPINNING WHEEL --->"
1780   IF YN$="Y" THEN GOSUB 4760    :REM- PRINT USED LETTERS
1790   IF YN$="Y" THEN 2400
1800 REM -----------------------------
1810 REM- ROUTINE TO ASK PLAYER IF WANTS TO
1820 REM  BUY VOWEL IF HE HAS AT LEAST $200
1830 REM
1840  IF S1%(PX)>199 THEN 1860 ELSE 1910
1850 REM PRINT
1860  INPUT "DO YOU WANT TO BUY A `VOWEL'  (Y/N): ";YN$
1870  IF YN$="y" THEN YN$="Y"
1880  IF YN$<>"Y"  THEN SP$= "SPINNING WHEEL --->"
1890  IF YN$="Y" THEN GOSUB 4760    :REM- PRINT USED LETTERS
1900  IF YN$="Y" THEN 2930 ELSE 1910
1910 REM -----------------------------
1920 REM- ROUTINE TO SET "SPINNING WHEEL .." MESSAGE
1930 REM  TO `NULL' ("") IF VOWEL SELECTED
1940 REM
1950  IF CT%= 0 THEN SP$= ""          :REM- DON'T PRINT "SPINNING.." IF GUESS WRONG LETTER
1960 REM ---------------------------
1970 REM- ROUTINE TP CHECK IF `ONLY VOWELS REMAINING'.
1980 REM  IF SO, PLAYER REQUIRED TO `SOLVE' QUESTION.
1990  GOSUB 4620	              :REM- SUBROUTINE TO CHECK FOR NUMBER OF VOWELS LEFT
2000  IF CK$= "ONLY VOWELS REMAINING" THEN GOSUB 4740   :REM- PRINT `USE LETTERS'
2010  PRINT
2020  IF CK$= "ONLY VOWELS REMAINING" GOTO 2410
2030 REM ----------------------------
2040 REM- PRINT "SPINNING WHEEL .." (SP$) IF APPROPRIATE
2050  GOSUB 5050		:REM- WINDOW #1, "SPINNING WHEEL" MESSAGE
2060  GOSUB 3740		:REM- GET NEW VALUE OF CONSONANT
2070  GOSUB 5140		:REM- SPIN WHEEL SUBROUTINE
2080  IF SI%(PX)= 0 AND CK$= "ONLY VOWELS REMAINING" THEN GOTO 1990
2090 REM FOR K= 1 TO 1000 :NEXT	:REM - LEAVE MESSAGE ON FOR AWHILE
2100 REM ----------------------------
2110 REM- CHECK "TU$" FOR "BANKRUPT/LOOSE TURN"
2120 REM  AND TAKE APPROPRIATE ACTION IF SO
2130  IF TU$= " BANKRUPT" THEN GOTO 4170
2140  IF TU$= "LOSE TURN" THEN GOTO 4260
2150	FOR K= 1 TO 3000 :NEXT	:REM- LEAVE MESSAGE ON FOR AWHILE
2160 REM PRINT
2170  IF CT%= 0 THEN 2200	:REM- NO PRINT VALUE IF GUESS INCORRECT
2180 REM IF NS%=1 THEN VC= VV	:REM- NS%=1 MEANS VOWEL; NO CHANGE IN VC "$";  VV= ORIGINAL VALUE (VC) OF CONSONANT BEFORE SELECTED VOWEL
2190  PRINT "VALUE OF CONSONANTS IS "ESC$+"j""$";VC ESC$+"k":REM- PRINT VALUE OF CONSONANTS
2200 REM -----------------------------
2210 REM- ROUTINE TO SEE IF PLAYER GUESSED A CORRECT LETTER. 
2220 REM  IF SO THEN THEN CT%=1 & PLAYER GETS ANOTHER GUESS.
2230  IF CT%=1 THEN 2290
2240  IF N$<>"" AND CT%<>1 THEN PRINT:PRINT:PRINT:PRINT:PRINT:PRINT ESC$+"^" " SORRY, NO LETTER `";N$;"' OR LETTER USED ALREADY ... YOU LOSE YOUR TURN ..." ESC$+"q":PRINT CHR$(7) : DP$= "" : AV$= "" :   FOR K= 1 TO 5000: NEXT
2250 REM
2260  GOSUB 3740	:REM- GET NEW VALUE FOR CONSTANT FOR NEXT PLAYER
2270  GOTO 2820	:REM- NEXT PLAYER
2280  PRINT
2290 REM -----------------------------
2300 REM- ROUTINE TO PRINT `USED LETTERS'
2310 REM
2320  GOSUB 4760	:REM- SUBROUTINE TO PRINT `USED LETTERS'
2330 REM -----------------------------
2340 REM- ROUTINE TO CHECK IF PLAYER WANTS
2350 REM  TO `SOLVE' OR ENTER A `CHARACTER'
2360 REM
2370 REM- ROUTINE TO SEE IF PLAYER WANT TO SOLVE
2380 REM PRINT:PRINT
2390  GOTO 2870	:REM- TEMPORARY BY-PASS TO REQUEST CONSONANT
2400  PRINT
2410  PRINT:PRINT ESC$+"j" "TYPE IN YOUR ANSWER `EXACTLY' BELOW USING `UPPER CASE LETTERS ONLY'" ESC$+"k"
2420  PRINT TAB(15): INPUT X$
2430 REM ------------------------------
2440 REM- CHECK IF ANSWER IS CORRECT & UPDATE PLAYERS WINNINGS
2450  IF S1%(PX)= 0 AND CK$= "ONLY VOWELS REMAINING" THEN S1%(PX)= VC
2460  IF X$=C$ THEN PRINT:PRINT TAB(20) ESC$+"^""YOU WIN !!!  $";S1%(PX) ESC$+"q"  ELSE 2770  :REM-- ELSE = "WRONG"
2470  FOR K= 1 TO 5: PRINT CHR$(7) :NEXT       :REM- RING BELL
2480  FOR K= 1 TO 4000: NEXT	:REM- LEAVE MESSAGE ON FOR AWHILE
2490	  PRINT CLS$	:REM- CLEAR SCREEN FOR NEXT CATEGORY & PLAYER
2500 REM- WINNINGS = CURRENT VALUE WN%(PX)
2510  GOSUB 4150		:REM- UPDATE WINNINGS CURRENT PLAYER
2520 REM- ALL PLAYERS START WITH $0 FOR NEXT ROUND
2530  FOR K= 1 TO Y%
2540  	S1%(K)=0
2550  NEXT
2560 REM --------------------------------
2570 REM- ADD 1 TO GM; IF MAX, THEN PRINT FINAL SCORE PLAYERS
2580 REM  G1 IS THE GAME COUNTER; GM IS MAX. NUMBER OF GAMES
2590 REM
2600  G1= G1+ 1: IF G1> GM THEN 2610 ELSE 2720
2610 REM  FOR K= 1 TO 4000: NEXT
2620 REM PRINT CHR$(26)		:REM- CLEAR SCREEN & GET NEW CATEGORY
2630  GOSUB 3660	        :REM- PRINT PLAYERS & FINAL WINNINGS
2640  INPUT"DO YOU WANT TO PLAY AGAIN (Y/N)";YN$
2650	IF ASC(YN$)>91 THEN YN$=CHR$(ASC(YN$) :REM- CONVERT TO UPPER CASE
2660  	IF YN$<>"Y" AND YN$<>"N" THEN 2640
2670	IF YN$="N" THEN PRINT SET$+"0"	:REM- SET WINDOW #0
2680    IF YN$="N" THEN END ELSE 2690
2690	CLS$:RESTORE: CLEAR: GOTO 330		:REM- CLEAR ALL & START NEW GAME
2700	GOSUB 3580	        :REM- GET NUMBER OF NEXT PLAYER
2710 REM- IF WIN THEN USE THIS ROUTINE TO GET NEW PLAYER (PL$(PX)), HIS CURRENT SCORE & NEW CATEGORY
2720	PRINT CLS$	        :REM- CHEAR SCREEN
2730	GOSUB 3580	        :REM- NEXT PLAYERS TURN
2740	ERASE D$, A$, W$, UL :N$= ""    :REM- CLEAR ARRAYS FOR NEXT ITEM
2750	GOTO 630	                :REM- SELECT NEW CATEGORY
2760 REM --------------------------------
2770	PRINT:PRINT TAB(35) ESC$+"j" ESC$+")" ESC$+"^"  " WRONG !!! " ESC$+"q" ESC$+"(" ESC$+"k"
2780	PRINT CHR$(7) CHR$(7) CHR$(7) :FOR J= 1 TO 4500 :NEXT
2790 REM --------------------------------
2800 REM- ROUTINE TO GET NEXT PLAYER
2810 REM
2820 REM	NX$= "NEW PLAYER"  :REM- USE SO `N$' NOT CARRIED OVER
2830	N$= ""		   :REM- RESET INPUT `N$' = `NULL'
2840	CT%= 1		   :REM- TEMP. RESET SO PLAYER GETS SAME QUESTION
2850	GOSUB 3580	   :REM- NEXT PLAYERS TURN
2860	GOTO 1400	   :REM- NEXT PLAYER CONTINUES ON SAME ITEM
2870 REM --------------------------------
2880   CT%= 0	:REM- SET LETTER CHECKER = 0 BEFORE NEXT PLAYER STARTS TURN
2890 REM --------------------------------
2900 REM- ROUTINE TO ALLOW SELECTION OF `VOWEL' IF PLAYER HAS $200
2910 REM
2920	GOTO 3180	:REM- TEMP BY-PASS REQUEST FOR VOWEL
2930	S1%(PX)= S1%(PX)- 200	:REM- SUTRACT 200 FROM CURRENT GAME SCORE
2940    PRINT:PRINT:  INPUT "WHICH `VOWEL' DO YOU WANT: ";N$
2950	IF ASC(N$)>91 THEN N$=CHR$(ASC(N$)-32)  :REM- CONVERT TO UPPER CASE
2960	IF N$= "" THEN 2940	:REM- NEEDS TO ENTER SOMETHING
2970	IF N$<>"A" AND N$<>"E" AND N$<>"I" AND N$<>"O" AND N$<>"U" THEN GOTO 3090
2980 REM --------------------------------
2990 REM- ROUTINE TO CHECK & ADD CHARACTERS TO `USED LETTER' ARRAY
3000 REM
3010	GOSUB 4380	:REM- SUBROUTINE FOR USED LETTER ARRAY `UL'
3020	GOSUB 4840	:REM- SUBROUTINE TO CHECK FOR `DUPLICATE VOWEL' INPUT
3030	GOSUB 4970	:REM- SUBROUTINE TO CHECK `ABSENTS OF VOWEL' INPUTED
3040   IF DP$="DUPLICATE" THEN PRINT ESC$+"^" "THAT VOWEL HAS BEEN USED BEFORE... SORRY ";PL$(PX)" ... YOU LOSE YOUR TURN ..." ESC$+"q":GOTO 3110
3050	GOTO 1350
3060 REM --------------------------------
3070 REM- ERROR MESSAGE & LOSS OF TURN IF ASKED FOR VOWEL & INPUT CONSONANT
3080 REM
3090   PRINT:PRINT ESC$+"^" "YOU INDICATED YOU WANTED A VOWEL ...."
3100   PRINT:PRINT "SORRY ";PL$(PX)", YOU LOSE YOUR TURN ..." ESC$+"q"
3110	PRINT CHR$(7)	          :REM- RING BELL
3120	FOR K= 1 TO 5500 :NEXT	  :REM- LEAVE MESSAGE ON AWHILE
3130   N$= ""	                  :REM- RESET LETTER INPUT N$ TO `NULL' FOR NEXT PLAYER
3140   GOTO 2790	          :REM- GET NEXT PLAYER
3150 REM --------------------------------
3160 REM- ROUTINE TO ASK FOR CONSONANT
3170 REM
3180   PRINT:PRINT:INPUT "ENTER CONSONANT: ";N$
3190   IF ASC(N$)>91 THEN N$=CHR$(ASC(N$)-32)   :REM- CONVERT TO UPPER CASE
3200	 IF N$= "" THEN 3180	   :REM- NEEDS TO ENTER SOMETHING
3210 REM --------------------------------
3220 REM- ROUTINE TO CHECK & ADD CHARACTERS TO `USED LETTER' ARRAY
3230 REM
3240	IF N$="A" OR N$="E" OR N$="I" OR N$="O" OR N$="U" THEN GOTO  3300
3250	GOSUB 4380	           :REM- SUBROUTINE FOR USED LETTER ARRAY `UL'
3260	IF N$="A" OR N$="E" OR N$="I" OR N$="U" THEN 3300 ELSE GOTO 1350
3270 REM --------------------------------
3280 REM- ERROR MESSAGE & LOSS OF TURN IF ASKED CONSONANT & INPUT VOWEL
3290 REM
3300	PRINT:PRINT ESC$+"^" "YOU SHOULD HAVE ENTERED A CONSONANT ...."
3310	PRINT:PRINT "SORRY, YOU LOSE YOUR TURN ..." ESC$+"q":PRINT CHR$(7):FOR K=1 TO 5500: NEXT K:N$="" : GOTO 2790  :REM -- GO TO NEXT PLAYER
3320 REM --------------------------------
3330 REM- RANDOM NUMBER GENERATING SUBROUTINE
3340 REM  FROM "PORTABLE COMPANION"
3350 REM     SEPTEMBER, 1983
3360 REM		PAGES 36-37
3370 REM 
3380   OPEN "I", #1, DK$+":"+"RANDOM.DAT"
3390	  INPUT #1, SEED
3400   CLOSE #1
3410   RANDOMIZE (SEED)
3420   SEED=SEED+1: IF SEED=>30000 THEN SEED=-30000
3430   OPEN "O", #1, DK$+":"+"RANDOM.DAT
3440	  PRINT #1, SEED
3450   CLOSE #1
3460  RETURN
3470 REM --------------------------------
3480 REM- SUBROUTINE TO RANDOMIZE PLAYERS
3490 REM  Y% = NUMBERS OF PLAYERS
3500   GOSUB 3380
3510   PX= INT(100*RND)
3520   IF PX<=0 OR PX>Y% THEN 3510
3530 REM- PX IS NUMBER IF PLAYER SELECTED
3540 RETURN
3550 REM --------------------------------
3560 REM- SUBROUTINE TO SELECT NEXT PLAYER
3570 REM
3580   PX= PX+ 1
3590	IF PX > Y% THEN PX= 1
3600  RETURN
3610 REM --------------------------------
3620 REM
3630 REM- SUBROUTINE TO LIST FINAL SCORE
3640 REM  OF ALL PLAYERS AT END OF GAME
3650 REM
3660   PRINT CLS$
3670   FOR PX= 1 TO Y%
3680	  PRINT "PLAYER: ";PL$(PX);", WINNINGS: $";WN%(PX)
3690   NEXT
3700 RETURN
3710 REM --------------------------------
3720 REM- SUBROUTINE TO DETERMINE VALUE OF
3730 REM  CONSONANTS RANDOMONLY
3740   GOSUB 3380		:REM- GET RANDOM NUMBER
3750   WH= INT(100*RND)
3760	IF WH>=1 AND WH<=10 THEN VC= 100
3770	IF WH>=11 AND WH<=20 THEN VC= 150
3780	IF WH>=21 AND WH<=25 THEN TU$= "LOSE TURN"
3790	IF WH>=26 AND WH<=30 THEN VC= 200
3800	IF WH>=31 AND WH<=40 THEN VC= 300
3810	IF WH>=41 AND WH<=50 THEN VC= 400
3820	IF WH>=51 AND WH<=55 THEN VC= 500
3830	IF WH>=56 AND WH<=60 THEN VC= 550
3840	IF WH>=61 AND WH<=65 THEN VC= 600
3850	IF WH>=66 AND WH<=70 THEN VC= 700
3860	IF WH>=71 AND WH<=75 THEN VC= 800
3870	IF WH>=76 AND WH<=80 THEN VC= 900
3880	IF WH>=81 AND WH<=85 THEN VC= 1000
3890	IF WH>=86 AND WH<=88 THEN VC= 5000
3900	IF WH>=89 AND WH<=95 THEN TU$= " BANKRUPT"	:REM- BANKRUPT
3910	IF WH>=96 AND WH<=100 THEN TU$= "LOSE TURN"	:REM- LOSE TURN
3920  RETURN
3930 REM --------------------------------
3940 REM- SUBROUTINE TO `ZERO' PLAYER PL$(PX)'S
3950 REM  CURRENT ROUND SCORE DUE TO `BANKRUPT'
3960 REM
3970	S1%(PX)=0
3980  RETURN
3990 REM --------------------------------
4000 REM- SUBROUTINE TO CALCULATE VALUE
4010 REM  OF CORRECTLY ENTERED LETTERS
4020	IF TU$<>"" THEN N$= ""	:REM - NO CREDIT IF BANKRUPT/LOOSE TURN
4030	IF N$="A" OR N$="E" OR N$="I" OR N$="O" OR N$="U" THEN SP$= ""  :REM- DON'T PRINT "SPINNING WHEEL ....." MESSAGE FOR VOWELS
4040	IF N$="A" OR N$="E" OR N$="I" OR N$="O" OR N$="U" THEN VV= VC   :REM- USEVV TO PRINT SAME VALUE FOR CONSONAT AS BEFORE SINCE VOWEL SELECTED
4050	IF N$="A" OR N$="E" OR N$="I" OR N$="O" OR N$="U" THEN VC= 0    :REM- NO  CREDIT FOR VOWELS
4060	FOR K= 1 TO L%
4070	  IF W$(K)=CHR$(95) AND A$(K)=N$ THEN S1%(PX) = S1%(PX) + VC
4080	NEXT
4090 RETURN
4100 REM --------------------------------
4110 REM- KEEP TRACK OF WINNINGS AS GO FROM
4120 REM  ONE GAME TO NEXT
4130 REM
4140 REM  WN%(PX)= WINNINGS OF PLAYER PX
4150	WN%(PX)= WN%(PX) + S1%(PX)
4160	RETURN
4170 REM --------------------------------
4180 REM- ROUTINE FOR `BANKRUPT'
4190 REM
4200	PRINT CHR$(7)	        :REM- RING BELL
4210	PRINT:PRINT ESC$+"^" "SORRY ";PL$(PX);" ... BAD LUCK ... YOUR'RE BANKRUPT !! ....." ESC$+"q"
4220	FOR K= 1 TO 5000:NEXT	:REM- LEAVE MESSAGE FOR AWHILE
4230	S1%(PX)= 0		:REM- ZERO PLAYER'S SCORE FOR THIS ROUND
4240	TU$= ""		        :REM- RESET TU$ TO `NULL'
4250	GOTO 2780
4260 REM --------------------------------
4270 REM- ROUTINE FOR `LOSE TURN'
4280 REM
4290	PRINT CHR$(7)	        :REM- RING BELL
4300	PRINT:PRINT ESC$+"^" "TOUGH LUCK ";PL$(PX);" ... YOU LOSE YOUR TURN ...." ESC$+"q"
4310	FOR K= 1 TO 5000: NEXT	:REM- LEAVE MESSAGE ON FOR AWHILE
4320	TU$= ""		        :REM- RESET TU$ TO `NULL'
4330	GOTO 2780	        :REM- NEXT PLAYER
4340 REM --------------------------------
4350 REM- SUBROUTINE SERIES TO ADD CHARACTERS
4360 REM- TO `USED LETTER' (UL) ARRAY, AND CONVERT
4370 REM- INPUT LETTER N$ TO ASCII DECIMAL #
4380	A = (ASC(N$)-64)
4390 REM- COUNT NUMBER OF CHARACTERS CURRENTLY IN ARRAY UL
4400	Z= 0	                :REM- RESET LETTER COUNTER `Z' TO ZERO
4410	FOR K= 1 TO 26		:REM- 26 LETTERS; `A' CAN BE 1 TO 26
4420	    IF UL(K)<>0 THEN Z= Z+1
4430	NEXT
4440 REM- NOW ADD `NEW' LETTER TO ARRAY UL IF NOT PRESENT
4450	ND$= ""			:REM- RESET
4460	FOR K= 1 TO Z+1		:REM- ONE MORE THAN NOW PRESENT
4470	    IF UL(K)<>0 AND UL(K)=A THEN ND$= "DUPLICATE"
4480	    IF UL(K)<>0 AND UL(K)=A THEN K= Z+1
4490       IF UL(K)<>0 AND UL(K)=A THEN GOTO 4510
4500	    IF UL(K)<>A AND UL(K)=0 THEN UL(K)=A
4510	NEXT K
4520 REM- SET COUNTER `LT' USED IN PRINT ROUTINE
4530	LT= Z+1
4540	IF ND$= "DUPLICATE" THEN LT= Z
4550	IF ND$= "DUPLICATE" THEN UL(Z+1)= 0	:REM- RESET TO `0'
4560  RETURN
4570 REM --------------------------------
4580 REM- SUBROUTINE TO SEE IF ONLY
4590 REM  VOWELS LEFT IN UNKNOWN. IF SO
4600 REM  PLAYER `MUST SOLVE' UNKNOWN
4610 REM
4620   CK$= ""	                :REM- RESET `CK$' TO `NULL'
4630   BK= 0	                :REM- `BK' = NUMBER OF BLANK SPACES LEFT. RESET TO `0'
4640   FOR K= 1 TO L%
4650	  IF W$(K)= CHR$(95) AND  A$(K)<>"A" AND A$(K)<>"E" AND A$(K)<>"I" AND A$(K)<>"O" AND A$(K)<>"U" THEN BK= BK+1
4660	  IF A$(K)= CHR$(45) OR A$(K)= CHR$(32) OR A$(K)= CHR$(39) THEN BK=BK
4670	  IF W$(K)= CHR$(45) OR W$(K)= CHR$(32) OR W$(K)= CHR$(39) THEN BK=BK
4680   NEXT K
4690     IF BK>0 THEN CK$= "" ELSE CK$= "ONLY VOWELS REMAINING"
4700     IF CK$= "ONLY VOWELS REMAINING" THEN PRINT CHR$(7) :REM- RING BELL
4710     IF CK$= "ONLY VOWELS REMAINING" THEN PRINT:PRINT  ESC$+"j" TAB(5) "ALL REMAINING LETTERS ARE VOWELS. YOU MUST NOW SOLVE IT." ESC$+"k"
4720     IF CK$= "ONLY VOWELS REMAINING" THEN PRINT	     :REM- LINE FEED
4730  RETURN
4740 REM --------------------------------
4750 REM- SUBROUTINE TO PRINT `USED LETTERS'
4760   PRINT:PRINT "USED LETTERS: ";
4770	FOR K= 1 TO LT		:REM- LT = LETTER COUNTER
4780       IF UL(K)<>0 THEN PRINT CHR$(UL(K) + 64)" ";
4790	NEXT
4800  RETURN
4810 REM --------------------------------
4820 REM- SUBROUTINE TO CHECK FOR DUPLICATION
4830 REM  OF `VOWEL' INPUT BY PLAYER
4840   DP$=""		        :REM- INITIALIZE DP$ = `NULL' AT BEGINNING
4850   FOR K= 1 TO L%
4860	    IF W$(K)="A" AND N$="A" THEN DP$="DUPLICATE"
4870	    IF W$(K)="E" AND N$="E" THEN DP$="DUPLICATE"
4880	    IF W$(K)="I" AND N$="I" THEN DP$="DUPLICATE"
4890	    IF W$(K)="O" AND N$="O" THEN DP$="DUPLICATE"
4900	    IF W$(K)="U" AND N$="U" THEN DP$="DUPLICATE"
4910   NEXT
4920       IF DP$="DUPLICATE" THEN CT%=1
4930  RETURN
4940 REM --------------------------------
4950 REM- SUROUTINE TO CKECK FOR INPUT OF
4960 REM  A `VOWEL' NOT PRESENT IN UNKNOWN
4970   CT%= 0
4980   FOR K= 1 TO L%
4990	    IF N$=A$(K) THEN CT%= 1
5000   NEXT
5010  RETURN
5020 REM --------------------------------
5030 REM- EXECUTIVE WINDOW #1
5040 REM- USED FOR "SPINNING WHEEL --->" MESSAGE
5050   PRINT ESC$+"^"	:REM- START BLINK MODE
5060   PRINT SET$+"1"		:REM - SET WINDOW #1
5070   PRINT SP$
5080   PRINT SET$+"0"	:REM- SET WINDOW #0
5090   PRINT ESC$+"q"	:REM- END BLINK MODE
5100  RETURN
5110 REM --------------------------------
5120 REM- EXECUTIVE WINDOW #2
5130 REM
5140   PRINT ESC$+"j"           :REM- START INVERSE
5150   PRINT ESC$+"."+"0"       :REM- START INVISIBLE CURSOR
5160   PRINT SET$+"2"		:REM - SET WINDOW #2
5170   GOSUB 5520
5180   IF TU$<>"" THEN PRINT ">"TU$
5190   IF TU$="" AND VC<1000 THEN PRINT ">    "VC
5200   IF TU$="" AND VC>900 THEN PRINT ">   "VC
5210	PRINT SET$+"1"		:REM - SET WINDOW #1
5220   PRINT"                    "  :REM- BLANK WINDOW #1
5230   PRINT ESC$+"."+"4"       :REM- START UNDERLINE CURSOR
5240   GOSUB 5300		     :REM- TURN ON WINDOW #3
5250  RETURN
5260 REM
5270 REM ---------------------------
5280 REM- EXECUTIVE WINDOW #3
5290 REM
5300   PRINT SET$+"3"		:REM- SET WINDOW #3
5310   PRINT ESC$+"k"            :REM- END INVERSE MODE
5320   PRINT CLS$
5330 REM
5340 RETURN
5350 REM --------------------------------
5360 REM- EXECUTIVE WINDOW #4
5370 REM
5380   PRINT ESC$+"j"		:REM- START INVERSE MODE
5390   PRINT ESC$+")"		:REM- START DIM MODE
5400   PRINT SET$+"4"		:REM - SET WINDOW #4
5410   PRINT "  WHEEL   "
5420   PRINT "  VALUE   "
5430   PRINT "$$$$$$$$$$"
5440   PRINT ESC$+"q"		:REM- END BLINK
5450   PRINT ESC$+"("		:REM- END DIM MODE
5460   PRINT ESC$+"k"	        :REM- END INVERSE MODE
5470  RETURN
5480 REM --------------------------------
5490 REM- SUBROUTINE TO PRINT "WHEEL VALUES" IN
5500 REM  WINDOW #2  (SIMULATE RANDOM SELECTION ON SCREEN)
5510 REM
5520   FOR K=1 TO 2
5530	  PRINT ">      100":FOR K1=1 TO 200:NEXT:PRINT
5540	  PRINT ">      150":FOR K1=1 TO 200:NEXT:PRINT
5550	  PRINT ">LOSE TURN":FOR K1=1 TO 200:NEXT:PRINT
5560	  PRINT ">      200":FOR K1=1 TO 200:NEXT:PRINT
5570	  PRINT ">     1000":FOR K1=1 TO 200:NEXT:PRINT
5580	  PRINT ">      300":FOR K1=1 TO 200:NEXT:PRINT
5590	  PRINT ">      400":FOR K1=1 TO 200:NEXT:PRINT
5600      PRINT "> BANKRUPT":FOR K1=1 TO 200:NEXT:PRINT
5610	  PRINT ">      500":FOR K1=1 TO 200:NEXT:PRINT
5620	  PRINT ">      550":FOR K1=1 TO 200:NEXT:PRINT
5630	  PRINT ">      600":FOR K1=1 TO 200:NEXT:PRINT
5640	  PRINT ">      700":FOR K1=1 TO 200:NEXT:PRINT
5650      PRINT ">LOSE TURN":FOR K1=1 TO 200:NEXT:PRINT
5660	  PRINT ">      800":FOR K1=1 TO 200:NEXT:PRINT
5670	  PRINT ">      900":FOR K1=1 TO 200:NEXT:PRINT
5680	  PRINT ">     1000":FOR K1=1 TO 200:NEXT:PRINT
5690	  PRINT ">      200":FOR K1=1 TO 200:NEXT:PRINT
5700	  PRINT ">     5000":FOR K1=1 TO 200:NEXT:PRINT
5710	  PRINT "> BANKRUPT":FOR K1=1 TO 200:NEXT:PRINT
5720	  PRINT ">LOSE TURN":FOR K1=1 TO 200:NEXT:PRINT
5730	  PRINT ">      400":FOR K1=1 TO 200:NEXT:PRINT
5740   NEXT
5750 RETURN
5760 REM --------------------------------
5770 END
5780 REM --------------------------------
5790 REM ------ VARIABLES ------
5800 REM
5810 REM' Y% = NUMBER OF PLAYERS
5820 REM' K = `COUNTER' USED IN VARIOUS `FOR/NEXT' LOOPS IN PROGRAM
5830 REM' A = VARIABLE USED IN `USED LETTER' SUBROUTINE
5840 REM' Z = VARIABLE USED IN `USED LETTER' SUBROUTINE
5850 REM' LT = COUNTER USED IN `USED LETTER' SUBROUTINE TO `PRINT USED LETTERS'
5860 REM' BK = COUNTER USED IN `USED/UNUSED VOWELS' SUBROUTINE
5870 REM' PL$(PX) = NAMES OF INDIVIDUAL PLAYERS
5880 REM' PX = PLAYER NUMBER
5890 REM' S1%(PX) = CUMMULATIVE SCORE OF PLAYER `PX' DURING `CURRENT GAME'
5900 REM' WN%(PX) = TOTAL `WINNINGS' PLAYER `PX' WON IN ALL GAMES `CURRENT SERIES'
5910 REM' RD = RANDOM NUMBER GENERATED & USED IN VARIOUS ROUTINES
5920 REM' FILE$ = FILE NAME OF CATEGORY SELECTED RANDOMLY
5930 REM' I% = FIRST ITEM (AN INTEGER) IN ALL CATEGORY DATA FILES WHICH INDICATE
5940 REM'  TOTAL NUMBER OF ITEMS IN THE CATEGORY. I% USED TO SELECT ITEMS RANDOMLY
5950 REM' C$ = "UNKNOWN ITEM" (PHRASE, TITLE, ETC.) SELECTED FROM CATEGORY `FILE$'
5960 REM' A$ = "STRING ARRAY" IDENTICAL TO `C$' USED WITH W$ ARRAY TO PRINT UNKNOWN
5970 REM' W$ = "STRING ARRAY" USED TO PRINT `BLANKS, LETTERS, HYPHEN ..." ON SCREEN
5980 REM' X$ = `SOLVE' INPUT BY PLAYER. IS COMPARED TO `C$' TO SEE IF CORRECT
5990 REM' N$ = `GUESSED LETTER' INPUTED BY PLAYER
6000 REM' D$(RD) = TEMPORARY ITEM IDENIFICATION USED DURING SELECTION. C$ = D$(RD)
6010 REM' L% = NUMBER OF CHARACTERS, SPACES, ETC IN SELECTED ITEM
6020 REM' GM = GAME NUMBER
6030 REM' NS% = TOGGLE SET TO `1' IF VOWEL SELECTED SO NO CHANGE IN VALUE CONSONANT
6040 REM' VC = RANDOM SELECTION NUMBER OF `VALUE' FOR CONSONANTS
6050 REM' VV = `VALUE' OF CONSONANT WHEN `VOWEL' SELECTED BY PLAYER
6060 REM' WH = VARIABLE USED IN RANDOM CONSONANT `VALUE' SELECTION PROCESS
6070 REM' CT% = TOGGLE. CT% = 1 IF CORRECT LETTER `GUESS', ELSE CT% = 0
6080 REM' UL(26) = "DIMENSIONED ARRAY" USED TO LIST `USED LETTERS' (ALPHABET)
6090 REM' YN$ = `YES/NO' RESPONSE BY PLAYER TO VARIOUS QUESTIONS
6100 REM' TU$ = SET TO "BANKRUPT" OR "LOSE TURN" ON RANDOM `WHEEL' (WH) `SPIN'
6110 REM' DP$ = TOGGLE USED TO INDICATE "DUPLICATE" (USED) VOWEL INPUT
6120 REM' SP$ = "SPINNING ..........' MESSAGE --> RANDOM `VALUE' SELECTION PROCESS
6130 REM' CK$ = TOGGLE SET TO "ONLY VOWELS REMAIN" & FORCES PLAYER TO SOLVE
6140 REM' ND$ = TOGGLE FOR "DUPLICATE" USED IN `USED LETTER' SUBROUTINE
6150 REM' CLS$ = CLEAR SCREEN
6160 REM' ESC$ = ESCAPE
6170 REM' H$ = `BLOCK' GRAPHIC CHARACTER FOR `SIGN ON MESSAGE'
6180 REM' W0$, W1$, W2$, W3$, W4$ = VARIOUS EXECUTVE `WINDOWS'
