The Witching Hour
Brian Flynn
This game of skill and foresight is ideal for a bleak, stormy October night. Originally programmed for the IBM PC with color/graphics adapter and PCjr, versions have been added for the Commodore 64, expanded VIC-20, Atari 400/800, XL, and XE, TI-99/4A, and Apple II-series computers. The Coinnodore 64 and Atari versions require a joystick.
When autumn winds send a shiver down your spine and the witching hour draws near, there's no better entertainment than a good computer game. "The Witching Hour" is an absorbing contest of strategy based on Alquerque, a board game played in ancient Egypt and still popular in Spain today. Type in and save The Witching Hour, referring to the listing for your computer. Since every version is similar, read the general game rules below, then check the specific notes for your computer before running the program.
The Witching Hour pits broomstick-straddling witches against ethereal ghosts and is played on a board of 25 squares with 12 pieces to a side. After choosing sides, you attempt to take your opponent's players by jumping over them. You can move vertically, horizontally, or diagonally. However, certain diagonal moves are illegal (the lines between squares show where you can go) and only one square is vacant when the game begins.
Jumping an opposing player's piece removes that piece from the board. If no capture is possible, you may move any piece to an adjacent empty square. You may not pass up a capture-if it's possible to jump an opponent, you must always do so-and if the first capture puts you in position to make another, you must jump again (except in the Apple version). The computer won't let you make illegal moves.
Play ends when all the pieces from one side have been removed from the board. You can play against a friend or measure your skills against the computer (the IBM and TI versions also let you watch the computer play itself). Like other contests of strategy, The Witching Hour is simple to learn, but a challenge to master, and can be played at many different levels. Hint: It's sometimes smart to sacrifice a player to draw the opponent into a dangerous position.
IBM PC/PCjr Version
Each game square on the screen is marked with one of the letters of the alphabet. To move a piece, first type the letter for the square of the piece you want to move. Then type the letter of the square where you want to go. For instance, to move a witch from square L to square M, type L when the computer prompts you with FROM and type M when it prompts you with TO. If you press Enter without typing a letter, the computer takes that turn. Thus, to play alone against the computer, just press Enter every other turn. Press Enter on every turn to watch the computer play against itself.
Commodore 64 And VIC-20
Both Commodore versions of The Witching Hour offer a one- or two-player option when the game begins. The 64 version is played with a joystick. Plug the joystick into port 1 if you are playing alone (of course, two joysticks are needed for the two-player version). The colored box indicates which square you are on. Use the joystick to position the box on the piece you wish to move, then press the fire button: The box will change color. Now move the box to the square where you want the piece to go, and press the button again. If the move is legal, the piece appears in the new square (if not, you get to try again).
The VIC-20 game requires at least 8K memory expansion and uses keyboard controls exactly like the IBM version. Each square is marked with a letter. When the computer prompts you with FROM and TO, make your move by entering the appropriate letters. Before loading the VIC version, you must enter the following two lines in direct mode (don't add a line number, and hit RETURN after each line):
POKE 43,1:POKE 44,32:POKE 8192,0:NEW
POKE 36869,240:POKE 36866,150:POKE
648,30:PRINT"{CLR}"
Atari Version
The Atari game requires a joystick (a pair for the two-player game) and is played like the Commodore 64 version. The joystick controls a colored box. Move the box over the piece you want to move, then press the fire button. After the box changes color, move it to the square where you want to put the piece, then press the button again. Player/ missile graphics are used to form the witch and ghost figures, and a short machine language routine moves them quickly around the screen.
Apple Version
The Witching Hour runs on any Apple II-series computer with DOS 3.3 or ProDOS. When the program starts, you must choose between a one- or two-player game. Then the game board is drawn and play begins. The flashing box shows which square you are on, and is moved with keyboard controls. Press the I key to go up, J to go left, K for down, and L for right. Press RETURN when the box is on the piece you want to move, then move the box to the desired square and press RETURN again.
TI-99/4A Version
This program runs on any TI99/4A computer with either console BASIC or TI Extended BASIC. Every game square is labeled with a letter, and the pieces are moved on the board with keyboard controls. The first letter you enter (when the computer prompts FROM:) designates the piece you wish to move. The second letter (entered when the computer prints TO:) designates the square you will move to. The computer signals with a beep when you try an illegal move. The game may be played by one or two players, or the computer can play both sides. Whenever you press ENTER without typing a letter, the computer takes that move.
"The Witching Hour" for IBM PC/PCjr
forms ghost and witch shapes with PUT
statements.
Program 1: The Witching
Hour, PC/PCJr Version
For Instructions on entering this listing, please
refer to "COMPUTEI's Guide to Typing In
Programs" published bimonthly in COMPUTE!.
NK 10 GOSUB 530:GOTO 280
OG 20 H=0:K=0:FOR A=7 TO 35:GOSU
B 60:NEXT
GF 30 GOSUB 170:IF H<1 THEN 250
GE 40 H=0:K=0:A=T:GDSUB 60:1F H<
1 THEN 250
HI 50 GOTO 30
OK 60 IF B(A)=0 OR B(A)=-S OR B(
A)=2 THEN RETURN
BP 70 FOR B=0 TO D(A-7):C=A+M(B)
:IF B(C)=S OR B(C)=2 THEN
160
OC 80 IF B(C) THEN 120
ND 90 SC=RND(1)*.9:IF H<SC THEN
H=SC:F=A:T=C
AE 100 IF CK=1 AND Tl=C THEN L=1
:B=7
EA 110 GOTO 160
NN 120 IF B(C+M(B)) THEN 160
JN 130 SC=1+RND(1)*.9:IF H<SC TH
EN H=SC:F=A:T=C+M(B):K=C
MK 140 IF CK=0 THEN 160
GP 150 IF T1=C+M(S) THEN L=1:K1=
C:B-7
GN 160 NEXT:RETURN
MD 170 B(T)=B(F):B(F)=0:A=F:GOSU
B 760
IF 180 IF K THEN B(K)=0:A=K:GOSU
B 760
DD 190 A=T:GOTO 760
HB 200 GOSUB 520:IF S=1 THEN PRI
NT"The witches win!":GOTO
220
BA 210 PRINT"The ghosts win!"
OF 220 LOCATE 23,10:PRINT"Hit a
key to play again"
OE 230 K$=INKEY$:IF K$="" THEN 2
30
GE 240 RUN
NI 250 S=-S:H=0:A=7
LP 260 IF A=36 THEN 200
ML 270 GOSUB 60-IF H=0 THEN A=A+
1:GOTO 260
GG 280 D=0:GOSUB 520:IF S=1 THEN
PRINT"Ghost's turn":GOTO
300
OF 290 PRINT"Witch's turn"
ON 300 PRINT TAB(16)"From:";
NJ 310 E=E+I:K$=INKEY$:IF K$=""
THEN 310
DC 320 IF ASC(K$)=13 THEN GOSUB
520:RANDOMIZE E:GOTO 20
BD 330 IF ASC(K$)<97 OR ASC(K$)>
121 THEN 310
DM 340 PRINT K$:A=N(ASC(K$)-97):
Z=A
DB 350 LOCATE 23,18:PRINT"To:";
GC 360 K$=INKEY$:IF K$="" THEN 3
60
DO 370 IF ASC(K$)<97 OR ASC(K$)>
121 THEN 360
JN 380 PRINT K$:T1=N(ASC(K$)-97)
GC 390 CK=1:L=0:K1=0:GOSUB 60:CK
=0
KC 400 H=0:A=7
BH 410 IF A=36 THEN 440
MB 420 GOSUB 60:IF H>=1 THEN 440
FH 430 A=A+1:IF A<36 THEN 420
OL 440 IF D THEN 470
DN 450 IF L THEN 480
GF 460 SOUND 99,5:GOTO 280
PO 470 IF L=0 OR K1=0 THEN SOUND
99,5:GOTO 510
DO 480 IF K1=0 AND H>=1 THEN 460
CD 490 F=Z:T=T1:K=K1:GOSUB 170:1
F K1=0 THEN 250
AG 500 A-T:Z=A:H=0:GOSUB 60:IF H
<1 THEN 250
JD 510 GOSUB 520:D=1:GOTO 350
MO 520 LOCATE 20,1:FOR B=1 TO 3:
PRINT:PRINT"
";:NEXT:
LOCATE 21,14:RETURN
AE 530 KEY OFF:SCREEN 1:COLOR 0,
1:CLS:DEFINT C,W
LI 540 DIM C1(913),W1(98),SQ(98),
B(42),D(28),X(35),Y(35),L
(35),XL(35),YL(35),N(28)
LP 550 LINE (50,80)-(81,103),1,B
IH 560 LOCATE 12,12: PRINT "The
Witching Hour
DA 570 LINE (230,80)-(261,103),1
,B
NN 580 GET (50,80)-(81,103),SQ
II 590 FOR A=0 TO 52:READ C1(A):
NEXT
QM 600 PUT (56,82),C1
NA 610 GET (50,80)-(81,103),C1
NC 620 FOR A=0 TO 69:READ W1(A):
NEXT
OC 630 PUT (232,82),W1
MN 640 GET (230,80)-(261,103),W1
II 650 S=-1:FOR A=0 TO 7:READ M(
A):NEXT
PN 660 FOR A=0 TO 28:READ D(A):N
EXT
LD 670 B=48:C=32:D=59:E=12
QL 680 FOR A=0 TO 4:FOR F=0 TO 4
:H=6*A+F+7:X(H)=B*F+D-15:
Y(H)=C*A+E-11
BO 690 L(H)=G+97:N(G)=H:G=G+1:XL
(H)=6*F+10:YL(H)=4*A+1:NE
XT:NEXT
AF 700 CLS:FOR A=0 TO 4:LINE (D,
C*A+E)-(B*4+D,C*A+E),2:NE
XT
BH 710 FOR A=0 TO 4:LINE (B*A+D,
E)-(B*A+D,C*4+E),2:NEXT
OE 720 A=0:F=0:GOSUB 740:A=B+B:G
OSUB 740:F=C+C:GOSUB 740:
A=0:GOSUB 740
EF 730 FOR A=0 TO 42:READ B(A):G
OSUB 760:NEXT:RETURN
GP 740 LINE (D+A,E+F)-(2*B+D+A,2
*C+E+F),2
FJ 750 LINE (D+A,2*C+E+F)-(2*B+D
+A,E+F),2:RETURN
K6 760 IF B(A)=2 THEN RETURN
FP 770 IF B(A)<0 THEN PUT (X(A),
Y(A)),W1,PSET
HN 780 IF B(A)=0 THEN PUT (X(A),
Y(A)),SQ,PSET
KL 790 IF B(A)>0 THEN PUT (X(A),
Y(A)),C1,PSET
JN 800 LOCATE YL(A),XL(A):PRINT
CHR$(L(A)):RETURN
IJ 810 DATA 36,20,-256,192,0,-96
1,0,16128,255,0,-1,192,-3
328,-16177,0,-1,192
LN 820 DATA 16128,255,0,-1009,-1
6381,1020,16368,-16,-1,-3
841,-1,-769,-16336,-193
FC 830 DATA 192,16128,-3841,0,-2
41,252,768,-769,0,16128,2
52,0,-4033,0,16128,192,0
DJ 840 DATA -4081,0,0,255,0
QI 850 DATA 52,20,48,0,3,15360,2
40,768,0,-241,252,-16381,
768,-1,960,192,-256
CP 860 DATA -769,-4081,0,-241,16
383,255,3840,4095,12543,0
,-1009,-1,192,768,-61
DG 870 DATA 207,0,3840,-16129,0,
0,-12289,192,0,-253,-1636
9,0,768,-15361,240
SP 880 DATA -32768,-253,15600,0,
168,-193,-16369,-22016,-8
1,-21761,-24406,16296
IL 890 DATA -1,0,-32768,-241,252
,0,3840,-3841,0,0,-16372
IL 900 DATA -6,1,6,-1,-5,7,5,-7
MN 910 DATA 7,3,7,3,7,0,3,7,3,7,
3,0
DN 920 DATA 7,3,7,3,7,0,3,7,3,7,
3,0,7,3,7,3,7
II 930 DATA 2,2,2,2,2,2,2,-1,-1,
-1,-1,-1,2
CI 940 DATA -1,-1,-1,-1,-1,2,-1
-1,0,1,1,2
BJ 950 DATA 1,1,1,1,1,2,1,1,1,1,
1,2,2,2,2,2,2,2
Program 2: The Witching
Hour, Commodore 64
Version
Version by Kevin Mykytyn, Editorial
Programmer
For instructions on entering this listing, please
refer to "COMPUTH's Guide to Typing In
Programs" published bimonthly in COMPUTE!.
10 POKE 56,56:CLR:Z=1:U=53287
:rem 132
20 POKE53281,0:POKE53280,0:PRI
NT"{CLR}[2 DOWN}"TAB(11)"
{YEL}THE WITCHING HOUR
{2 DOWN}{WHT}" :rem 134
25 PRINTTAB(11)"JOYSTICK IN PO
RT 1{2 DOWN}":PRINTTAB(6)"T
WO JOYSTICKS FOR TWO PLAYER
S :rem 102
30 PRINTTAB(8)"{3 DOWN}{CYN}PR
ESS DOWN FOR ONE PLAYER":PR
INTTAB(11)"{2 DOWN}UP FOR T
WO PLAYERS :rem 252
50 NP=PEEK(56321)AND3:IFNP=3TH
EN50 :rem 40
60 IFNP=2THEN110 :rem 195
70 PRINTTAB(9)"{3 DOWN}{GRN}PR
ESS LEFT TO GO FIRST":PRINT
TAB(11)"{2 DOWN}RIGHT TO GO
SECOND" :rem 141
80 IF(PEEK(56321)AND4)<>4THENF
1=1:GOTO110 :rem 141
90 IF(PEEK(56321)AND8)<>BTHENF
1=-1:GOTO110 :rem 195
100 GOTO80 :rem 50
110 PRINT"{CLR}":GOSUB650:S$="
{OFF}{HOME}{YEL}{13 RIGHT}
":GOTO350 :rem 68
120 H=0:K=0:FORA=7 TO 35:GOSUB
160:NEXT :rem 229
130 GOSUB270:IF H<1 THEN340
:rem 241
140 H=0:K=0:A=T:GOSUB160:IF H<
1 THEN340 :rem 221
150 GOTO130 :rem 99
160 IF B(A)=0 OR B(A)=-S OR B(
A)=2 THEN RETURN :rem 140
170 FOR B=0 TO D(A-7):C=A+M(B)
:IF B(C)=S OR B(C)=2 THEN2
60 :rem 237
180 IF B(C) THEN220 :rem 193
190 SC=RND(1)*.9:IF H<SC THEN
{SPACE}H=SC:F=A:T=C
:rem 157
200 IF CK=1 AND TI=C THEN L=1:
B=8 :rem 207
210 GOTO260 :rem 100
220 IF B(C+M(B)) THEN260
:rem 203
230 SC=1+RND(1)*.9:IF H<SC THE
N H=SC:F=A:T=C+M(B):K=C
:rem 4
240 IF CK=0 THEN260 :rem 231
250 IF T1=C+M(B) THEN L=1:K1=C
:B=8 :rem 70
260 NEXT:RETURN :rem 241
270 A=F:B(T)=B(F):B(F)=0:GOSUB
1130 :rem 147
280 IFK THEN B(K)=0:A=K:GOSUB1
130 :rem 112
290 A=T:GOTO1130 :rem 165
300 GOSUB610:IF S=1 THEN PRINT
LEFT$(S$,14)"{YEL}THE WIT
CHES WIN!":GOTO320:rem 137
310 PRINT LEFT$(S$,15)"{YEL}TH
E GHOSTS WIN!" :rem 116
320 PRINT"{HOME}{DOWN)"SPC(12)
"HIT FIREBUTTON" :rem 79
330 WAIT56321,16,16:POKE53269,
0:POKE53248,0:RUN :rem 186
340 S=-S:Z=-(Z=0):H=0:A=7
:rem 155
345 IF A=36 THEN 300 :rem 212
347 GOSUB160:IFH=0THEN A=A+1:G
OTO345 :rem 140
350 D=0:GOSUB610:IF NP=1 AND S
=-1 THEN Z=1 :rem 39
360 IF F1=-1 THEN Z=1 :rem 49
370 IF NP=1 AND S=F1 THEN120
:rem 209
380 IF S=1 THEN PRINT S$"GHOST
'S TURN":GOTO400 :rem 177
390 PRINT S$"WITCH'S TURN"
:rem 38
400 Q=3:R=3:FL=0:GOTO480
:rem 153
410 IF(PEEK(56320+Z)AND16)<>16
ANDFL=0THENFL=1:GOSUB490:A
=X:ZZ=A:POKEU,5:GOTO430
:rem 136
420 IF(PEEK(56320+Z)AND16)<>16
ANDFL=ITHENGOSUB490:T1=X:P
OKEU,7:GOTO500 :rem 40
430 JX=15-(PEEK(56320+Z)AND15)
:ONJXGOTO440,450,410,460,4
10,410,410,470:GOTO410
:rem 54
440 Q=Q-1*-(Q>1):GOTO480
:rem 76
450 Q=Q+1*-(Q<5):GOTO480
:rem 77
460 R=R-1*-(R>1):GOTO480
:rem 81
470 R=R+1*-(R<5) :rem 67
480 POKE 53248,R*40+47:POKE 53
249,Q*40+26:FORTD=1TO100:N
EXT:GOTO410 :rem 93
490 X=(Q-1)*6+(R-1)+7:WAIT5632
0+Z,16,0:RETURN :rem 29
500 CK=1:L=0:K1=0:GOSUB160:CK=
0 :rem 45
501 H=0:A=7 :rem 58
502 IFA=36THEN510 :rem 210
503 GOSUB160:IFH>=1THEN510
:rem 49
504 A=A+I:IFA<36THEN503:rem 42
510 IF D THEN540 :rem 49
520 IF L THEN545 :rem 63
530 GOSUB620:GOTO350 :rem 187
540 IF L=0 OR K1=0 THEN GOSUB6
20:GOTO600 :rem 187
545 IFK1=0ANDH>=1THEN530
rem 164
550 F=ZZ:T=T1:K=K1:GOSUB270:IF
K1=0 THEN340 :rem 42
560 A=T:ZZ=A:H=0:GOSUB160:IFH<
1 THEN340 :rem 93
600 D=1:Q=3:R=3:POKEU,5:GOTO48
0 :rem 109
610 PRINT"{HOME}{BLK}";:FORA1=
1T02:FORA2=1TO40:PRINT" ";
:NEXTA2,A1:RETURN :rem 15
620 POKE 54276,33:FOR TD=1 TO
{SPACE}600:NEXT:POKE 54276
,32:RETURN :rem 86
630 PRINT"{HOME}";:FORA=0TO23:
PRINT"[<7>]{40 SPACES)";:NEX
T :rem 232
640 RETURN :rem 122
650 W$="[<7>]{RVS}@AB{DOWN}
{3 LEFT}FGH{DOWN}{3 LEFT}L
MN{2 UP}":G$="[<7>]{RVS}CDE
{DOWN}{3 LEFT}IJK{DOWN}
{3 LEFT}OPQ{2 UP}" :rem 18
660 BL$="[<7>]{OFF}O[<Y>]P{DOWN}
{3 LEFT}[<H>] [<N>]{DOWN}
{3 LEFT}L[<P>]@{2 UP}"
:rem 214
670 DIMD(28),B(42),X(35),Y(35)
:rem 22
680 S=-1:FORA=0TO7:READM(A):NE
XT:FORA=0TO28:READD(A):NEX
T :rem 100
690 FORA=0TO4:FORF=0TO4:H=6*A+
F+7:X(H)-5*F+8:Y(H)=5*A+2:
NEXTF,A:FORA=0T042:rem 195
700 READB(A):NEXT:GOSUB770:GOS
UB1190:FORA=0T042:GOSUB113
0:NEXT:RETURN :rem 199
710 DATA -6,1,6,-1,-5,7,5,-7
:rem 64
720 DATA 7,3,7,3,7,0,3,7,3,7,3
,0 :rem 9
730 DATA 7,3,7,3,7,0,3,7,3,7,3
,0,7,3,7,3,7 :rem 241
740 DATA 2,2,2,2,2,2,2,-1,-1,-
1,-1,-1,2 :rem 43
750 DATA -1,-1,-1,-1,-1,2,-1,-
1,0,1,1,2 :rem 34
760 DATA 1,1,1,1,1,2,1,1,1,1,1
,2,2,2,2,2,2,2 :rem 29
770 POKE56334,0:IFPEEK(15361)=
192THEN830 :rem 16
780 PRINT"{CLR}{10 DOWN}"SPC(1
5)"{YEL}PLEASE WAIT"
:rem 27
790 FOR A=15360 TO 15503 :READ
{SPACE}B:POKE A,B:NEXT
:rem 206
800 POKE 1,51:FORA=0TO1023:POK
E14336+A,PEEK(A+53248):NEX
T:POKE 1,55 :rem 85
810 FOR A=14952 TO 14967:READB
:POKE A,B:NEXT :rem 218
820 FOR A=832 TO 895:READB:POK
EA,B:NEXT :rem 14
830 POKE 53272,30:POKE 56334,1
:POKE 53270,216 :rem 86
840 POKE2040,13:POKES3269,1:PO
KE53275,0:POKE53271,1:POKE
53287,7 :rem 88
850 FOR A=54272 TO 54295:POKE
{SPACE}A,0:NEXT:POKE 54296
,15:POKE 54273,10 :rem 49
860 POKE 54277,21:RETURN
:rem 127
870 DATA255,192,192,192,192,19
2,208,212 :rem 196
880 DATA255,0,0,8,8,10,42,5
:rem 86
890 DATA255,3,3,3,3,3,131,3
:rem 82
900 DATA255,192,192,193,192,19
3,193,193 :rem 203
910 DATA255,0,0,80,84,85,153,8
5 :rem 43
920 DATA255,3,3,3,3,3,3,3
:rem 234
930 DATA213,197,197,192,193,22
5,233,234 :rem 197
940 DATA69,84,20,84,81,80,80,8
6 :rem 59
950 DATA3,3,3,3,3,67,19,171
:rem 91
960 DATA192,192,212,213,213,20
8,192,192 :rem 184
970 DATA85,20,20,85,85,85,85,2
1 :rem 54
980 DATA3,23,87,87,71,3,3,67
:rem 160
990 DATA232,224,193,192,192,19
2,192,255 :rem 200
1000 DATA21,84,80,0,0,0,0,255
:rem 162
1010 DATA3,3,3,3,3,3,3,255
:rem 17
1020 DATA192,192,192,192,192,1
92,192,255 :rem 241
1030 DATA21,5,5,5,1,0,0,255
:rem 65
1040 DATA67,67,3,67,83,23,3,25
5,128,64,32,16,8,4,2,1,1,
2,4,8,16,32,64,128:rem 44
1050 DATA255,255,255,192,0,3,1
92,0 :rem 179
1060 DATA3,192,0,3,192,0,3,192
:rem 226
1070 DATA0,3,192,0,3,192,0,3
:rem 119
1080 DATA192,0,3,192,0,3,192,0
:rem 225
1090 DATA3,255,255,255,0,0,0,0
:rem 223
1100 DATA0,0,0,0,0,0,0,0
:rem 144
1110 DATAO,0,0,0,0,0,0,0
:rem 145
1120 DATA0,0,0,0,0,0,0,0
:rem 146
1130 IFB(A)=2THENRETURN
:rem 166
1140 POKE781,Y(A):POKE782,X(A)
:POKE783,0:SYS65520
:rem 110
1150 IFB(A)=0THENPRINTBL$:
:rem 64
1160 IFB(A)>0THENPRINTG$;
:rem 251
1170 IFB(A)<0THENPRINTW$;
:rem 10
1180 RETURN :rem 170
1190 GOSUB630:PRINT"{HOME}
{PUR}";:R$=CHR$(13):A$="
{8 SPACES}{3 RIGHT}CC
{3 RIGHT}CC{3 RIGHT}CC
{3 RIGHT}CC"+R$+R$:rem 82
1200 B$="{8 SPACES}{RIGHT}-
{RIGHT}M{2 RIGHT}-
{2 RIGHT}N{RIGHT}B{RIGHT}
M{2 RIGHT}B{2 RIGHT)N
{RIGHT}B" :rem 89
1210 B$=B$+R$+"{8 SPACES}
{RIGHT}B{2 RIGHT}M{RIGHT}
B{RIGHT}N{2 RIGHT}B
{2 RIGHT}M{RIGHT}B{RIGHT}
N{2 RIGHT}B"+R$+R$
:rem 152
1220 C$="{8 SPACES}{RIGHT}B
{2 RIGHT}N{RIGHT}B{RIGHT}
M{2 RIGHT}B{2 RIGHT}N
{RIGHT}B{RIGHT}M{2 RIGHT}
B"+R$ :rem 199
1230 C$=C$+"{8 SPACES}{RIGHT}B
{RIGHT}N{2 RIGHT}B
{2 RIGHT}M{RIGHT}B{RIGHT}
N{2 RIGHT}B{2 RIGHT}M
{RIGHT}B"+R$+R$ :rem 251
1240 PRINT"{CLR}{3 DOWN}"A$B$A
$C$A$B$A$C$LEFT$(A$,28):R
ETURN :rem 65
The Commodore 64 version of "The
Witching Hour" features sprite graphics.
Use keyboard controls to play "The
Witching Hour" on the VIC-20.
Program 3: The Witching
Hour, VIC-20 Version
Version by Kevin Martin, Editorial
Programmer
For instructions on entering this listing, please
refer to "COMPUTE!': Guide to Typing In
Programs" published bimonthly in COMPUTE!.
10 Z=1:POKE36879,9:POKE36878,2
39 :rem 75
20 PRINT "{CLR}{YEL}{8 DOWN}
{2 SPACES}THE WITCHING HOUR
" :rem 104
30 PRINT "{2 DOWN}CHOOSE: '1'
{SPACE}PLAYER" :rem 157
40 PRINT SPC(8)"{2 DOWN}'2' PL
AYERS" :rem 102
50 GETA$:IFA$=""THEN50:rem 237
55 NP=ASC(A$)-48:IFNP<1ORNP>2T
HEN50 :rem 130
60 IFNP=2THEN110 :rem 195
70 PRINT"{DOWN}PRESS:":PRINT"
{2 SPACES}'1' TO GO FIRST":
PRINT"(2 SPACES)'2' TO GO S
ECOND" :rem 219
75 GETA$:A=ASC(A$+CHR$(0))-48:
IFA<1ORA>2THEN75 :rem 160
80 IFA=1THENF1=1 :rem 186
90 IFA=2THENF1=-1 :rem 233
110 PRINT"{CLR}":GOSUB650:S$="
{OFF}{HOME}{4 RIGHT}":GOTO
350 :rem 161
120 H=0:K=0:FORA=7 TO 35:GOSUB
160:NEXT :rem 229
130 GOSUB270:IF H<l THEN340
:rem 241
140 H=0:K=0:A=T:GOSUB160:IF H<
1 THEN340 :rem 221
150 GOTO130 :rem 99
160 IF B(A)=0 OR B(A)=-S OR B(
A)=2 THEN RETURN :rem 140
170 FOR B=0 TO D(A-7):C=A+M(B)
:IF B(C)=S OR B(C)=2 THEN2
60 :rem 237
180 IF B(C) THEN220 :rem 193
190 SC=RND(1)*.9:IF H<SC THEN
{SPACE}H=SC:F=A:T=C
:rem 157
200 IF CK=1 AND TI=C THEN L=1:
B=8 :rem 207
210 GOTO260 :rem 100
220 IF B(C+M(B)) THEN260
:rem 203
230 SC=1+RND(1)*.9:IF H<SC THE
N H=SC:F=A:T=C+M(B):K=C
:rem 4
240 IF CK=0 THEN260 :rem 231
250 IF Tl=C+M(B) THEN L=1:K1=C
:B=8 :rem 70
260 NEXT:RETURN :rem 241
270 A=F:B(T)=B(F):B(F)=0:GOSUB
1130 :rem 147
280 IFK THEN B(K)=0:A=K:GOSUB1
130 :rem 112
290 A=T:GOTO1130 :rem 165
300 GOSUB610:IF S=1 THEN PRINT
"{HOME}{3 SPACES}THE WITCH
ES WIN!":GOTO320 :rem 86
310 PRINT"{HOME}{3 SPACES}THE
{SPACE}GHOSTS WIN!":rem 64
320 PRINT" (HOME} {DOWN}
{5 SPACES}HIT SPACEBAR"
:rem 176
330 GETA$:IFA$<>" "THEN330
:rem 140
331 RUN :rem 140
340 S=-S:Z=-(Z=0):H=0:A=7
:rem 155
345 IF A=36 THEN 300 :rem 212
347 GOSUB 160:IF H=0 THEN A=A+
1:GOTO 345 :rem 140
350 D=0:GOSUB610:IF NP=1 AND S
=-1 THEN Z=1 :rem 39
360 IF Fl=-1 THEN Z=1 :rem 49
370 IF NP=1 AND S=F1 THEN120
:rem 209
380 IF S=1 THEN PRINT S$"GHOST
'S TURN":GOTO400 :rem 177
390 PRINT S$"WITCH'S TURN"
:rem 38
400 PRINTS$"{DOWN}{2 LEFT}FROM
: (LEFT)"; :rem 109
410 GETA$:A=ASC(A$+CHR$(0)):IF
A<65ORA>89THEN410 :rem 210
420 PRINTA$;:A=N(A-65):Z=A
:rem 5
430 PRINT SPC(5)"TO: {LEFT}";
:rem 137
440 GETA$:Tl=ASC(A$+CHR$(0)):I
FT1<65ORT1>89THEN440
:rem 164
450 PRINTA$:Tl=N(Tl-65):rem 67
500 CK=1:L=0:K1=0:GOSUBl60:CK=
0 :rem 45
501 H=0:A=7 :rem 58
502 IF A=36 THEN 510 :rem 210
503 GOSUB 160:IF H>=1 THEN 510
:rem 49
504 A=A+1:IF A<36 THEN 503
:rem 42
510 IF D THEN540 :rem 49
520 IF L THEN545 :rem 63
530 GOSUB620:GOTO350 :rem 187
540 IF L=0 OR K1=0 THEN GOSUB6
20:GOTO570 :rem 193
545 IF K1=0 AND H>=1 THEN 530
:rem 164
550 F=Z:T=TI:K=Kl:GOSUB270:IF
{SPACE}K1=0 THEN340
:rem 208
560 A=T:Z=A:H=0:GOSUB160:IFH<l
THEN340 :rem 3
570 GOSUB610:PRINT"{HOME}
{2 SPACES}JUMP AGAIN (Y/N)
?" :rem 211
580 GETA$:IFA$<>"Y"ANDA$<>"N"T
HEN580 :rem 55
590 GOSUB610:IFA$="N"THEN S=-S
:GOTO350 :rem 252
600 D=1:PRINT"{HOME}";:GOTO430
:rem 171
610 PRINT"{HOME}{RED}{OFF}";:F
ORA1=1TO3:FORA2=1TO22:PRIN
T" ";:NEXTA2,A1:RETURN
:rem 46
620 POKE 36874,240:FOR TD=1 TO
80:NEXT:POKE 36874,0:RETU
RN :rem 43
630 PRINT"{HOME}";:FORA=0TO21:
PRINT"{22 SPACES}";:NEXT
:rem 76
640 RETURN :rem 122
650 W$="{BLK}{RVS}@AB{DOWN}
{3 LEFT}FGH{DOWN}{3 LEFT}L
MN{2 UP}":G$="{BLK}{RVS}CD
E{DOWN}{3 LEFT}IJK{DOWN}
{3 LEFT}OPQ{2 UP}":rem 254
660 BL$="{YEL){OFF}O[<T>]P{DOWN}
{3 LEFT}[<G>] [<M>]{DOWN}
{3 LEFT}L[<@>]@{2 UP}"
:rem 169
670 DIMD(28),B(42),X(35),Y(35)
,N(28) :rem 75
680 S=-1:FORA=0TO7:READM(A):NE
XT:FORA=0TO28:READD(A):NEX
T :rem 100
690 FORA=0TO4:FORF=0TO4:H=6*A+
F+7:X(H)=4*F+2:Y(H)=4*A+3:
N(G)=H:G=G+1 :rem 190
695 NEXTF,A:FORA=0TO42:rem 110
700 READB(A):NEXT:GOSUB770:GOS
UB1190:FORA=0TO42:GOSUB113
0:NEXT:RETURN :rem 199
710 DATA -6,1,6,-1,-5,7,5,-7
:rem 64
720 DATA 7,3,7,3,7,0,3,7,3,7,3
,0 :rem 9
730 DATA 7,3,7,3,7,0,3,7,3,7,3
,0,7,3,7,3,7 :rem 241
740 DATA 2,2,2,2,2,2,2,-1,-1,-
1,-1,-1,2 :rem 43
750 DATA -1,-1,-1,-1,-1,2,-1,-
1,0,1,1,2 :rem 34
760 DATA 1,1,1,1,1,2,1,1,1,1,1
,2,2,2,2,2,2,2 :rem 29
770 IFPEEK(7169)=192THEN830
:rem 29
780 PRINT"{CLR}{10 DOWN}"SPC(5
)"{YEL}PLEASE WAIT"
:rem 234
790 FOR A=7168 TO 7311:READ B:
POKE A,B:NEXT :rem 115
800 FORA=0TO1023:POKE6144+A,PE
EK(A+32768):NEXT :rem 203
830 POKE 36869,254 :rem 161
860 RETURN :rem 126
870 DATA255,192,192,192,192,19
2,208,212 :rem 196
880 DATA255,0,0,8,8,10,42,5
:rem 86
990 DATA255,3,3,3,3,3,131,3
:rem 82
900 DATA255,192,192,193,192,19
3,193,193 :rem 203
910 DATA255,0,0,80,84,85,153,8
5 :rem 43
920 DATA255,3,3,3,3,3,3,3
:rem 234
930 DATA213,197,197,192,193,22
5,233,234 :rem 197
940 DATA69,84,20,84,81,80,80,8
6 :rem 59
950 DATA3,3,3,3,3,67,19,171
:rem 91
960 DATA192,192,212,213,213,20
8,192,192 :rem 184
970 DATA85,20,20,85,85,85,85,2
1 :rem 54
980 DATA3,23,87,87,71,3,3,67
:rem 160
990 DATA232,224,193,192,192,19
2,192,255 :rem 200
1000 DATA21,84,80,0,0,0,0,255
:rem 162
1010 DATA3,3,3,3,3,3,3,255
:rem 17
1020 DATA192,192,192,192,192,1
92,192,255 :rem 241
1030 DATA21,5,5,5,1,0,0,255
:rem 65
1040 DATA67,67,3,67,83,23,3,25
5 :rem 44
1130 IFB(A)=2THENRETURN
:rem 166
1140 POKE781,Y(A):POKE782,X(A)
:POKE783,0:SYS65520
:rem 110
1150 IFB(A)=0THENPRINTBL$;:RET
URN :rem 90
1160 IFB(A)>0THENPRINTG$;
:rem 251
1170 IFB(A)<0THENPRINTW$;
:rem 10
1175 QS=X(A)+Y(A)*22+38400
:rem 103
1176 FORC1=0TO2:FORC2=0TO2:POK
EQS+Cl*22+C2,14:NEXTC2,Cl
:rem 61
1180 RETURN :rem 170
1190 GOSUB630:R$=CHR$(13):A$="
{2 SPACES}{3 RIGHT}C
{3 RIGHT}C{3 RIGHT}C
{3 RIGHT}C"+R$+R$ :rem 81
1200 B$="{2 SPACES}{RIGHT}-
{RIGHT}M{RIGHT}-{RIGHT}N
{RIGHT}B{RIGHT}M{RIGHT}B
{RIGHT}N{RIGHT}B"+R$+R$
:rem 39
1220 C$="{2 SPACES}{RIGHT}B
{RIGHT}N{RIGHT}B{RIGHT}M
{RIGHT}B{RIGHT}N{RIGHT}B
{RIGHT}M{RIGHT}B"+R$+R$
:rem 244
1240 PRINT"{CLR}{PUR}{4 DOWN}"
A$B$A$C$A$B$A$C$LEFT$(A$,
18) :rem 211
1245 PRINT"{HOME}{GRN}{3 DOWN}
";:G=1:FORA=0TO4:IFA>0TH
ENPRINT"{3 DOWN}":PRINT"
{SPACE}"; :rem 194
1250 FORF=0TO4:PRINTCHR$(G+64)
"{3 RIGHT}";:G=G+1
:rem 101
1260 NEXTF,A:RETURN :rem 213
The Atari version of "The Witching
Hour" uses player/missile graphics and
is played with a joystick.
Program 4: The Witching
Hour, Atari Version
Version by Kevin Mykytyn, Editorial
Programmer
For instructions on entering this listing, please
refer to "COMPUTE!'s Guide to Typing In
Programs" published bimonthly in COMPUTE!.
BN 0 A=PEEK(106)-16:TOP=A-16
:CHBAS=TOP+12:DL=256*TO
P:POKE 106,TOP:CH=CHBAS
*256:POKE 756,CHBAS:SPR
BAS=TOP+4
EF 1 FOR A=1536 TO 1567:READ
B:POKE A,B:NEXT A
FL 2 DATA 160,127,169,0,145,
206
IL 3 DATA 136,16,251,164,203
,162
IN 4 DATA 10,169,248,145,206
,200
LN 5 DATA 169,136,145,206,20
0,202
KB 6 DATA 16,248,169,248,145
,206
IB 7 DATA 104,96
HP 10 FL=0:Z=0:U=704:POKE 82
,0:P1=2:P2=23
LG 20 GRAPHICS 17:POSITION 1
,5:PRINT #6;"THE WITCH
INS HOUR":POSITION 7,1
0:PRINT #6;"press"
IO 25 POSITION 0,13:PRINT #6
;"{RVS}down for one player{OFF}"
:PRINT #6:PRINT #6;" {RVS}u
p for two players{OFF}"
OC 30 NP=STICK(0)-12:IF NP<:1
OR NP>2 THEN 30
MD 60 IF NP=2 THEN 110
NF 70 POSITION 7,17:PRINT #6
;"PRESS":POSITION 2,19
:PRINT #6;"LEFT TO GO
FIRST"
EE 75 PRINT #6;" RIGHT TO GO
SECOND"
KO 80 IF STICK(0)=11 THEN F1
=1:GOTO 110
LB 90 IF STICK(0)=7 THEN F1=
-1:GOTO 110
DC 100 GOTO 80
BO 110 GRAPHICS 0:POKE 752,1
:IF RT=0 THEN POSITIO
N 3,10:PRINT "PLEASE
WAIT, THE SCREEN WILL
BLANK"
BN 111 FOR A=1 TO 700:NEXT A
NJ 112 GRAPHICS 0:SL=PEEK(88
):SH=PEEK(89):FOR I=0
TO 2:POKE DL+I,112:N
EXT I:POKE DL+3,68:PO
KE DL+4,SL:POKE DL+5,
SH
FB 113 FOR I=DL+6 TO DL+27:P
OKE I,4:NEXT I:POKE I
,6:I-I+1:POKE I,65:PO
KE I+1,0:POKE I+2,DL/
256
KJ 114 POKE 560,0:POKE 561,D
L/256:GOSUB 650:GOTO
350
DC 120 H=0:K=0:A=T:FOR A=7 T
0 35:GOSUB 160:NEXT A
PB 130 GOSUB 270:IF H<1 THEN
340
NN 140 H=0:K=0:A=T:GOSUB 160
:IF H<1 THEN 340
GD 150 GOTO 130
IM 160 IF B(A)=0 OR B(A)=-S
OR B(A)-2 THEN RETURN
ON 170 FOR B=0 TO D(A-7):C=A
+M(B):IF B(C)=S OR B(
C)=2 THEN 260
MB 180 IF B(C) THEN 220
MN 190 SC=RND(1)*0.9:IF H<SC
THEN H=SC:F=A:T=C
MP 200 IF CK=1 AND T1=C THEN
L=1:B=8
GE 210 GOTO 260
ML 220 IF B(C+M(B)) THEN 260
DE 230 SC=1+RND(1)*0.9:IF H<
SC THEN H=SC:F=A:T=C+
M(B):K=C
OH 240 IF CK=0 THEN 260
EG 250 IF T1=C+M(B) THEN L=1
:K1=C:B=B
DD 260 NEXT B:RETURN
JD 270 A=F:B(T)=B(F):B(F)=0:
GOSUB 1130
HA 280 IF K THEN B(K)=0:A=K:
GOSUB 1130
KF 290 A=T:GOTO 1130
JL 300 GOSUB 610:IF S=1 THEN
POSITION P1,P2:PRINT
" {RVS}the witches win{OFF}";:
GOTO 320
DF 310 POSITION P1,P2:PRINT
" {RVS}the ghosts win{OFF}";
MH 320 FOR TD=1 TO 1500:NEXT
TD:POSITION P1,P2:PR
INT " {RVS}hit firebutton{OFF}
";
JO 330 IF STRIG(0)<>0 THEN 3
30
E0 335 POKE 53248,0:RT=1:GOT
O 10
SO 340 S=-S:Z=(Z=0):H=0:A=7
NE 345 IF A=36 THEN 300
IM 347 GOSUB 160:IF H=0 THEN
A=A+1:GOTO 345
CG 350 D=0: GOSUB 610: IF NP=1
AND S=-1 THEN Z=0
DA 360 IF F1=-1 THEN Z=0
NB 370 IF NP=1 AND S=F1 THEN
120
AH 380 IF S=1 THEN POSITION
P1,P2:PRINT " {RVS}ghost{OFF}
{{RVS};{OFF}}{RVS}s turn{OFF} ";:GOTO 400
HM 390 POSITION P1,P2:PRINT
" {RVS}whitch{OFF}{{RVS};{OFF}}{RVS}s turn{OFF} ";
JJ 400 Q=3: R=3: FL=0:GOTO 480
GC 410 IF STRIG(Z)=0 AND FL=
0 THEN FL=1:GOSUB 490
:A=X:ZZ=A:POKE U,198:
POKE 77,0:GOTO 430
IF 420 IF STRIG(Z)=0 AND FL=
1 THEN GOSUB 490:T1=X
:POKE U,40:GOTO 500
LJ 430 ON STIK(2)-5 GOTO 43
0,440,430,430,430,450
,430,460,470:GOTO 410
BP 440 Q=Q+1*(Q<5):GOTO 480
CA 450 Q=0-1*(Q>1):GOTD 4130
CE 460 R=R+1*(R<5):GOTO 480
BG 470 R=R-1*(R>1)
AC 480 POKE 203,R*20-5:POKE
53248,0*20+60:V=USR(1
536):FOR TD=1 TO 30:14
EXT TD:GOTO 410
AA 490 X=(R-1)*6+(D-1)+7:IF
STICK(Z)<>15 OR STRIG
(Z)=0 THEN 490
IC 495 RETURN
CN 500 CK=1:L=0:K1=0:GOSUB 1
60: CH:=0
DK 501 H=0:A=7
NC 502 IF A=36 THEN 510
DB 503 GOSUB 160:IF H>=1 THE
N 510
CK 504 A=A+1: IF A<;36 THEN 50
3
DB 510 IF D THEN 540
DP 520 IF L THEN 545
LL 530 GOSUS 620:GOTO 350
1K 540 IF L=0 OR K=0 THEN GO
SUB 620:GOTO 600
KE 545 IF K1=0 AND H>=1 THEN
530
CV 550 F=ZZ:T=T1:K=K1:GOSUB
270:IF K1=0 THEN 340
FN 560 A=T:ZZ=A:H=0:GOSUB 16
0:IF H<1 THEN 340
MK 600 D=1:Q=3:R=3:POKE U,20
0:GOTO 480
JD 610 POSITION P1,P2:FOR A1
=1 TO 18:PRINT " ";:N
EXT A1:RETURN
JF 620 SOUND 1,200,12,15:FOR
TD=1 TO 70:NEXT TD:S
OUND 1,0,0,0:RETURN
HJ 630 RETURN
FC 650 IF RT=0 THEN DIM W$(3
0),G$(30),BL$(30)
AB 655 W$="!":W$(2,2)=CHR$(3
4):W$(3,17)="#(DOWN}
{3 LEFT}'(){DOWN}
{3 LEFT}-./":G$="$%&
{DOWN}{3 LEFT}*+,
{DOWN}{3 LEFT}012":BL
$="596{DOWN}{3 LEFT}
{V} {B}{DOWN}{3 LEFT}
8:7"
BC 670 IF RT=0 THEN DIM D(28
),B(42),M(10),X(35),Y
(35)
BK 680 RESTORE 710:S=-1:FOR
A=0 TO 7:READ T:M(A)=
T:NEXT A:FOR A=0 TO 2
8:READ T:D(A)=T:NEXT
A
LE 690 FOR A=0 TO 4:FOR F=0
TO 4:H=6*A+F+7:X(H)=5
*F+9:Y(H)=5*A:NEXT F:
NEXT A:FOR A=0 TO 42
GI 700 READ T:B(A)=T:NEXT A:
GOSUB 770:GOSUB 1190:
FOR A=0 TO 42:GOSUB 1
130:NEXT A:RETURN
EA 710 DATA -6,1,6,-1,-5,7,5
,-7
AJ 720 DATA 7,3,7,3,7,0,3,7,
3,7,3,0
PB 730 DATA 7,3,7,3,7,0,3,7,
3,7,3,0,7,3,7,3,7
CL 740 DATA 2,2,2,2,2,2,2,-1
,-1,-1,-1,-1,2
CC 750 DATA -1,-1,-1,-1,-1,2
,-1,-1,0,1,1,2
BN 760 DATA 1,1,1,1.1,2,1,1,
1,1,1,2,2,2,2,2,2,2
AO 770 POKE 756,CHBAS:POKE 5
4279,SPRBAS:IF RT=1 T
HEN 830
MM 780 FOR A=0 TO 1023:POKE
CH+A,PEEK(57344+A):NE
XT A
KE 790 RESTORE 870:FOR A=CH+
8 TO CH+215:READ B:PO
KE A,B:NEXT A:FOR A=C
H+472 TO CH+479:READ
B:POKE A,B:NEXT A
NI 800 FOR A=CH TO CH+7:POKE
A,0:NEXT A
BI 810 A=SPRBAS*256+512:POKE
207,A/256:POKE 206,A
-256*PEEK(207)
OC 830 POKE 559,46:POKE 623,
1:POKE 704,40:POKE 53
256,3:POKE 53277,3:PO
KE 708,15:POKE 709,40
:RETURN
ME 870 DATA 255,192,192,192,
192,192,208,212
FG 880 DATA 255,0,0,8,8,10,4
2,5
FC 890 DATA 255,3,3,3,3,3,13
1,3
ML 900 DATA 255,192,192,193,
192,193,193,193
CL 910 DATA 255,0,0,80,84,85
,153,85
OK 920 DATA 255,3,3,3,3,3,3,
3
MF 930 DATA 213,197,197,192,
193,225,233,234
DL 940 DATA 69,84,20,84,81,8
0,80,86
FL 950 DATA 3,3,3,3,3,67,19,
171
LI 960 DATA 192,192,212,213,
213,208,192,192
DG 970 DATA 85,20,20,85,85,8
5,85,21
KA 980 DATA 3,23,87,87,71,3,
3,67
MI 990 DATA 232,224,193,192,
192,192,192,255
KC 1000 DATA 21,84,80,0,0,0,
0,255
BB 1010 DATA 3,3,3,3,3,3,3,2
55
PB 1020 DATA 192,192,192,192
,192,192,192,255
EB 1030 DATA 21,5,5,5,1,0,0,
255
JE 1040 DATA 67,67,3,67,83,2
3,3,255,128,128,32,3
2,8,8,2,2,2,2,8,8,32
,32,128,128
PG 1041 DATA 255,192,192,192
,192,192,192,192,255
,3,3,3,3,3,3,3,3,3,3
,3,3,3,3,255,192,192
,192,192,192,192,192
,255
AF 1042 DATA 255,0,0,0,0,0,0
,0,0,0,0,0,0,0,0,255
,12,12,24,48,0,0,0,0
KG 1130 IF B(A)=2 THEN RETUR
N
DM 1140 POSITION X(A),Y(A)
EA 1150 IF B(A)=0 THEN PRINT
BL$;
PL 1160 IF B(A)>0 THEN PRINT
G$;
AK 1170 IF B(A)<0 THEN PRINT
W$;
KY 1180 RETURN
GO 1190 IF RT=0 THEN DIM R$(
1)
BF 1200 R$=CHR$(155):POSITIO
N 0,1:GOSUB 1300:GOS
UB 1310:GOSUB 1300:G
OSUB 1320:GOSUB 1300
:GOSUB 1310:GOSUB 13
00
ND 1210 GOSUB 1320:R$="":GOS
UB 1300:RETURN
GE 1300 PRINT "{9 SPACES}
{3 RIGHT}{2 R}
{3 RIGHT}{2 R}
{3 RIGHT}{2 R}
{3 RIGHT}{2 R}";R$:R
ETURN
CL 1310 PRINT "{9 SPACES}
{RIGHT}{=}{RIGHT}3
{2 RIGHT}{=}{2 RIGHT}
4{RIGHT}{=}{RIGHT}3
{2 RIGHT}{=}{2 RIGHT}
4{RIGHT}{=}";R$;"
{9 SPACES}{RIGHT}
{=}{2 RIGHT}3{RIGHT}
{=}{RIGHT}4{2 RIGHT}
{=}{2 RIGHT}3{RIGHT}
{=}{RIGHT}4{2 RIGHT}
{=}";R$:RETURN
CM 1320 PRINT "{9 SPACES}
{RIGHT}{=}{2 RIGHT}4
{RIGHT}{=}{RIGHT}3
{2 RIGHT}{=}{2 RIGHT}
4{RIGHT}{=}{RIGHT}3
{2 RIGHT}{=}";R$;"
{9 SPACES}{RIGHT}
{=}{RIGHT}4{2 RIGHT}
{=}{2 RIGHT}3{RIGHT}
{=}{RIGHT}4{2 RIGHT}
{=}{2 RIGHT}3{RIGHT}
{=}";R$:RETURN
Program 5: The Witching
Hour, Apple II Version
Version by Kevin Martin, Editorial
Programmer
For instructions on entering this listing, please
refer to "COMPUTU's Guide to Typing In
Programs" published bimonthly in COMPUTE!
90 10 Z - It HOME : TEXT
6E 11 POKE 232,96: POKE 233,3: S
CALE= 271 ROT= 0: HCOLORw
3
EA 20 VTAB 8: HTAB 11: PRINT "TH
E WITCHING HOUR"
17 30 VTAB 12: HTAB 6: PRINT "PR
ESS '1' FOR ONE PLAYER"
92 40 HTAB 12: PRINT "'2' FOR TW
0 PLAYERS"
DI 50 GET A$:NP = ASC (A$) - 48:
IF NP < 1 OR NP > 2 THEN
50
B6 60 IF NP = 2 THEN 110
EB 70 HTAB 5: PRINT "DO YOU WANT
TO GO FIRST (Y/N)?"l
2D 80 GET A$:F1 = 1: IF A$ < > "
Y" AND A$ < > "N" THEN 80
38 90 IF A$ = "N" THEN F1 = - 1
96 110 HOME : HGR : GOSUB 650: G
OTO 350
D2 120 H = 0:K = 0: FOR A = 7 TO
35: GOSUB 160: NEXT
BE 130 GOSUB 270: IF H < 1 THEN
340
ES 140 H = 0:K = 0:A = T: GOSUB
160: IF H < 1 THEN 340
97 150 GOTO 130
16 160 IF B(A) = 0 OR B(A) = - S
OR B(A) = 2 THEN RETURN
ES 170 FOR B = 0 TO D(A - 7):C =
A + M(B): IF B(C) = S OR
B(C) = 2 THEN 260
F1 180 IF B(C) THEN 220
1C 190 SC = RND (0) * .9: IF H <
SC THEN H = SC:F = A:T =
C
46 200 IF CK = 1 AND Tl = C THEN
L = 1:B = 7
14 210 GOTO 260
52 220 IF B(C + M(B)) THEN 260
BF 230 SC = 1 + RND (0) * .9: IF
H < SC THEN H = SC:F = A
:T-C+M(B):K = C
08 240 IF CK = 0 THEN 260
EF 250 IF T1 = C + M(B) THEN L =
1:K1 = C:B = 7
CA 260 NEXT : RETURN
IA 270 A = F:B(T) = B(F):B(F) =
0: GOSUB 1130
39 280 IF K THEN S(K) = 0:A = K:
GOSUB 1130
04 290 A = T: GOTO 1130
5C 300 GOSUB 610: IF S = 1 THEN
VTAB 21: HTAB 12: PRINT "
THE WITCHES WIN!": GOTO 3
20
0A 310 VTAB 21: HTAB 12: PRINT "
THE GHOSTS WIN!"
5E 320 HTAB 10: PRINT "PRESS THE
<SPACEBAR>"
76 330 GET A$: IF AS < > " " THE
N 330
AF 331 RUN
D7 340 S = - S:Z = - (Z = 0):H =
0: FOR A = 7 TO 331 GOSU
B 160: NEXT : IF H = 0 TH
EN 300
44 350 D = 0: GOSUB 610: IF NP =
1 AND S = - 1 THEN Z = 1
EA 360 IF F1 = - 1 THEN Z = 1
33 370 IF NP = 1 AND S = F1 THEN
120
4F 380 IF S = 1 THEN VTAB 21: HT
AB 12: PRINT "THE GHOST'S
TURN": GOTO 400
66 390 VTAB 21: HTAB 12: PRINT "
THE WITCH'S TURN"
E1 400 VTAB 22: HTAB 12: PRINT "
FROM: "; CHR$ (8);
DA 410 GOSUB 1250
B7 420 PRINT A$;:A = N( ASC (A$)
- 65):Z = A
DC 430 HTAB 25: PRINT "TO: "; CH
R$ (8);
E0 440 GOSUB 1250
E9 450 PRINT A$;:T1 = N( ASC (A$
) - 65):CK = 1:L = 0:Kl =
0: GOSUB 160:CK = 0
DB 451 H = 0:A = 7
62 452 IF A = 36 THEN 460
64 453 GOSUB 160: IF H > - 1 THE
N 460
B1 454 A = A + 1: IF A < 36 THEN
453
BC 460 IF D THEN 540
10 470 IF L THEN 545
96 530 GOSUB 620: GOTO 350
7D 540 IF L = 0 OR K1 = 0 THEN G
OSUB 620: GOTO 570
A9 545 IF Kl = 0 AND H > = 1 THE
N 530
45 550 F = Z:T = T1:K = K1: GOSU
B 270: IF K1 = 0 THEN 340
97 560 A = T:Z = A:H = 0: GOSUB
160: IF H < 1 THEN 340
18 570 GOSUB 610: VTAB 21: HTAB
1l: PRINT "JUMP AGAIN (Y/
N)?";
62 580 GET A$: IF A$ < > "Y" AND
A$ < > "N" THEN 580
31 590 GOSUB 610: IF A$ = "N" TH
EN S = - S: GOTO 350
72 600 D = 1: VTAB 221 GOTO 430
4F 610 PRINT : VTAB 21: FOR J =
1 TO 2: FOR I = 1 TO 40:
PRINT "";: NEXT I,J
1C 611 RETURN
03 620 PRINT CHR$ (7);: RETURN
14 630 HOME : RETURN
E7 650 DIM D(28),B(42),X(35),Y(3
5),N(2B)
DE 660 S = - 1: FOR A = 0 TO 7:
READ M(A): NEXT : FOR A =
0 TO 28: READ D(A): NEXT
53 670 FOR A = 0 TO 4: FOR F = 0
TO 4:H = 6 * A + F + 7:X
(H) = 4 * F + 11:Y(H) = 4
* A:N(G) = H: G = G + 1:
NEXT F,A
5B 680 FOR A = 0 TO 42: READ B(A
): NEXT : FOR A = 0 TO 6:
READ F: POKE 864 + A,F:
NEXT : GOSUB 760: GOSUB 1
190: FOR A = 0 TO 42: GOS
UB 1130: NEXT : RETURN
CB 690 DATA -6,1,6,-1,-5,7,5,-7
44 700 DATA 7,3,7,3,7,0,3,7,3,7,
3,0
1A 710 DATA 7,3,7,3,7,0,3,7,3,7,
3,0,7,3,7,3,7
A9 720 DATA 2,2,2,2,2,2,2,-1,-1,
-1,-1,-1,2
44 730 DATA -1,-1,-1,-1,-1,2,-1,
-1,0,1,1,2
BE 740 DATA 1,1,1,1,1,2,1,1,1,1,
1,2,2,2,2,2,2,2
38 750 DATA 1,0,4,0,44,62,0
A2 760 FOR A = 768 TO 855: READ
F: POKE A,F: NEXT
7F 770 POKE 6,0: POKE 7,141: IF
PEEK (191 * 256) = 76 THE
N PRINT CHR$ (4);"PR#A$30
0": GOTO 790
C8 780 POKE 54,0: POKE 55,3: CAL
L 1002
E3 790 FOR A = 36352 TO 36567: R
EAD F: POKE A,F: NEXT
18 800 RETURN
2C 1130 IF B(A) = 2 THEN RETURN
22 1140 VTAB Y(A) + 1: HTAB X(A)
45 1150 IF B(A) < 0 THEN PRINT "
@AB": HTAB X(A): PRINT "
FGH": HTAB X(A): PRINT "
LMN"
30 1160 IF B(A) > 0 THEN PRINT "
CDE": HTAB X(A): PRINT "
IJK": HTAB X(A): PRINT "
OPQ"
AB 1170 IF B(A) = 0 THEN PRINT "
RST": HTAB X(A): PRINT "
UVW": HTAB X(A): PRINT "
XYZ"
F3 1180 RETURN
EA 1190 HCOLOR= 3
71 1200 FOR A = 11 TO 139 STEP 3
2: HPLOT 78,A TO 190,A:
NEXT
6A 1210 FOR A = 78 TO 190 STEP 2
8: HPLOT A,11 TO A,139:
NEXT
F8 1220 HPLOT 78,11 TO 194,140:
HPLOT 194,11 TO 78,140
39 1230 HPLOT 78,76 TO 136,11 TO
194,76 TO 136,140 TO 78
,76
2E 1249 RETURN
D2 1250 F = 2:T1 = 2:QS = 2
2B 1260 SCALE= QS
83 1270 XDRAW 1 AT (T1 * 4 + 10)
* 7 - 3,(F * 4) * 8 + 25
3E 1275 PRINT CHR$ (F * 5 + T1 +
65); CHR$ (8);
49 1280 A$ = "": IF PEEK ( - 163
84) > 128 THEN GET A$
AF 1285 XDRAW 1 AT (T1 * 4 + 10)
* 7 - 3,(F * 4) * 8 + 25
FB 1287 QS = QS + 5: IF QS > 27
THEN QS = 2
EE 1290 IF AS = "I" AND F > 0 TH
EN F = F - 1
01 1291 IF A$ = "K" AND F < 4 TH
EN F = F + 1
BB 1292 IF A$ = "J" AND T1 > 0 T
HEN T1 = T1 - 1
B7 1293 IF A$ = "L" AND T1 < 4 T
HEN T1 = T1 + 1
A2 1300 IF A$ < > CHR$ (13) THEN
1260
40 1400 A$ = CHR$ (F * 5 + T1 +
65): RETURN
D6 1500 DATA 216,120,133,69,134,
70
2E 1510 DATA 132,71,166,7,10,10
44 1520 DATA 176,4,16,62,48,4
B8 1530 DATA 16,1,232,232,10,134
61 1540 DATA 27,24,101,6,133,26
A3 1550 DATA 144,2,230,27,165,40
95 1560 DATA 133,8,165,41,41,3
81 1570 DATA 5,230,133,9,162,8
3E 1580 DATA 160,0,177,26,36,50
89 1590 DATA 48,2,73,127,164,36
47 1600 DATA 145,8,230,26,208,2
9F 1610 DATA 230,27,165,9,24,105
0F 1620 DATA 4,133,9,202,208,226
87 1630 DATA 165,69,166,70,164,7
1
72 1640 DATA 88,76,240,253
71 1700 DATA 255,129,129,129,129
,129
F0 1710 DATA 139,171,255,1289128
,192
CB 1720 DATA 192,208,212,224,255
,192
6F 1730 DATA 192,192,194,202,234
,199
9F 1740 DATA 255,129,129,225,129
,225
60 1750 DATA 225,225,255,128,128
,135
8C 1760 DATA 159,255,238,255,255
,192
C9 1770 DATA 192,192,192,192,192
,192
8D 1780 DATA 171,171,171,169,129
,129
A0 1790 DATA 193,199,229,181,181
,165
90 1800 DATA 168,170,170,170,199
,193
48 1810 DATA 193,193,193,195,199
,204
Dl 1820 DATA 129,129,159,255,255
,199
B9 1830 DATA 193,193,159,142,142
,255
C1 1840 DATA 255,191,191,255,192
,248
0C 1850 DATA 255,255,241,192,192
,192
55 1860 DATA 223,223,255,159,135
,129
72 1870 DATA 129,255,170,170,170
,168
0F 1880 DATA 170,139,128,255,216
,240
69 1890 DATA 255,193,192,192,192
,255
7E 1900 DATA 129,129,129,129,129
,129
13 1910 DATA 129,255,255,254,252
,248
17 1920 DATA 248,224,128,255,193
,193
47 1930 DATA 193,192,193,207,254
,255
39 1940 DATA 127,1,1,1,1,1
46 1950 DATA 1,1,127,0,0,0
D2 1960 DATA 0,0,0,0,127,64
25 1970 DATA 64,64,64,64,64,64
A4 1980 DATA 1,1,1,1,1,1
53 1990 DATA 1,1,0,0,0,0
20 2000 DATA 0,0,0,0,64,64
FB 2010 DATA 64,64,64,64,64,64
7B 2020 DATA 1,1,1,1,1,1
3B 2030 DATA 1,127,0,0,0,0
FF 2040 DATA 0,0,0,127,64,64
F6 2050 DATA 64,64,64,64,64,127
A ghost is about to be jumped in this
game of "The Witching Hour" for Apple
II computers.
"The Witching Hour" for the TI-9914A
works with console BASIC as well as TI
Extended BASIC.
Program 6: The Witching
Hour, TI-99/4A Version
Version by Patrick Parrish,
Programming Supervisor
100 GOTO 150
110 FOR I=1 TO LEN(H$)
120 CALL HCHAR(R,C+I,ASC(
SEG$(H$,I,1)))
130 NEXT I
140 RETURN
150 DIM 8(42),D(28),N(28)
,X(35),Y(35)
160 GOSUB 1650
170 GOTO 930
180 H=0
190 K=0
200 FOR A=7 TO 35
210 GOSUB 310
220 NEXT A
230 GOSUB 600
240 IF H<1 THEN 860
250 H=0
260 K=0
270 A=T
280 GOSUB 310
290 IF H<1 THEN 860
300 GOTO 230
310 IF (B(A)<>0)*(B(A)<>-
S)*(B(A)<>2)THEN 330
320 RETURN
330 FOR B5=0 TO D(A-7)
340 C=A+M(B5)
350 IF (B(C)=S)+(B(C)=2)T
HEN 580
360 IF B(C)THEN 450
370 SC=RND*.9
380 IF H>-SC THEN 426
396 H=SC
400 F=A
410 T=C
420 IF (CK<>1)+(T1<>C)THE
N 580
430 LL=1
440 GOTO 570
450 IF B(C+M(B5))THEN 580
460 SC=1+RNDf.9
470 IF H>=SC THEN 520
480 H=SC
490 F=A
506 T=C+M(85)
510 K=C
520 IF CK=0 THEN 580
530 K=0
540 IF T1<>C+M(B5)THEN 58
0
550 LL=1
560 K1=C
570 B5=7
580 NEXT B5
590 RETURN
600 A=F
610 B(T)=B(F)
620 B(F)=0
630 GOSUB 2790
640 IF K=0 THEN 680
650 B(K)=0
660 A=K
670 GOSUS 2790
680 A=T
690 GOTO 2790
700 GOSUB 1630
710 IF S<>1 THEN 740
720 H$="THE WITCHES WIN!"
730 GOTO 750
740 H$="THE GHOSTS WIN!"
750 R=23
760 C=9
770 GOSUB 110
780 R=24
790 C=5
800 H$="HIT A KEY TO PLAY
AGAIN"
810 GOSUB 110
820 CALL KEY(0,KK,SS)
830 IF SS=0 THEN 820
840 GOSUB 2190
850 GOTO 930
860 S=-S
870 H=0
880 A=7
890 IF A=36 THEN 700
900 GOSUB 310
910 A=A+1
920 IF H=0 THEN 890
930 DD=0
940 GOSUB 1630
950 IF S<>1 THEN 980
960 H$="GHOST'S TURN"
970 GOTO 990
980 H$="WITCH'S TURN"
990 R=22
1000 C=10
1010 GOSUB 110
1020 R=23
1030 C=9
1040 H$="FROM:"
1050 GOSUB 110
1060 RANDOMIZE
1070 CALL KEY(0,KK,SS)
1080 IF 88=0 THEN 1060
1090 IF KK<>13 THEN 1120
1100 GOSUB 1630
1110 GOTO 180
1120 IF (KK<65)+(KK>89)TH
EN 1060
1130 H$=CHR$(KK)
1140 C=15
1150 GOSUB 110
1160 A=N(KK-65)
1170 Z=A
180 H$="TO:"
1190 IF DD<>1 THEN 1210
1200 CALL HCHAR(23,10,32,
7)
1210 R=23
1220 C=17
1230 GOSUB 110
1240 CALL KEY(0,KK,SS)
1250 IF 88=0 THEN 1240
1260 H$=CHR$(KK)
1270 C=21
1280 BOGUS 110
1290 T1=N(KK-65)
1300 CK=1
1310 LL=0
1320 K1=0
1330 GOSUB 310
1340 CK=0
1350 H=0
1360 A=7
1370 IF A=36 THEN 1420
1380 GOSUB 310
1390 IF H>=1 THEN 1420
1400 A=A+1
1410 IF A<36 THEN 1380
1420 IF DD THEN 1460
1430 IF LL THEN 1490
1440 CALL SOUND(50,220,5)
1450 GOTO 930
1460 IF (LL<>0)*(K1<>6)TH
EN 1490
1470 CALL SOUND(50,220,5)
1480 GOTO 1600
1490 IF (K1=0)*(H>=1)THEN
1440
1500 F=Z
1510 K=KI
1520 T=T1
1530 GOSUB 600
1540 IF K1=0 THEN 860
1550 A=T
1560 Z=A
1570 H=0
1580 GOSUB 310
1590 IF H<1 THEN 860
1600 DD=1
1610 CALL HCHAR(23,22,32)
1620 GOTO 1180
1630 CALL HCHAR(22,1,32,9
6)
1640 RETURN
1650 FOR I=96 TO 104
1660 READ A$
1670 CALL CHAR(I,A!)
1680 NEXT I
1690 DATA 00000000000000F
F,0101010101010101,F
F80808080808080
1700 DATA FF0101010101010
1,8080808080808080,8
040201008040201
1710 DATA 010204081020408
0,01010101010101FF,F
F00000000000000
1720 FOR I=112 TO 115
1730 READ A$
1740 CALL CHAR(I,A$)
1750 NEXT I
1760 DATA 0000A0FCFE7E3F1
E,00080BOC1C3E1CB8,1
C090101EIFFE302,F0EB
C8C4E2FFE000
1770 FOR I=120 TO 123
1780 READ A$
1790 CALL CHAR(I,A$)
1800 NEXT I
1810 DATA 0001113113IF030
7,40F050F4F6F4FCE0,0
70F0F1F3F3F1C08,E000
800000000000
1820 CALL CLEAR
1830 CALL COLOR(11,4,1)
1840 CALL COLOR(12,15,1)
1850 FOR I=1 TO 8
1860 CALL COLOR(I,16,1)
1870 NEXT I
1880 CALL SCREEN(2)
1890 PRINT TAB(6))"THE WI
TCHINS HOUR"::::::::
:::::
1900 CALL HCHAR(14,8,112)
1910 CALL HCHAR(14,9,113)
1920 CALL HCHAR(15,8,114)
1930 CALL HCHAR(15,9,115)
1940 CALL HCHAR(14,23,120)
1950 CALL HCHAR(14,24,121)
1960 CALL HCHAR(15,23,122)
1970 CALL HCHAR(15,24,123)
1980 FOR A=0 TO 7
1990 READ M(A)
2000 NEXT A
2010 FOR A=0 TO 28
2020 READ D(A)
2030 NEXT A
2040 FOR A=0 TO 4
2050 FOR F=0 TO 4
2060 H=6*A+F+7
2070 X(H)=4*F+8
2080 Y(H)=4*A+2
2090 N(B)=H
2100 G=G+1
2110 NEXT F
2120 NEXT A
2130 DATA -6,1,6,-1,-5,7,
5,-7
2140 DATA 7,3,7,3,7,0,3,7
,3,7,3,0
2150 DATA 7,3,7,3,7,0,3,7
,3,7,3,0,7,3,7,3,7
2160 DATA 2,2,2,2,2,2,2,-
1,-1,-1,-1, -1 ,2
2170 DATA
2,-1,-1,0,1,1,2
2180 DATA 1,1,1,1,1,2,1,1
,1,1,1,2,2s292,2,2p2
2190 CALL COLOR(11,1,1)
2200 S=-1
2210 CALL COLOR(12,1,1)
2220 CALL COLOR(9,1,1)
2230 CALL COLOR(10,1,1)
2240 CALL CLEAR
2250 H$="...SETTING UP GA
ME BOARD"
2260 R=23
2270 C=3
2280 GOSUB 110
2290 FOR ROW=5 TO 17 STEP
4
2300 FOR COL=8 TO 24 STEP
4
2310 CALL HCHAR(ROW,COL,1
03)
2320 NEXT COL
2330 NEXT ROW
2340 FOR ROW=2 TO 18 STEP
4
2350 FOR COL=7 TO 23 STEP
4
2360 CALL HCHAR(ROW,COL+3
,100)
2370 CALL HCHAR(ROW+I,COL
+4,99)
2380 CALL HCHAR(ROW,COL,9
7)
2390 CALL HCHAR(ROW-1,COL
+2,96)
2400 CALL HCHAR(ROW+1,COL
+3,98)
2410 CALL HCHAR(ROW+2,COL
+1,99)
2420 CALL HCHAR(ROW+2,COL
+2,104)
2430 NEXT COL
2440 NEXT ROW
2450 FOR ROW=3 TO 19 STEP
4
2460 CALL HCHAR(ROW,7,97)
2470 CALL HCHAR(ROW,26,10
0)
2480 CALL HCHAR(ROW,27,32
)
2490 NEXT ROW
2500 FOR COL=8 TO 24 STEP
4
2510 CALL HCHAR(1,COL,96,
2)
2520 CALL HCHAR(20,COL,10
4)
2530 NEXT COL
2540 FOR ROW=4 TO 12 STEP
8
2550 FOR COL=10 TO 18 STE
P 8
2560 CALL HCHAR(ROW,COL,1
01)
2570 CALL HCHAR(ROW,COL+5
,102)
2580 CALL HCHAR(ROW+1,COL
+4,102)
2590 CALL HCHAR(ROW+4,COL
+1,102)
2600 CALL HCHAR(ROW+5,COL
,102)
2610 CALL HCHAR(ROW+4,COL
+4,101)
2620 NEXT COL
2630 NEXT ROW
2640 RESTORE 2160
2650 CALL HCHAR(23,3,32,2
5)
2660 0-0
2670 FOR A=0 TO 42
2680 READ B(A)
2690 BOSUB 2790
2700 IF B(A)=2 THEN 2730
2710 CALL HCHAR(Y(A)-1,X(
A)-1,0+65)
2720 Q=Q+1
2730 NEXT A
2740 CALL COLOR(9,14,1)
2750 CALL COLDR(10,14,1)
2760 CALL COLOR(11,4,1)
2770 CALL COLOR(12,15,1)
2780 RETURN
2790 IF B(A)<>2 THEN 2810
2800 RETURN
2810 IF B(A)<>0 THEN 2850
2820 CALL HCHAR(Y(A),X(A)
,32,2)
2830 CALL HCHAR(Y(A)+1,X(
A),32,2)
2840 GOTO 2950
2850 IF B(A)>0 THEN 2910
2860 CALL HCHAR(Y(A),X(A)
,112)
2870 CALL HCHAR(Y(A),X(A)
+1,113)
2880 CALL HCHAR(Y(A)+1,X(
A),114)
2890 CALL HCHAR(Y(A)+1,X(
A)+1,115)
2900 GOTO 2950
2910 CALL HCHAR(Y(A),X(A)
,120)
2920 CALL HCHAR(Y(A),X(A)
+1,121)
2930 CALL HCHAR(Y(A)+1,X(
A),122)
2940 CALL HCHAR(Y(A)+1,X(
A)+1,123)
2950 RETURN