Annotation of 42BSD/games/ddl/sample/transit.ddl, revision 1.1

1.1     ! root        1: {*** TRANSITIONS ***}
        !             2:        hitms = (($eq ($verb) %1) :
        !             3:                        (%2 : ($move .ME %2))
        !             4:                        ($setg GO TRUE)
        !             5:                        (%3: (($parm 3)))
        !             6:                )
        !             7:                ;
        !             8:        synvb = (($eq ($verb) %1) :
        !             9:                        ($setg Verb %2));
        !            10: road1(ACTION) = ($setv n s e w ne nw se sw u d)
        !            11:                (hitms n gard1 0)
        !            12:                (hitms s gard5 0)
        !            13:                (hitms e road2 0)
        !            14:                (hitms w road3 0)
        !            15:                (hitms ne gard2 0)
        !            16:                (hitms nw gard3 0)
        !            17:                (hitms se gard6 0)
        !            18:                (hitms sw gard7 0)
        !            19:                ;
        !            20: 
        !            21: road2(ACTION) = 
        !            22:                (hitms n gard2 0)
        !            23:                (hitms s gard6 0)
        !            24:                (hitms e road7 0)
        !            25:                (hitms w road1 0)
        !            26:                (hitms ne gard2 0)
        !            27:                (hitms nw gard1 0)
        !            28:                (hitms se gard6 0)
        !            29:                (hitms sw gard5 0)
        !            30:                ;
        !            31: 
        !            32: road3(ACTION) = 
        !            33:                (hitms n gard3 0)
        !            34:                (hitms s gard7 0)
        !            35:                (hitms e road1 0)
        !            36:                (hitms w road8 entr8)
        !            37:                (hitms ne gard1 0)
        !            38:                (hitms nw gard3 0)
        !            39:                (hitms se gard5 0)
        !            40:                (hitms sw gard7 0)
        !            41:                ;
        !            42: 
        !            43: road4(ACTION) = 
        !            44:                (hitms n farm1 0)
        !            45:                (hitms s road7 0)
        !            46:                (hitms e frst1 0)
        !            47:                (hitms w gard2 0)
        !            48:                (hitms ne frst1 0)
        !            49:                (hitms nw gard2 0)
        !            50:                (hitms se frst1 0)
        !            51:                (hitms sw gard2 0)
        !            52:                ;
        !            53: 
        !            54: road5(ACTION) = 
        !            55:                (hitms n road7 0)
        !            56:                (hitms s road6 0)
        !            57:                (hitms e frst1 0)
        !            58:                (hitms w gard6 0)
        !            59:                (hitms ne frst1 0)
        !            60:                (hitms nw gard6 0)
        !            61:                (hitms se frst1 0)
        !            62:                (hitms sw gard6 0)
        !            63:                ;
        !            64: 
        !            65: road6(ACTION) = 
        !            66:                (hitms n road5 0)
        !            67:                (hitms s town1 0)
        !            68:                (hitms e frst1 0)
        !            69:                (hitms w gard6 0)
        !            70:                (hitms ne frst1 0)
        !            71:                (hitms nw gard6 0)
        !            72:                (hitms se frst1 0)
        !            73:                (hitms sw gard6 0)
        !            74:                ;
        !            75: 
        !            76: road7(ACTION) = 
        !            77:                (hitms n road4 0)
        !            78:                (hitms s road5 0)
        !            79:                (hitms e frst1 0)
        !            80:                (hitms w road2 0)
        !            81:                (hitms ne frst1 0)
        !            82:                (hitms nw gard2 0)
        !            83:                (hitms se frst1 0)
        !            84:                (hitms sw gard6 0)
        !            85:                ;
        !            86: 
        !            87: road8(ACTION) = ($miss tress tress east8 west8 0 0 0 0 0 0);
        !            88: 
        !            89: east8 = 
        !            90:        ($setg GO TRUE)
        !            91:        ( ($eq @HWY8 0) : ($move .ME road3)
        !            92:       { ELSE } :        (dump8 ($cont road8))
        !            93:                        ($setg HWY8 ($minus @HWY8 1))
        !            94:                        (get8 ($cont roadx))
        !            95:                        (Slook 0 ($loc .ME))
        !            96:                        ($setg LOOKP FALSE)
        !            97:                );
        !            98: 
        !            99: west8 =
        !           100:                ($setg GO TRUE)
        !           101:                        (dump8 ($cont road8))
        !           102:                        ($setg HWY8 ($plus @HWY8 1))
        !           103:                        (get8 ($cont roadx))
        !           104:                        (Slook 0 ($loc .ME))
        !           105:                        ($setg LOOKP FALSE);
        !           106: 
        !           107: dump8 = (($link %1) : (dump8 ($link %1)))       { start at bottom }
        !           108:        (($ne %1 .ME) :                 { Everything else leaves }
        !           109:                ($setp %1 RDLOC @HWY8)  { Retain its location on HWY 8 }
        !           110:                ($move %1 roadx)        { Put it in the box }
        !           111:        );
        !           112: 
        !           113: get8 =  ( %1 :
        !           114:                (get8 ($link %1))
        !           115:                (($eq ($prop %1 RDLOC) @HWY8) :
        !           116:                        ($move %1 road8)
        !           117:                )
        !           118:        );
        !           119: 
        !           120: entr8 =         (dump8 ($cont road8))
        !           121:                ($setg HWY8 0)
        !           122:                (get8 ($cont roadx));
        !           123: 
        !           124: 
        !           125: 
        !           126: 
        !           127: 
        !           128: 
        !           129: gard1(ACTION) = 
        !           130:                (hitms n gard4 0)
        !           131:                (hitms s road1 0)
        !           132:                (hitms e gard2 0)
        !           133:                (hitms w gard3 0)
        !           134:                ;
        !           135: 
        !           136: gard2(ACTION) = 
        !           137:                (hitms n gard4 0)
        !           138:                (hitms s road2 0)
        !           139:                (hitms e gard2 0)
        !           140:                (hitms w gard1 0)
        !           141:                ;
        !           142: 
        !           143: gard3(ACTION) = 
        !           144:                (hitms n gard4 0)
        !           145:                (hitms s road3 0)
        !           146:                (hitms e gard1 0)
        !           147:                (hitms w gard3 0)
        !           148:                ;
        !           149: 
        !           150: gard4(ACTION) = 
        !           151:                (hitms n gard4 0)
        !           152:                (hitms s gard1 0)
        !           153:                (hitms e gard2 0)
        !           154:                (hitms w gard3 0)
        !           155:                ;
        !           156: 
        !           157: 
        !           158: gard5(ACTION) = 
        !           159:                (hitms n road1 0)
        !           160:                (hitms s gard8 0)
        !           161:                (hitms e gard6 0)
        !           162:                (hitms w gard7 0)
        !           163:                ;
        !           164: 
        !           165: gard6(ACTION) = 
        !           166:                (hitms n road2 0)
        !           167:                (hitms s gard8 0)
        !           168:                (hitms e gard6 0)
        !           169:                (hitms w gard5 0)
        !           170:                ;
        !           171: 
        !           172: gard7(ACTION) = 
        !           173:                (hitms n road3 0)
        !           174:                (hitms s gard8 0)
        !           175:                (hitms e gard5 0)
        !           176:                (hitms w gard7 0)
        !           177:                ;
        !           178: 
        !           179: gard8(ACTION) = 
        !           180:                (hitms n gard5 0)
        !           181:                (hitms s gard8 0)
        !           182:                (hitms e gard6 0)
        !           183:                (hitms w gard7 0)
        !           184:                ;
        !           185: 
        !           186: 
        !           187: 
        !           188: 
        !           189: frst1(ACTION) = 
        !           190:                (hitms n frst3 0)
        !           191:                (hitms s frst1 0)
        !           192:                (hitms e frst2 0)
        !           193:                (hitms w frst2 0)
        !           194:                ;
        !           195: 
        !           196: frst2(ACTION) = 
        !           197:                (hitms n frst1 0)
        !           198:                (hitms s frst2 0)
        !           199:                (hitms e frst2 0)
        !           200:                (hitms w frst1 0)
        !           201:                ;
        !           202: 
        !           203: frst3(ACTION) = 
        !           204:                (hitms n frst1 0)
        !           205:                (hitms s frst4 0)
        !           206:                (hitms e frst2 0)
        !           207:                (hitms w frst2 0)
        !           208:                ;
        !           209: 
        !           210: frst4(ACTION) = 
        !           211:                (hitms n frst3 0)
        !           212:                (hitms s frst2 0)
        !           213:                (hitms e frst1 0)
        !           214:                (hitms w road7 0)
        !           215:                ;
        !           216: 
        !           217: 
        !           218: farm1 (ACTION) =
        !           219:                (synvb enter north)
        !           220:                
        !           221:                (hitms n farm2 0)
        !           222:                (hitms s road4 0)
        !           223:                (hitms e farm3 0)
        !           224:                (hitms w farm4 0)
        !           225:                (hitms ne farm3 0)
        !           226:                (hitms nw farm4 0)
        !           227:                ;
        !           228: 
        !           229: farm2 (ACTION) =
        !           230:                (synvb out s)
        !           231:                (synvb enter n)
        !           232:                (synvb east up)
        !           233: 
        !           234:                (hitms n farm6 0)
        !           235:                (hitms s farm1 0)
        !           236:                (hitms up farm7 0)
        !           237:                ;
        !           238: 
        !           239: farm3 (ACTION) =
        !           240:                (hitms n farm5 0)
        !           241:                (hitms s farm1 0)
        !           242:                (hitms e frst1 0)
        !           243:                (hitms nw farm5 0)
        !           244:                (hitms sw farm1 0)
        !           245:                ;
        !           246: 
        !           247: farm4 (ACTION) =
        !           248:                (hitms n farm5 0)
        !           249:                (hitms s farm1 0)
        !           250:                (hitms w gard4 0)
        !           251:                (hitms ne farm5 0)
        !           252:                (hitms se farm1 0)
        !           253:                ;
        !           254: 
        !           255: farm5 (ACTION) =
        !           256:                (hitms e farm3 0)
        !           257:                (hitms w farm4 0)
        !           258:                (hitms se farm3 0)
        !           259:                (hitms sw farm4 0)
        !           260:                ;
        !           261: 
        !           262: farm6 (ACTION) =
        !           263:                (hitms out farm2 0)
        !           264:                (hitms s farm2 0)
        !           265:                ;
        !           266: farm7 (ACTION) =
        !           267:                (hitms e farm2 0)
        !           268:                (hitms d farm2 PanL)
        !           269:                 ;
        !           270: 
        !           271: 
        !           272: town1 (ACTION) =
        !           273:                (hitms n road6 0)
        !           274:                (hitms s town2 0)
        !           275:                (hitms e town3 0)
        !           276:                (hitms w town4 0)
        !           277:                ;
        !           278: 
        !           279: town2 (ACTION) =
        !           280:                (hitms n town1 0)
        !           281:                (hitms e town5 0)
        !           282:                (hitms w town6 0)
        !           283:                ;
        !           284: 
        !           285: town3 (ACTION) =
        !           286:                (hitms out town1 0)
        !           287:                (hitms w town1 0)
        !           288:                ;
        !           289: 
        !           290: town4 (ACTION) =
        !           291:                (hitms e town1 0)
        !           292:                (hitms out town1 0)
        !           293:                ;
        !           294: 
        !           295: town5 (ACTION) =
        !           296:                (hitms w town2 0)
        !           297:                (hitms out town2 0)
        !           298:                (TWN5x);
        !           299: 
        !           300: town6 (ACTION) =
        !           301:                (hitms e town2 0)
        !           302:                (hitms out town2 0)
        !           303:                ;
        !           304: 
        !           305: 
        !           306: cel01 (ACTION) = 
        !           307: 
        !           308:                (hitms n cel02 0)
        !           309:                (hitms s 0 ny)
        !           310:                (hitms w cel04 0)
        !           311:                (hitms u farm7 0)
        !           312:                ;
        !           313: cel02 (ACTION) =
        !           314:                (hitms n cel05 0)
        !           315:                (hitms s cel01 0)
        !           316:                (hitms e 0 ny)
        !           317:                ;
        !           318: 
        !           319: cel03 (ACTION) =
        !           320:                (hitms s cel05 0)
        !           321:                (hitms w cel13 0)
        !           322:                (hitms ne cel09 0)
        !           323:                (hitms d cel09 0)
        !           324:                ;
        !           325: 
        !           326: cel04 (ACTION) =
        !           327:                (synvb down north)
        !           328:                (hitms n cel10 0)
        !           329:                (hitms e cel01 0)
        !           330:                (hitms w cel08 0)
        !           331:                ;
        !           332: 
        !           333: 
        !           334: MV56=($setg Cel6x 5);
        !           335: MV76=($setg Cel6x 7);
        !           336: MV67=( ($and ($ne @Cel6x 7)
        !           337:             ($prop dragon AWAKE)): ($say
        !           338: "The ice dragon blocks your attempt to cross!\n\n")
        !           339:                :         ($move .ME cel07) );
        !           340: 
        !           341: MV65=( ($and ($ne @Cel6x 5)
        !           342:             ($prop dragon AWAKE)): ($say
        !           343: "The ice dragon blocks your attempt to leave!\n")
        !           344:                :         ($move .ME cel05) );
        !           345: 
        !           346: 
        !           347: cel05 (ACTION) =
        !           348:                (hitms n cel03 0)
        !           349:                (hitms s cel02 0)
        !           350:                (hitms ne cel06 MV56)
        !           351:                ;
        !           352: 
        !           353: cel06 (ACTION) =
        !           354:                (hitms e 0 MV67)
        !           355:                (hitms w 0 MV65)
        !           356:                (($eq ($loc .ME) cel06) {still here}:
        !           357:                        ($setg LOOKP TRUE)
        !           358:                )
        !           359:                  ;
        !           360: 
        !           361: cel07 (ACTION) =
        !           362:                (synvb out west)
        !           363:                (hitms w cel06 MV76)
        !           364:                ;
        !           365: 
        !           366: cel08 (ACTION) =
        !           367:                (hitms e cel04 0)
        !           368:                (hitms w 0 ny)
        !           369:                ;
        !           370: 
        !           371: cel09 (ACTION) =
        !           372:                (hitms n 0 ny)
        !           373:                ;
        !           374: 
        !           375: cel10 (ACTION) =
        !           376:                (hitms s cel04 0)
        !           377:                (hitms d cel11 0)
        !           378:                ;
        !           379: 
        !           380: cel11 (ACTION) =
        !           381:                (hitms e cel12 0)
        !           382:                (hitms n 0 ny)
        !           383:                ;
        !           384: 
        !           385: cel12 (ACTION) =
        !           386:                (hitms n cel11 0)
        !           387:                (hitms e 0 ny)
        !           388:                ;
        !           389: 
        !           390: cel13 (ACTION) = (($eq ($verb) down):
        !           391:                        (($prop cel13 HOLED):
        !           392:                                ($say "You plunge into the icy waters!\n")
        !           393:                                ($move .ME cel14)
        !           394:                                ($exit 1)
        !           395:                        )
        !           396:                  )
        !           397:                  (($eq ($verb) drop):
        !           398:                    (cdrop)
        !           399:                    (($not ($prop cel13 HOLED)):
        !           400:                        (($ge ($prop ($dobj) WEIGH)
        !           401:                              ($prop [red crystal] WEIGH)
        !           402:                         ):
        !           403:                                ($say 
        !           404: "You have broken the ice!  You watch helplessly as ")
        !           405:                                (($sdisc ($dobj)))
        !           406:                                ($say "
        !           407: sinks swiftly into the dark and frigid depths.\n")
        !           408:                                ($setp cel13 HOLED TRUE)
        !           409:                                ($move hole cel13)
        !           410:                                ($move ($dobj) .ALL)
        !           411:                                ($exit 1)
        !           412:                        {else}:                 {give him a hint}
        !           413:                                ($say
        !           414: "The icy floor chips a little, but remains intact.\n")
        !           415:                        )
        !           416:                   )
        !           417:                   ($exit 1)
        !           418:                )
        !           419:                (hitms e cel03 0)
        !           420:                (hitms w 0 ny)
        !           421:                ;
        !           422: 
        !           423: cel14 (ACTION) =
        !           424:                (($eq ($verb) up):
        !           425:                        (($prop cel13 HOLED):
        !           426:                            ($say "You pop out through a hole in the ice!\n")
        !           427:                            ($move .ME cel13)
        !           428:                            ($exit 1)
        !           429:                :{else}
        !           430:                            ($say  "You are blocked by an icy roof above!\n")
        !           431:                         )
        !           432:                 )
        !           433:                (hitms w cel15 0)
        !           434:                
        !           435:                (($eq ($loc .ME) cel14):        { Poor sap didn't move.}
        !           436:                                ($say
        !           437: "Your breath expires.  The last thing you feel is the odd sensation
        !           438: of water filling your lungs.  ") (die)
        !           439:                );

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.