10 ' PYRAMID9
20 MODE 1:BORDER 0:PAPER 0
25 A=2:B=2:C=2:D=2:E=2
30 FOR i=0 TO 3:INK i,0:NEXT i
40 MEMORY &3FFF
50 LOAD"Pyramid9.cmp"
60 FOR i=0 TO 3:INK i,0:NEXT i
70 POKE &A634,&C8:POKE &A635,0:POKE &A636,0:CALL &A60B
80 POKE &C7F1,&C9:CALL &C7D0
90 CALL &A60B

100 locate 12,8:Pen A:PAPER 2:Print Chr$(244):locate 13,8:Pen B:PAPER 2:Print Chr$(244):locate 12,10:Pen C:PAPER 2:Print Chr$(244):locate 13,10:Pen D:PAPER 2:Print Chr$(244):locate 13,13:Pen E:PAPER 2:Print Chr$(244)

105 IF PEEK(&BE81)=1 then locate 12,8:Pen 1:PAPER 2:Print Chr$(244):locate 13,8:Pen 3:PAPER 2:Print Chr$(244):locate 12,10:Pen 3:PAPER 2:Print Chr$(244):locate 13,10:Pen 1:PAPER 2:Print Chr$(244):locate 13,13:Pen 0:PAPER 2:Print Chr$(244)

110 WINDOW #1,25,36,4,19
120 INK 0,0:INK 1,3:INK 2,15:INK 3,24:PAPER 0
130 PEN #1,3:PRINT #1:PRINT #1,"Two sacred":PRINT #1,"figures":PRINT #1,"engraved":PRINT #1,"in stone,"
140 PRINT #1,"Ramses and":PRINT #1,"Anubis,":PRINT #1,"frozen in a":PRINT #1,"duel of":PRINT #1,"eternity."

150 LOCATE 13,20:PEN 2:PRINT "WHAT WILL YOU DO ?"
160 PEN 3:LOCATE 4,22:PRINT "0-EAST  1-SOUTH  2-Examine  3-Bark"
170 PEN 2:LOCATE 4,24:PRINT "Press button:  4-5-6-7-8"

200 k$=INKEY$
210 IF k$="4" THEN A=A+1:SOUND 1,100:GOTO 300
220 IF k$="5" THEN B=B+1:SOUND 1,120:GOTO 400
230 IF k$="6" THEN C=C+1:SOUND 1,140:GOTO 500
240 IF k$="7" THEN D=D+1:SOUND 1,160:GOTO 600
250 IF k$="8" THEN E=E+1:SOUND 1,180:GOTO 700
260 IF k$="0" THEN RUN"PyramidA.bas"
265 IF k$="1" THEN RUN"Pyramid5.bas"
270 IF k$="2" THEN GOTO 1000
280 IF k$="3" THEN GOTO 1100
290 IF k$<"0" OR k$>"8" THEN GOTO 200

300 IF A>3 THEN A=0
310 LOCATE 12,8:PEN A:PAPER 2:PRINT CHR$(244)
320 GOTO 800

400 IF B>3 THEN B=0
410 LOCATE 13,8:PEN B:PAPER 2:PRINT CHR$(244)
420 GOTO 800

500 IF C>3 THEN C=0
510 LOCATE 12,10:PEN C:PAPER 2:PRINT CHR$(244)
520 GOTO 800

600 IF D>3 THEN D=0
610 LOCATE 13,10:PEN D:PAPER 2:PRINT CHR$(244)
620 GOTO 800

700 IF E>3 THEN E=0
710 LOCATE 13,13:PEN E:PAPER 2:PRINT CHR$(244)
720 GOTO 800

800 IF A=1 AND B=3 AND C=3 AND D=1 AND E=0 THEN SOUND 1,300:SOUND 1,250:SOUND 1,200:SOUND 1,150:SOUND 1,100:SOUND 1,50:GOTO 2000
810 GOTO 200

1000 IF PEEK(&BE81)=1 THEN GOTO 1200
1010 INK 0,0:INK 1,6:INK 2,15:INK 3,24:PAPER 0:MODE 1
1020 PEN 3:PRINT:PRINT "You study the hieroglyphs with care..."
1030 PEN 1:PRINT:PRINT "Pharaoh and Anubis, frozen in an":PRINT "eternal confrontation."
1040 PEN 2:PRINT:PRINT "But looking closer, it seems less":PRINT "a battle than a flea market trade:"
1050 PEN 3:LOCATE 1,10:PRINT "Their outstretched arms seem to offer":PRINT "each other something."
1060 PEN 1:LOCATE 1,13:PRINT "A jar for a jackal head?":PRINT "A collector's papyrus for a fake scarab?"
1070 PEN 2:PRINT "Hard to say... But one thing is sure:":PRINT "objects are missing from this odd deal."
1080 PEN 3:LOCATE 15,24:INPUT "  ENTER  ",en$
1090 GOTO 60

1100 INK 0,0:INK 1,6:INK 2,15:INK 3,24:PAPER 0:MODE 1
1110 PEN 3:PRINT:PRINT "Ah yes, of course!":PRINT "Barking, what a genius idea."
1120 PEN 2:PRINT:PRINT "Don't you think if Anubis wanted":PRINT "dialogue, he'd have engraved WOOF":PRINT "on the wall, right?"
1130 PEN 1:LOCATE 30,6:PRINT "WOOF"
1140 PEN 3:LOCATE 1,9:PRINT "But continue, maybe one day he'll":PRINT "bring back the stick... of the scepter."
1150 PEN 3:LOCATE 15,24:INPUT "  ENTER  ",en$
1160 GOTO 60

1200 INK 0,0:INK 1,6:INK 2,15:INK 3,24:PAPER 0:MODE 1
1210 PEN 3:PRINT:PRINT "Ah, you come back to admire your":PRINT "masterpiece?"
1220 PEN 2:PRINT:PRINT "Sure, solving a millennia-old riddle":PRINT "makes one want to self-congratulate."
1230 PEN 1:PRINT:PRINT "But beware, staring at carvings":PRINT "does not make you a pharaoh..."
1240 PEN 3:PRINT:PRINT "Spoiler:";:PRINT "the trap is still open,":PRINT "the key is still in your pocket,":PRINT "and Anubis hasn't moved an inch."
1250 PEN 2:PRINT:PRINT "But hey, if you enjoy pretending":PRINT "to think..."
1260 PEN 3:LOCATE 15,24:INPUT "  ENTER  ",en$
1270 GOTO 60

2000 IF PEEK(&BE81)=0 THEN GOTO 3000
2010 INK 0,0:INK 1,6:INK 2,15:INK 3,24:PAPER 0:MODE 1
2020 PEN 1:PRINT:PRINT "             Ah, well done!"
2030 PEN 3:PRINT:PRINT "You solved the puzzle again!"
2040 PEN 1:PRINT:PRINT "             Incredible!"
2050 PEN 2:PRINT:PRINT "What a performance, what a bright":PRINT "mind!"
2060 PEN 3:PRINT:PRINT "Of course, it is useless,":PRINT "since you already had the key..."
2070 PRINT:PRINT "But apparently, you love puzzles,";:PRINT "especially when already solved."
2080 PEN 2:PRINT:PRINT "It saves some neurons, right?"
2090 PEN 3:LOCATE 15,24:INPUT "  ENTER  ",en$
2095 GOTO 60

3000 INK 0,0:INK 1,6:INK 2,15:INK 3,24:PAPER 0:MODE 1
3010 PEN 3:PRINT:PRINT "You adjust the last pyramid,":PRINT "holding your breath as if about":PRINT "to trigger the end of the world..."
3020 PEN 1:PRINT:PRINT "         And suddenly a CLICK!"
3030 PEN 2:PRINT:PRINT "Followed by a creak that would scare":PRINT "any ASMR fan."
3040 PEN 3:PRINT:PRINT "The statues finally seem satisfied":PRINT "with their collection:"
3045 PEN 2:PRINT:PRINT "Pharaoh proudly shows his four":PRINT "yellow and brown pyramids, while":PRINT "Anubis grins with his small black":PRINT"pyramid."
3047 PEN 3:LOCATE 15,25:INPUT "  ENTER  ",en$
3050 CLS:PEN 2:PRINT:PRINT "Then, miracle or well-oiled mechanism:":PEN 3:PRINT:PRINT "A trap opens in the wall,":PRINT "dropping a shiny object..."
3060 PEN 1:PRINT:PRINT "      A key shaped like an ankh!":PEN 2:PRINT:PRINT "No triumphant music, but you":PRINT "can still raise your arms and shout:":PEN 1:PRINT:PRINT "           I AM A GENIUS!"
3070 PEN 3:PRINT:PRINT "...before putting it in your inventory."
3080 LOCATE 15,25:INPUT "  ENTER  ",en$
3090 POKE &BE81,1:Goto 60
