10DEFFNS="Gesswho"
20*FX200,1
30MODE7:VDU23;8202;0;0;0;
40DIMQ$(55),P$(13,8),S$(8):FORL%=1TO8
:S$(L%)="0 ":NEXT:S$(0)="00000000"
50Q%=0
60PROCprt("Guess Who"):PROCprt("Progr
am by C.J.Richardson."):PROCprt("RETURN
to finish.")
70REPEAT
80Q%=Q%+1
90PROCprt("Enter player "+STR$Q%+"'s
name please")
100INPUT P$(0,Q%):P$(0,Q%)=LEFT$(P$(0,
Q%),12)
110UNTILP$(0,Q%)="" OR Q%=8:IFP$(0,Q%)
="" Q%=Q%-1
120IF Q%<3 PROCprt("Minimum three play
ers. Start again"):REPEATUNTILGET:RUN
130RESTORE 1550:FORL%=1TO55:READQ$(L%)
:NEXT
140PROCprt("Choosing new characters.")
150PROCgetcards
160PRINT:PROCprt("Print out characters
Y/N?"):P$=GET$:IF P$="Y"PROCprtchrs
170RESTORE:READX%,Y%,T%:G%=1:T%=0
180REPEAT
190PROCscrn:IF V%<>0:PRINTTAB(0,20):PR
OCprt("The game is over! (E)nd"):A$=GET$
:IFA$="E"END ELSE IF V%<>0 RUN
200PRINTTAB(X%,Y%);"*"
210REPEAT:A$=GET$:UNTILINSTR("GMR12345
678",A$)
220W%=1:FORL%=1TOQ%:IF L%<>G%:IFMID$(S
$(0),L%,1)="0"W%=0:NEXT ELSE NEXT
230IF A$="G"PROCguess
240IF A$="M"
250IF A$="R"PROCrolldice:A$="R"
260IF VALA$>0PROCdispcard
270IF VALA$=0G%=G%+1:IF G%>Q%G%=1
280UNTILFALSE
290DEFPROCprt(Z$):Z$=Z$+STRING$(LENZ$M
OD2," "):FORM%=1TOLENZ$:PRINTTAB(18-M%/2
);"
,M%/2):VDU11,11:NEXT:VDU10,10:OSCLI"FX21
":ENDPROC
300DEFPROCgetcards
310F1%=OPENIN"GessDat"
320F2%=OPENIN"GessPtr"
330F3%=OPENUP"GessUse"
340FORL%=1TOQ%:C%=0:REPEAT
350I%=RND(EXT#F3%)-1:PTR#F3%=I%
360A%=BGET#F3%:C%=C%+1:UNTILA%=0 OR C%
=100
370IFC%=100:PTR#F3%=0:REPEAT:A%=BGET#F
3%:UNTILA%=0 OR EXT#F3%
380IFA%=1:PRINT"None to spare Press a
key to reset":REPEATUNTILGET:PTR#F3%=0:F
ORL%=1TO EXT#F3%:BPUT#F3%,0:NEXT:CLOSE#F
1%:CLOSE#F2%:CLOSE#F3%:RUN
390PTR#F3%=I%:BPUT#F3%,1
400IF I%>0:PTR#F2%=(I%*2) ELSE PTR#F2%
=0
410P%=BGET#F2%+(BGET#F2%*256)
420PTR#F1%=P%
430FORI%=1TO13:INPUT#F1%,P$(I%,L%):NEX
T
440NEXT
450CLOSE#F1%:CLOSE#F2%:CLOSE#F3%
460ENDPROC
470DEFPROCprtchrs:CLS
480PROCprt("Prepare printer.")
490FORL%=1TOQ%
500PROCprt("Press a key for "+P$(0,L%)
):REPEATUNTILGET
510VDU2
520FORI%=0TO13:IF I%>3PRINTSTR$(I%-4);
".";
530PRINTP$(I%,L%):NEXT
540VDU12,3
550PROCprt("Remove your sheet "+P$(0,L
%))
560NEXT
570ENDPROC
580DEFPROCguess:CLS
590PROCprt(P$(0,G%)):PROCprt("You must
guess a player's")
600PROCprt("character.")
610IF VALS$(G%)=0PROCill("However, you
have no points",-1):F%=1:ENDPROC
620IFW% PROCill("You are the only play
er left!",-1):F%=1:ENDPROC
630PROCprt("If correct enter number.")
640PROCprt("If incorrect press RETURN"
)
650FORL%=1TO8:IF P$(0,L%)<>""IFMID$(S$
(0),L%,1)<>"1"PRINTSTR$(L%);".";P$(0,L%)
:NEXT ELSE NEXT
660A%=VALGET$:IF A%=G% PROCill("That's
you!",-1):ENDPROC
670IF A%>Q%PROCill("How many players?"
,-1):ENDPROC
680IF A%=0:S$(G%)=FNscore(-1):PROCill(
"Hard cheese!",0):F%=1:ENDPROC
690IF MID$(S$(0),A%,1)="1"PROCill("Alr
eady gone! Press a key",-1):ENDPROC
700S$(G%)=FNscore(5):S$(0)=LEFT$(S$(0)
,A%-1)+"1"+MID$(S$(0),A%+1)
710F%=1
720ENDPROC
730DEFPROCill(A$,L%):PROCprt(A$):PROCp
rt("Press a key"):REPEATUNTILGET
740IF T%=6 L%=0
750G%=G%+L%:IF G%=0 G%=Q%
760ENDPROC
770DEFPROCdispcard
780CLS
790FORL%=0TO13
800IFL%>3PRINTSTR$(L%-4);".";
810IF L%<>1 PRINTP$(L%,VALA$):NEXT ELS
E PRINT:NEXT
820PRINT'" (N)ame"
830REPEAT:L%=INKEY30:UNTILL%=-1ORL%=78
840IF L%=78PRINTTAB(0,1);P$(1,VALA$);T
AB(0,22);" Press a key":REPEAT:L%=INKEY0
:UNTILL%<>-1
850ENDPROC
860DEFPROCrolldice
870M%=RND(6)
880FORL%=1TOM%
890PRINTTAB(X%,Y%);" "
900READX%,Y%,T%:IFX%=0:RESTORE:READX%,
Y%,T%
910PRINTTAB(X%,Y%);"*":FORD%=1TO2000:N
EXT
920NEXT:PRINTTAB(X%,Y%);"*":FORD%=1TO5
000:NEXT
930IFT%=1:S$(G%)=FNscore(1)
940IFW% ENDPROC
950IFT%=2PROCq("Open.")
960IFT%=3PROCsec:PROCq("In secret.")
970IFT%=4PROCclue(" Open.")
980IFT%=5PROCclue(" In secret.")
990IFT%=6:F%=0:REPEAT:PROCguess:UNTILF
%=1:T%=0
1000IFT%=7CLS:PROCprt(P$(0,G%)):PROCprt
("may ask anyone else"):PROCprt("any que
stion as"):PROCprt("long as it can be"):
PROCprt("answered yes or no."):PROCprt("
Press a key"):REPEATUNTILGET
1010ENDPROC
1020DEFPROCq(A$):CLS:PROCprt(P$(0,G%))
1030PROCprt("Ask anyone one of these qu
estions."):PROCprt(A$):PRINT
1040FORL%=0TO4:PRINTSTR$(L%+1);".";Q$(R
ND(11)+L%*11):NEXT:PRINT
1050PROCprt("Then press a key"):REPEATU
NTILGET
1060ENDPROC
1070DEFPROCclue(B$):CLS
1080PROCprt(P$(0,G%))
1090PROCprt("Ask one of these to give y
ou a clue."):PRINT'
1100FORL%=1TOQ%:IF L%=G%OR MID$(S$(0),L
%,1)="1" NEXT ELSE PRINTSTR$L%;".";P$(0,
L%):NEXT
1110PRINT':PROCprt("Press 1 - 8")
1120REPEAT:A%=VALGET$:UNTILA%>0ANDA%<=Q
%ANDA%<>G%:REPEAT:CLS
1130PROCprt(P$(0,A%)):PROCprt("Give a c
lue (0 - 9) to"):PROCprt(P$(0,G%)+B$)
1140PROCprt("Or Press C to see your clu
es")
1150REPEAT:Z$=GET$:Z%=VALZ$:UNTILINSTR(
"1234567890C",Z$)
1160IF Z$="C":A$=STR$(A%):PROCdispcard
1170UNTILZ$<>"C"
1180PRINT''P$(Z%+4,A%)'':PROCprt("Press
a key"):REPEATUNTILGET
1190ENDPROC
1200DEFPROCsec:CLS
1210PROCprt("All Players but "+P$(0,G%)
):PROCprt("LOOK AWAY!"):PROCprt("Press a
key")
1220REPEATUNTILGET
1230ENDPROC
1240DEFFNscore(L%):T$=S$(G%):S%=VALT$:T
$=STR$(S%+L%):IFLENT$=1T$=T$+" ":=T$ ELS
E=T$
1250DEFPROCscrn:V%=0
1260PRINTTAB(0,0)"
1270PRINT"
1280PRINT" Secret. Open. ?=Question.
!=Clue. ";
1290PRINT" ";
1300PRINT" P ? ! ? ! ?
! P ";
1310PRINT" ";
1320PRINT" ";
1330PRINT" ! Player Poin
ts ? ";
1340PRINT" 1. ";P$(0,1);SPC(12
-LENP$(0,1));" ";S$(1);" ";
1350PRINT" 2. ";P$(0,2);SPC(12
-LENP$(0,2));" ";S$(2);" ";
1360PRINT" ? 3. ";P$(0,3);SPC(12
-LENP$(0,3));" ";S$(3);" ! ";
1370PRINT" 4. ";P$(0,4);SPC(12
-LENP$(0,4));" ";S$(4);" ";
1380PRINT" 5. ";P$(0,5);SPC(12
-LENP$(0,5));" ";S$(5);" ";
1390PRINT" G 6. ";P$(0,6);SPC(12
-LENP$(0,6));" ";S$(6);" A ";
1400PRINT" 7. ";P$(0,7);SPC(12
-LENP$(0,7));" ";S$(7);" ";
1410PRINT" 8. ";P$(0,8);SPC(12
-LENP$(0,8));" ";S$(8);" ";
1420PRINT" ? Player ";STR$G%;"
. Your go! ! "
1430PRINT" (G)uess a name.
";
1440PRINT" (M)iss a go.
";
1450PRINT" ! (R)oll the dice.
? ";
1460PRINT" ";
1470PRINT" ";
1480PRINT" P ? ! ? ! ? ! P ";
1490PRINT" ";
1500VDU31,7,G%+7,136
1510FORL%=1TO8:IFMID$(S$(0),L%,1)="1"VD
U31,12,L%+7,129:V%=V%+1:NEXT ELSE NEXT
1520IF V%<>Q% V%=0
1530ENDPROC
1540DATA6,14,6,6,11,2,6,8,5,6,5,1,10,5,
2,14,5,2,18,5,3,22,5,4,26,5,3,30,5,5,34,
5,1,34,8,2,34,11,5,34,14,7,34,17,4,34,20
,3,34,23,1,30,23,4,26,23,3,22,23,5,18,23
,2,14,23,4,10,23,3,6,23,1,6,20,4,6,17,3,
0,0,0
1550DATAHave you pop music connections?
1560DATAAre you connected with the thea
tre?
1570DATAAre you female?
1580DATAAre you male?
1590DATAAre you famous internationally?
1600DATAAre you a royal?
1610DATAAre you known by your real name
?
1620DATAAre you a TV personality?
1630DATAAre you male?
1640DATAAre you female?
1650DATAHave you medical connections?
1660DATAWere you born before 1200?
1670DATAWere you born before 1600?
1680DATAWere you born before 1800?
1690DATAWere you born before 1900?
1700DATAWere you born before 1925?
1710DATAWere you born before 1950?
1720DATAAre you over 30?
1730DATAAre you over 40?
1740DATAAre you over 50?
1750DATAAre you over 60?
1760DATAAre you over 80?
1770DATAWere you born BC?
1780DATAAre you a film star?
1790DATAAre you alive?
1800DATAAre you dead?
1810DATAAre you a professional musician
?
1820DATAAre you an inventor?
1830DATAAre you a captain of industry?
1840DATAAre you a playwright or scriptw
riter?
1850DATAAre you an actor or actress?
1860DATAAre you a singer?
1870DATAHave you had a book published?
1880DATAAre you a peer?
1890DATAAre you a national leader?
1900DATAWere you born in the USA?
1910DATAAre you an explorer?
1920DATADo you write professionally?
1930DATAIs English your native tongue?
1940DATAAre you a scientist?
1950DATAAre you connected with visual a
rts?
1960DATAAre you a military person?
1970DATAAre you a politician?
1980DATAWould I recognise you?
1990DATAAre you famous for your wealth?
2000DATAHave you hosted/presented a TV
show?
2010DATAAre you a sportsperson?
2020DATAAre you often in the news?
2030DATAAre you English?
2040DATAAre you a knight or a dame?
2050DATAWere you born in the UK?
2060DATADo you have religious connectio
ns?
2070DATAHave you made a film?
2080DATAWere you born in mainland Europ
e?
2090DATAAre you a comedian?