The Seven Skulls

Type
Game
Category
Rotation logic puzzle
Author
Bernard Taylor
Published in
Antic, October 1988 (Vol. 7, No. 6), Game of the Month
Year
1988
Language
Atari BASIC
Requirements
32K RAM with disk (24K with cassette), Atari BASIC, joystick in port 1
A row of seven white skulls facing different directions between grey stone ledges, with a golden pointer under the middle skull, a gong at the top, and 30 MOVES and LEVEL 1 counters

About the program

Antic billed it as "the Rubik's Cube of ancient Japan". You're a shipwrecked sailor in 17th-century Japan, captured and sentenced to death for being a barbarian. But Princess Tanuki, sister of the Shogun Lord Tokugawa, demands that you face the test of the Seven Skulls, a logic puzzle used to pick the Shogun's best warriors. Seven skulls sit in a row, each with its chin pointing left, right, up or down. Get all seven chins pointing down.

The catch: turning a skull clockwise also turns the skulls on both sides of it. Turning an end skull turns its neighbour and the skull at the opposite end, as if the row were a ring. Bernard Taylor, a bulk-mailing specialist from Roseville, California, said he loved strategy games and claimed to have played, if not solved, every Infocom adventure released for the Atari 800.

Typing it in

The game screen and the skulls are redefined characters, and most of the special characters are in line 1002 (the title border, built from inverse CTRL-Q, CTRL-R and CTRL-E line pieces) and line 2070 (a short machine-language routine stored as a string). {inv}…{/inv} means type with the Atari (inverse) key on, and {CTRL-Q} means hold CTRL and press Q. The skull pieces are printed as ordinary punctuation, such as "&'", "()" and "!#", in the tiny subroutines at lines 360–590. Each pair is the top or bottom half of a skull facing one way, so copy them exactly.

How to play

After "ONE MOMENT, PLEASE" (the program builds its character set slowly in BASIC), the gong sounds and the skulls appear. Move the golden pointer left and right with the joystick and press the button to turn the skull above it. You have 30 moves for each level. Line up all seven and their eyes spin, a tune plays, and a new pattern is dealt. When you run out of moves, the game tells you the rank you reached: Shark Bait, Slave, Food Taster, Foot Soldier, Bowman, Castle Guard, Samurai or Daimyo. Clear all eight levels and a scrolling message tells you that you marry the princess and become Shogun. SELECT restarts the test at any time.

The article hinted that the princess sometimes gives a second chance to those who show exceptional promise. A double gong tells you that you've got one. In the code (line 608), that happens once per game, if you fail after level 3 while averaging fewer than 20 moves per level.

How it works

Each skull is four characters, 2×2 in GRAPHICS 2, and each of the four orientations has its own pair of top and bottom subroutines (360/370, 400/410, 440/450, 580/590). To find out which way a skull faces, line 200 LOCATEs its lower half and uses the character code itself as a line number: GOSUB Z*10 prints the next orientation. That neatly makes the screen the program's only record of the puzzle. The win check (line 208) LOCATEs all seven top-left characters and counts those that are "!" (code 33), the chin-down skull.

The table D() holds the offsets −1, 0, +1 for "this skull and its neighbours". The pointer positions C(1) to C(9) include an extra entry at each end, which is how the end skulls wrap round to the other end of the row. The spinning eyes are done by POKEing new bytes into the character set (lines 595–601), so every skull's eyes change at once without anything being reprinted.

Variations to try

  • Make it easier: change MV=30 (lines 5 and 604) to 40.
  • Change the rank names in the DATA at line 3100.

Listing

1 REM THE SEVEN SKULLS
2 REM BY BERNARD TAYLOR
3 REM (c)1988, ANTIC PUBLISHING INC.
4 GOSUB 1000:GOTO 2000
5 POSITION C(R),8:? #6;"  ":MV=30
6 FOR J=1 TO 2:Q=2.8:L=15:M=12
7 FOR P=1 TO 2
8 FOR DE=L TO M STEP -Q:SOUND N,255,10,DE:SOUND 1,248+DE/2,10,DE:POSITION 9,2:? #6;"  ":FOR DF=N TO 8:NEXT DF
9 POSITION 9,2:? #6;"{inv}>?{/inv}":SOUND 1,248+DE/2,10,DE:NEXT DE:L=10:M=N:Q=0.6
10 NEXT P:FOR DE=N TO 200:NEXT DE:IF LVL=1 THEN 16
11 NEXT J
12 FOR J=1 TO 7:POSITION C(J+1),5:GOSUB I(J):POSITION C(J+1),6:GOSUB I(J)+10:NEXT J:TRY=2
16 R=5:POSITION 9,8:? #6;"{inv}<={/inv}":POSITION N,1:? #6;MV
18 A=STICK(0):IF STRIG(0)=N THEN 200
20 IF PEEK(53279)=5 THEN 607
21 IF A=15 THEN 18
22 POSITION C(R),8:? #6;"  "
25 DX=(A=7)-(A=11):R=R+DX
30 IF R>8 THEN R=2
32 IF R<2 THEN R=8
60 POSITION C(R),8:? #6;"{inv}<={/inv}":FOR DE=8 TO N STEP -1:SOUND N,80+DE,10,DE:NEXT DE
70 GOTO 18
200 FOR J=1 TO 3:LOCATE C(R+D(J)),6,Z:POSITION C(R+D(J)),5:GOSUB Z*10:POSITION C(R+D(J)),6:GOSUB Z*10+10
205 FOR DE=8 TO N STEP -1:SOUND N,140+DE,10,DE:NEXT DE:NEXT J:SS=N
206 MV=MV-1:MV1=MV1+1:POSITION N,1:? #6;"  ":POSITION N,1:? #6;MV
208 FOR J=N TO 18 STEP 3:LOCATE J,5,Z1:IF Z1=33 THEN SS=SS+1:NEXT J
215 IF SS=7 THEN LVL=LVL+1:POSITION C(R),8:? #6;"  ":POKE K4,N:GOTO 595
216 IF MV>N THEN POKE 77,N:GOTO 20
217 IF LVL=1 THEN 607
218 GOTO 607
360 ? #6;"&'":RETURN
370 ? #6;"()":RETURN
400 ? #6;"*+":RETURN
410 ? #6;",-":RETURN
440 ? #6;"./":RETURN
450 ? #6;":;":RETURN
580 ? #6;"!#":RETURN
590 ? #6;"$%":RETURN
595 FOR J=1 TO 3:RESTORE 3200
598 FOR P=1 TO 8:READ SH1,SH2,SH3,SH4
600 POKE ST+SH1,SH2:POKE ST+SH3,SH4
601 FOR DE=1 TO 3:NEXT DE:NEXT P:NEXT J
602 FOR T=14 TO N STEP -1:POKE K,T:S=INT(RND(0)*3)+2
603 SOUND N,G(14-T)/2,10,10:SOUND 1,G(14-T)/S,10,8:SOUND 2,G(14-T)/S+0.6,10,4:FOR DE=1 TO 40:NEXT DE:NEXT T
604 FOR DE=1 TO 80:NEXT DE:FOR J=N TO 2:SOUND J,N,N,N:NEXT J:MV=30:POSITION 18,1:? #6;LVL
605 IF LVL=9 THEN 1500
606 GOTO 615
607 FOR J=90 TO 12 STEP -2:POKE K,J:SOUND N,200-J,10,12:FOR DE=N TO 10:NEXT DE:NEXT J:SOUND N,N,N,N
608 IF TRY=1 AND LVL>3 AND INT(MV1/LVL)<20 THEN 5
610 RESTORE 3100:FOR J=1 TO LVL:READ A$:NEXT J:POSITION (20-LEN(A$))/2,3:? #6;A$
611 POKE DL+15,6:POKE DL+16,6:POSITION 1,10:? #6;"{inv}push START to play{/inv}":POSITION 7,11:? #6;"{inv}again{/inv}"
612 IF PEEK(53279)<>6 THEN 612
613 POKE 559,N
614 FOR DE=N TO 50:NEXT DE:POKE DL+15,7:POKE DL+16,7:POSITION C(R),8:? #6;"  ":POKE K4,N:GOTO 2195
615 FOR J=2 TO 8
616 SK=INT(RND(0)*7)+1:IF E(SK)=N THEN 616
618 IF LVL>3 THEN I(J-1)=E(SK)
620 POSITION C(J),5:GOSUB E(SK):POSITION C(J),6:GOSUB E(SK)+10:E(SK)=N
625 NEXT J
630 FOR P=1 TO 7:E(P)=F(P):NEXT P
640 POSITION C(R),8:? #6;"  ":POKE K,12:GOTO 16
1000 GRAPHICS 0:POKE 752,1:POKE 559,0:DIM AA$(22),BB$(22):K=708:K1=709:K2=710:K3=711:K4=712:N=0
1002 AA$="{inv}{CTRL-Q}{CTRL-R}{CTRL-Q}{CTRL-R}{CTRL-Q}{CTRL-R}{CTRL-Q}{CTRL-R}{CTRL-Q}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-E}{CTRL-R}{CTRL-E}{CTRL-R}{CTRL-E}{CTRL-R}{CTRL-E}{CTRL-R}{CTRL-E}{/inv}":BB$="{inv}{CTRL-Z}{CTRL-R}{CTRL-Z}{CTRL-R}{CTRL-Z}{CTRL-R}{CTRL-Z}{CTRL-R}{CTRL-Z}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-R}{CTRL-C}{CTRL-R}{CTRL-C}{CTRL-R}{CTRL-C}{CTRL-R}{CTRL-C}{CTRL-R}{CTRL-C}{/inv}"
1005 SETCOLOR 2,N,N:POKE K,26:POKE K1,6:DL=PEEK(560)+256*PEEK(561):POKE DL+12,7:POKE DL+13,6:L=1:M=22:P=8
1007 FOR J=5 TO 1 STEP -1
1008 POSITION L+8,J:? #6;AA$(L,M):POSITION L+8,P:? #6;BB$(L,M)
1009 L=L+2:M=M-2:P=P+1:NEXT J
1010 POSITION 2,7:? #6;"THE SEVEN SKULLS":POSITION 11,15:? #6;"by  Bernard Taylor"
1012 POSITION 9,17:? "{CTRL-T}{inv} ONE MOMENT, PLEASE {/inv}{CTRL-T}":COLOR 32:PLOT 2,0:POKE 559,34
1020 RETURN
1500 POSITION N,1:? #6;"  ":POSITION 18,1:? #6;" ":POKE K,12:POKE K1,N
1501 POKE K3,N:POKE K4,N:B$(64,66)=STR$(MV1):KOL=USR(ADR(C$))
1502 FOR J=1 TO 160:POSITION N,4:? #6;B$(J,J+19)
1503 MU=INT(RND(0)*3)+2
1504 SOUND N,G(L)/2,10,8:SOUND 1,G(L)/MU,10,10:SOUND 2,G(L)/MU+0.6,10,4:L=L+1:IF L=24 THEN L=INT(RND(0)*16)
1506 FOR DE=1 TO 25:NEXT DE:NEXT J
1507 FOR J=N TO 2:SOUND J,N,N,N:NEXT J:FOR DE=N TO 100:NEXT DE:POSITION 7,3:? #6;"shogun"
1508 FOR J=1 TO 5
1509 FOR DE=14 TO N STEP -0.3:POKE K1,DE:NEXT DE
1510 FOR P=5 TO 100 STEP INT(RND(0)*2.5)+1.5
1511 SOUND N,P,8,(80*RND(0)+50)/P:SOUND 1,P+20,8,(80*RND(0)+50)/P:NEXT P
1512 SOUND N,N,N,N:SOUND 1,N,N,N
1513 NEXT J:POKE K1,6:POKE K3,106:POSITION 7,3:? #6;"SHOGUN":GOTO 611
2000 DIM A$(20),B$(182),C$(17),C(9),D(3),E(7),F(7),G(24),I(7)
2050 B$="                       {inv}CONGRATULATIONS{/inv}    YOU DID THAT IN ONLY     MOVES                  "
2060 B$(84,129)="{inv}YOU MARRY THE LOVELY PRINCESS TANUKI AND WITH {/inv}"
2065 B$(130,182)="{inv}HER HELP YOU EVENTUALLY BECOME{/inv}                       "
2070 C$="h{inv}){/inv}{CTRL-A}{inv}{CTRL-E}{/inv}{CTRL-T}{inv}{CTRL-L}{/inv}{CTRL-J}{inv}T{CTRL-L}{CTRL-Z}PH%{/inv}{CTRL-T}{inv}Pu{/inv}{CTRL-.}"
2100 ST=(PEEK(742)-2)*256
2110 FOR J=N TO 487:POKE ST+J,PEEK(57344+J):NEXT J:CH=16:W=8
2115 FOR J=1 TO 3
2120 FOR LO=N TO CH-1:FOR BY=N TO 7:READ SH:POKE ST+(LO)*8+BY+W,SH:NEXT BY:NEXT LO:IF J=1 THEN CH=7:W=208
2125 IF J=2 THEN CH=2:W=472
2126 NEXT J
2150 FOR J=1 TO 9:READ S:C(J)=S:NEXT J
2160 FOR J=1 TO 3:READ S:D(J)=S:NEXT J:FOR J=1 TO 7:READ S:E(J)=S:F(J)=S:NEXT J
2165 FOR J=N TO 24:READ M:G(J)=M:NEXT J
2175 GRAPHICS 18:POKE 559,N:DL=PEEK(560)+256*PEEK(561):POKE DL+6,6
2180 POKE 756,ST/256:POKE K,12:POKE K1,6:POKE K2,26:POKE K3,106
2187 FOR J=2 TO 17 STEP 3:COLOR 96:PLOT J,8:NEXT J:PLOT 7,1:DRAWTO 11,1
2188 POSITION 2,N:? #6;"{inv}THE SEVEN SKULLS{/inv}"
2189 COLOR 123:PLOT N,3:DRAWTO 3,3:PLOT 16,3:DRAWTO 19,3:COLOR 2:PLOT N,N:DRAWTO 1,N:PLOT 18,N:DRAWTO 19,N
2190 PLOT N,11:DRAWTO 19,11:PLOT N,2:DRAWTO 19,2:PLOT N,9:DRAWTO 19,9
2192 POSITION 3,1:? #6;"{inv}moves{/inv}":POSITION 12,1:? #6;"{inv}level{/inv}":COLOR 190:PLOT 9,2:COLOR 191:PLOT 10,2
2195 FOR J=1 TO 7:POSITION C(J+1),5:GOSUB E(J):POSITION C(J+1),6:GOSUB E(J)+10:NEXT J
2196 COLOR 32:PLOT 18,1:PLOT 4,3:DRAWTO 15,3:PLOT N,4:DRAWTO 19,4
2198 COLOR 2:PLOT N,10:DRAWTO 19,10:PLOT N,11:DRAWTO 17,11:COLOR 32:PLOT 5,10:PLOT 14,10:MV=30:MV1=N:TRY=1
2200 LVL=1:POSITION 18,1:? #6;LVL:COLOR 124
2205 FOR J=2 TO 17 STEP 3:PLOT J,10:NEXT J
2210 COLOR 32:PLOT N,7:DRAWTO 19,7:PLOT 5,10:PLOT 14,10:POKE 559,34:GOTO 6
3000 DATA 15,63,127,127,243,225,201,193,126,189,255,223,253,247,189,126,240,252,254,254,207,135,147,131
3005 DATA 102,62,20,7,9,14,7,0,102,124,40,224,144,112,224,0
3010 DATA 0,1,3,6,50,111,107,88,240,252,62,30,15,15,31,255,88,107,111,50,6,3,1,0,255,31,15,15,30,62,252,240
3020 DATA 0,7,14,9,7,20,62,102,0,224,112,144,224,40,124,102,193,193,225,243,127,127,63,15
3025 DATA 131,131,135,207,254,254,252,240
3030 DATA 15,63,124,120,240,240,248,255,0,128,192,96,76,246,214,26,0,60,102,102,102,102,60,0
3035 DATA 255,248,240,240,120,124,63,15,26,214,246,76,96,192,128,0
3040 DATA 1,3,6,15,28,7,27,53,128,192,96,240,56,224,216,172
3045 DATA 30,7,13,27,31,27,13,7,120,224,176,216,248,216,176,224,0,60,90,126,102,66,129,255
3050 DATA 255,0,255,223,126,90,60,0,255,195,165,153,153,165,195,255,18,0,3,6,9,12,15,18,0,0,-1,1
3052 DATA 360,400,440,580,360,400,440
3055 DATA 152,152,136,136,114,114,136,121,136,152,182,204,230,230,230,204,182,182,152,136,136,204,182,182,136
3100 DATA {inv}SHARK BAIT{/inv},{inv}SLAVE{/inv},{inv}FOOD TASTER{/inv},{inv}FOOT SOLDIER{/inv},{inv}BOWMAN{/inv}
3150 DATA {inv}CASTLE GUARD{/inv},{inv}SAMURAI{/inv},{inv}DAIMYO{/inv}
3200 DATA 14,193,30,131,13,229,29,167,13,225,29,135,14,195,30,195,14,193,30,131,15,197,31,163
3210 DATA 15,193,31,131,14,201,30,147

Download

The original program from the Antic disk, to LOAD or ENTER instead of typing it: SKULL.BAS.

Credits