PCjs Machines

Home of the original IBM PC emulator for browsers.

Logo

Challenger 1P BASIC Programs

HANGWOMAN.BAS

By Jeff Parsons

Why “HANWOMAN” instead of “HANGMAN”? Well, why not? This was one of my earliest BASIC programs, and I even went to the trouble of “scrambling” all the words in the DATA statements, so that the game wouldn’t be spoiled if you watched the program scroll up the screen as it loaded from tape.

OSI Challenger 1P

Challenger 1P
Speed:
Stopped

Listing

1 DEFFNQ(X)=INT(RND(RS)*X)+1
2 REM
3 REM * HANGWOMAN *
4 REM
10 DEFFNQ(X)=INT(RND(RS)*X)+1
11 C=53446:Y=0:RS=PEEK(8191)
12 POKE11,0:POKE12,253
18 PRINT:PRINTTAB(6);"HANGWOMAN":FORM=1TO22:PRINT:NEXT
20 GOSUB800:C=C-32
25 A$="USED LETTERS:":P=C+103:GOSUB850
28 A$="AND THE WORD:":P=C+551:GOSUB850
30 GOSUB900:A$="":FORM=1TOLEN(B$):A$=A$+CHR$(95):NEXTM:L=1:R=C+167
31 K=1:S=1
35 REM*BEGIN QUEST*
39 P=C+616:GOSUB850
40 IFY=0THENX=4:GOTO42
41 X=FNQ(10):IFX<4THENC$="GIVE ME A LETTER: "
42 IFX=4ORX=5ORX=6THENC$="WHAT DO YOU THINK? "
43 IFX>6ANDY=1THENC$="TRY ANOTHER LETTER: "
45 GOSUB890:Y=1
46 X=USR(X):A=PEEK(531):IFA<65ORA>90THEN46
50 PRINTCHR$(A);
51 RS=RS+A/K
52 FORT=1TO1500:NEXTT
55 FORN=1TOLEN(B$):IFCHR$(A)=MID$(B$,N,1)THEN75
58 NEXTN
61 X=FNQ(10):IFX<4THENC$="I DON'T THINK SO..."
62 IFX=4ORX=5ORX=6THENC$="WELL, ALMOST..."
63 IFX>6THENC$="NOBODY'S PERFECT..."
64 GOSUB875
65 ONKGOSUB200,280,210,220,230,260,240,250,320,340
70 K=K+1:GOTO85
75 REM*MATCH*
76 FORM=1TOLEN(A$):IFCHR$(A)<>MID$(A$,M,1)THEN78
77 C$="YOU DID THAT, DUMMY!":GOTO64
78 NEXTM
79 GOSUB190
80 FORM=NTOLEN(B$)
81 IFMID$(B$,M,1)=CHR$(A)THENA$=MID$(A$,1,M-1)+CHR$(A)+MID$(A$,M+1)
82 NEXTM
85 REM*SHOW LETTER*
90 POKER+1,A:R=R+2:S=S+1:IFS>5THENS=1:R=R+54
92 L=L+1:IFL>26ORK>10THEN150
94 FORM=1TOLEN(A$):IFMID$(A$,M,1)=CHR$(95)THEN35
96 NEXTM
100 REM*WON GAME*
105 P=C+616:GOSUB850
108 IFW=0THENC$="YOU ACTUALLY WON!"
110 IFW=1THENC$="YOU'RE IMPROVING..."
112 IFW=2THENC$="WHAT CAN I SAY?"
114 IFW=3THENC$="IT WAS EASY ANYWAY..."
116 IFW>3THENC$="YOU'RE TOO GOOD"
118 W=W+1:GOSUB875
119 GOSUB600
120 IFFNQ(10)>5THENC$="WANT TO TRY AGAIN? ":GOTO125
122 C$="HOW ABOUT ANOTHER? "
125 GOSUB875:X=USR(X):A=PEEK(531):IFCHR$(A)="Y"THENPRINT:GOTO10
130 GOTO189
150 REM*LOST GAME*
155 P=C+616:A$=B$:GOSUB850
160 IFV=0THENC$="I KNEW YOU'D SLIP!"
162 IFV=1THENC$="THAT WAS PRETTY SAD"
163 IFV=2THENC$="BOY, YOU NEED HELP..."
165 IFV>2THENC$="GO SIT ON A BOOGERPOT"
170 V=V+1:GOSUB875:GOSUB625:GOTO120
189 END
190 IFFNQ(10)<7THEN196
191 IFFNQ(10)>5 THEN194
192 C$="WELL, ALMOST...":GOSUB875:C$=" IS GOOD ENOUGH!!":GOSUB875
193 GOTO199
194 C$="I DON'T THINK SO...":GOSUB875:C$="I CHANGED MY MIND!!!"
195 GOSUB875:GOTO199
196 C$="WOW! YOU FOUND ONE!":GOSUB875
199 RETURN
200 REM*HEAD*
202 POKEC+67,150:POKEC+68,150:POKEC+98,201:POKEC+101,200
204 POKEC+130,140:POKEC+133,139:POKEC+162,199:POKEC+165,202
206 POKEC+195,135:POKEC+196,135
207 IFFNQ(10)>5THENC$="THERE'S THE HEAD.":GOSUB875:GOTO209
208 C$="OOPS, SHE'S GOT HEAD!":GOSUB875
209 RETURN
210 REM*NECK*
212 POKEC+195,210:POKEC+196,207:POKEC+227,190:POKEC+228,189
215 C$="OH MY...A NECK.":GOSUB875
219 RETURN
220 REM*R.ARM*
222 POKEC+226,189:FORM=C+257TOC+353STEP32:POKEM,143:NEXTM
224 POKEC+354,208:POKEC+322,143:POKEC+290,143
225 C$="LOOKS LIKE A BONY ARM":GOSUB875
229 RETURN
230 REM*L.ARM*
232 POKEC+229,190:FORM=C+262TOC+358STEP32:POKEM,136:NEXTM
234 POKEC+357,209:POKEC+325,136:POKEC+293,136
235 C$="ANOTHER BONY ARM!":GOSUB875
239 RETURN
240 REM*R.LEG*
242 POKEC+387,136:FORM=C+418TOC+514STEP32:POKEM,143:NEXTM
244 POKEC+515,208:POKEC+483,143:POKEC+451,143:POKEC+419,143
245 C$="OH, A LOVELY LEG!":GOSUB875
249 RETURN
250 REM*L.LEG*
252 POKEC+388,143:FORM=C+421TOC+517STEP32:POKEM,136:NEXTM
254 POKEC+516,128
255 C$="ANOTHER PEACHY LEG...":GOSUB875
259 RETURN
260 REM*R.HAND*
265 POKEC+386,89
270 REM*L.HAND*
275 POKEC+389,89
276 C$="DISHPAN HANDS....":GOSUB875
279 RETURN
280 REM*FACE*
285 POKEC+99,111:POKEC+100,111
305 POKEC+131,220:POKEC+132,223:POKEC+163,135:POKEC+164,135
308 C$="A LEWD EXPRESSION.":GOSUB875
309 RETURN
320 REM*R.FOOT*
325 POKEC+547,140:POKEC+579,172
330 REM*L.FOOT*
335 POKEC+548,139:POKEC+580,172
336 C$="WHAT GOES TIPTOE?":GOSUB875
339 RETURN
340 REM*CLOTHES*
342 FORM=C+260TOC+356STEP32:POKEM,136:NEXTM
344 POKEC+387,210:POKEC+388,207:POKEC+259,95
346 C$="NOW SHE'S DRESSED!":GOSUB875
349 RETURN
600 REM*LAUGH*
601 IFK>11THEN625
605 FORM=1TO50
606 POKEC+163,197:POKEC+164,195
607 FORT=1TO50:NEXTT
609 POKEC+163,135:POKEC+164,135
611 FORT=1TO50:NEXTT
615 NEXTM
620 RETURN
625 REM*KICK*
627 FORM=1TO50
630 POKEC+547,202:POKEC+548,199:POKEC+578,166:POKEC+581,168
633 POKEC+579,32:POKEC+580,32
635 FORT=1TO75:NEXTT
638 POKEC+547,140:POKEC+548,139:POKEC+578,32:POKEC+581,32
640 POKEC+579,172:POKEC+580,172
645 FORT=1TO75:NEXTT
650 NEXTM:RETURN
800 REM*MAKE GALLOW*
803 FORM=C+1TOC+4:POKEM,135:NEXTM:POKEC,210:POKEC+5,136:POKEC+37,136
806 FORM=C+32TOC+17*32STEP32:POKEM,136:NEXTM:POKEM,209:POKEM-1,128
809 FORN=M+1TOM+5:POKEN,128:NEXTN
820 RETURN
850 REM*POKE WORD*
855 FORM=1TOLEN(A$):POKEP,ASC(MID$(A$,M,1)):P=P+1:NEXTM
859 RETURN
875 REM*DISP.MESG*
885 PRINTCHR$(13);"                     ";CHR$(13);C$;
886 FORT=1TO1500:NEXTT
889 RETURN
890 PRINTCHR$(13);"                     ";CHR$(13);C$;
899 RETURN
900 REM*GET WORD*
905 T=FNQ(100)
910 FORT1=1TOT:READB$:IFB$="*"THENRESTORE:READB$
915 NEXTT1
930 A$="":FORT=1TOLEN(B$):T1=ASC(MID$(B$,T,1))
935 IFT1=65THENT1=91
940 A$=A$+CHR$(T1-1):NEXTT
950 B$=A$:RETURN
960 REM*TEST*
965 T=1:GOSUB910:PRINTB$:GOTO965
1000 DATAIFMMP,RVJFU,EPPSLOPC,IVSSZ,BDJE,VOEFSXFBS,LJUDIFO,XBZ
1010 DATAMJTUFO,SBDJOH,ZPVST,HPBU,CPPHFS,GJSTU,PQFSBUJPO,VUFOTJM
1020 DATAIBQQZ,TLJQQFS,TXJUDI,VQQFS,BSNPS,KPZ,AJQQFS,XFSF,HFUUJOH
1030 DATAQBOEB,BGSBJE,UPVDIZ,SJTL,DFOUT,QMFBTF,CVZ
1040 DATAFOWFMPQF,SIZUIN,MJQTUJDL,PWFS,PCTBDMF,CVMC,CVSOFE,UIJT
1045 DATAGSPN,OJCCMF,TUJOH,SPMMFS,RVJDLTBOE,TIFQIFSE,GSPNKFGG
1050 DATADBOEMF,TQJEFS,DFSFBM,HPJOH,XIJTLFS,QPUUZ,XIFUIFS,VODMF,IPQF
1060 DATA*