DECLARE SUB DropEng () DECLARE SUB Examine () DECLARE SUB Engine () DECLARE SUB Take () DECLARE SUB Drop () DECLARE SUB PutIn () DECLARE SUB Inventory () DECLARE SUB BagInventory () DECLARE SUB Objects () DECLARE SUB Room1 () DECLARE SUB Room2 () DECLARE SUB Room3 () DECLARE SUB Room4 () DECLARE SUB Room5 () DIM SHARED Engcom$ DIM SHARED Roomjump% 'universal string to jump room to room DIM SHARED Resetprogram% 'doesn't reset anything yet, but goes back to beginning of game DIM SHARED Quitset% 'tells room sub to quit DIM SHARED Lookset% 'tells room sub to look at room DIM SHARED Northset% 'tells room sub north is requested DIM SHARED Southset% 'etc. DIM SHARED Eastset% DIM SHARED Westset% DIM SHARED Upset% DIM SHARED Downset% DIM SHARED Neset% DIM SHARED Seset% DIM SHARED Swset% DIM SHARED Nwset% DIM SHARED Goroom% 'destination room DIM SHARED Inroom% 'current room DIM SHARED Roomset1% 'have visted room DIM SHARED Roomset2% DIM SHARED Roomset3% DIM SHARED Roomset4% DIM SHARED Roomset5% DIM SHARED Inv1% 'inventory: max items carried can be set at top of Take DIM SHARED BagInv1% 'inventory of container item DIM SHARED Lanternroom% 'which room item is in (0 = in inventory) DIM SHARED Lanternset% 'item state DIM SHARED Candleroom% DIM SHARED Candleset% DIM SHARED Matchesroom% DIM SHARED Matchesset% DIM SHARED Axeroom% DIM SHARED Axeset% DIM SHARED Bagroom% DIM SHARED Bagset% '---------------------------------------------------------------------------- '--------[Main program module]----------------------------------------------- Programstart: Goroom% = 1 Inroom% = 0 Roomobject% = 0 Roomset1% = 0 'clear the room state strings if game is restarted from engine Roomset2% = 0 Roomset3% = 0 Roomset4% = 0 Roomset5% = 0 Inv1% = 0 'more house cleaning BagInv1% = 0 Lanternroom% = 4 'assign object/item to room Lanternset% = 0 'object flag Candleroom% = 3 Candleset% = 0 Matchesroom% = 3 Matchesset% = 0 Axeroom% = 1 Axeset% = 0 Bagroom% = 5 Bagset% = 0 CLS PRINT "Beefengine 0.XXa" PRINT PRINT "Welcome." LOCATE 4, 1 Goroom1: Room1 GOTO Roomselect: Goroom2: Room2 GOTO Roomselect: Goroom3: Room3 GOTO Roomselect: Goroom4: Room4 GOTO Roomselect: Goroom5: Room5 GOTO Roomselect: Roomselect: IF Roomjump% > 0 THEN Goroom% = Roomjump% END IF IF Resetprogram% = 1 GOTO Programstart: IF Quitset% = 1 GOTO Endprogram: IF Quitset% = 2 GOTO Abortprogram: IF Goroom% = 1 GOTO Goroom1: IF Goroom% = 2 GOTO Goroom2: IF Goroom% = 3 GOTO Goroom3: IF Goroom% = 4 GOTO Goroom4: IF Goroom% = 5 GOTO Goroom5: PRINT "That room does not exist in this dimension." GOTO Goroom1: Endprogram: DO INPUT "Quit? [Y/N] ", Quityn$ Quityn$ = LCASE$(Quityn$) Quityn$ = LEFT$(Quityn$, 1) LOOP UNTIL Quityn$ = "y" OR Quityn$ = "n" IF Quityn$ = "n" THEN Quitset% = 0 GOTO Roomselect: END IF PRINT PRINT "Goodbye." Abortprogram: END SUB BagInventory '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ BagContents: PRINT " The bag contains:" IF Lanternroom% = -5 THEN PRINT " Lantern" IF Candleroom% = -5 THEN PRINT " Candle" IF Matchesroom% = -5 THEN PRINT " Matches" IF Axeroom% = -5 THEN PRINT " Axe" 'no bag '//////////////////////////////////////////////////////////////////////////// END SUB SUB Drop '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ '--------[Drop item in current room]----------------------------------------- Dropitem$ = RIGHT$(Engcom$, 7) IF Dropitem$ = "lantern" AND Lanternroom% > 0 GOTO NoitemDrop: IF Dropitem$ = "lantern" AND Lanternroom% < 0 GOTO NoitemDrop2: IF Dropitem$ = "lantern" THEN Lanternroom% = Inroom% Lanternset% = 0 Inv1% = Inv1% - 1 PRINT "Dropped." GOTO EndDrop: END IF Dropitem$ = RIGHT$(Engcom$, 6) IF Dropitem$ = "candle" AND Candleroom% > 0 GOTO NoitemDrop: IF Dropitem$ = "candle" AND Candleroom% < 0 GOTO NoitemDrop2: IF Dropitem$ = "candle" THEN Candleroom% = Inroom% Candleset% = 0 Inv1% = Inv1% - 1 PRINT "Dropped." GOTO EndDrop: END IF Dropitem$ = RIGHT$(Engcom$, 7) IF Dropitem$ = "matches" AND Matchesroom% > 0 GOTO NoitemDrop: IF Dropitem$ = "matches" AND Matchesroom% < 0 GOTO NoitemDrop2: IF Dropitem$ = "matches" THEN Matchesroom% = Inroom% Matchesset% = 0 Inv1% = Inv1% - 1 PRINT "Dropped." GOTO EndDrop: END IF Dropitem$ = RIGHT$(Engcom$, 3) IF Dropitem$ = "axe" AND Axeroom% > 0 GOTO NoitemDrop: IF Dropitem$ = "axe" AND Axeroom% < 0 GOTO NoitemDrop2: IF Dropitem$ = "axe" THEN Axeroom% = Inroom% Axeset% = 0 Inv1% = Inv1% - 1 PRINT "Dropped." GOTO EndDrop: END IF Dropitem$ = RIGHT$(Engcom$, 3) IF Dropitem$ = "bag" AND Bagroom% > 0 GOTO NoitemDrop: IF Dropitem$ = "bag" AND Bagroom% < 0 GOTO NoitemDrop2: IF Dropitem$ = "bag" THEN Bagroom% = Inroom% Bagset% = 0 Inv1% = Inv1% - 1 PRINT "Dropped." GOTO EndDrop: END IF NoitemDrop: PRINT "You do not have that." GOTO EndDrop: NoitemDrop2: PRINT "That is not in your hands." GOTO EndDrop: '---------------------------------------------------------------------------- EndDrop: PRINT Objects '//////////////////////////////////////////////////////////////////////////// END SUB SUB Engine '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ '--------[List of Engine Commands]------------------------------------------- 'look/l x 'north/n x 'south/s x 'east/e x 'west/w x 'north east/ne x 'south east/se x 'south west/sw x 'north west/nw x 'up/u x 'down/d x 'wait/z 'climb (up) (down) '**take/pickup/pick up/get/remove/[take out] (object) x '**drop/put down/throw away/set down (object) x '**put (object) [in/on] (object) x 'open (object) 'unlock (object) 'use (object) '**examine/look at (object) x 'talk/[talk to]/speak [to] (object) 'say/speak (word) 'attack/kill (object) 'throw (object) 'drink (object) 'eat/taste (object) '*?/help/h x 'quit/q x 'save 'restore/load 'score '**items/inventory/i x ' ' * - commands that only need a few simple instructions in their own part ' of the engine ' ** - commands that need their own subroutine outside the engine ' ' And of course there may be some object/item/room specific commands ' to add in the engine '---------------------------------------------------------------------------- '-------[Reset Several Engine Commands]-------------------------------------- Resetcommands: Roomjump% = 0 Resetprogram% = 0 Quitset% = 0 Lookset% = 0 Northset% = 0 Southset% = 0 Eastset% = 0 Westset% = 0 Neset% = 0 Seset% = 0 Swset% = 0 Nwset% = 0 Upset% = 0 Downset% = 0 '---------------------------------------------------------------------------- '--------[Main Command Engine]----------------------------------------------- Engloop: Engcom$ = "" DO UNTIL Engcom$ > "" PRINT INPUT "> ", Engcom$ PRINT LOOP Engcom$ = LCASE$(Engcom$) IF Engcom$ = "reset" THEN Resetprogram% = 1 GOTO Endeng: END IF IF Engcom$ = "quit" OR Engcom$ = "q" OR Engcom$ = "exit" THEN Quitset% = 1 GOTO Endeng: END IF IF Engcom$ = "look" OR Engcom$ = "l" THEN Lookset% = 1 GOTO Endeng: END IF IF Engcom$ = "north" OR Engcom$ = "n" THEN Northset% = 1 GOTO Endeng: END IF IF Engcom$ = "south" OR Engcom$ = "s" THEN Southset% = 1 GOTO Endeng: END IF IF Engcom$ = "east" OR Engcom$ = "e" THEN Eastset% = 1 GOTO Endeng: END IF IF Engcom$ = "west" OR Engcom$ = "w" THEN Westset% = 1 GOTO Endeng: END IF IF Engcom$ = "north east" OR Engcom$ = "ne" THEN Neset% = 1 GOTO Endeng: END IF IF Engcom$ = "south east" OR Engcom$ = "se" THEN Seset% = 1 GOTO Endeng: END IF IF Engcom$ = "south west" OR Engcom$ = "sw" THEN Swset% = 1 GOTO Endeng: END IF IF Engcom$ = "north west" OR Engcom$ = "nw" THEN Nwset% = 1 GOTO Endeng: END IF IF Engcom$ = "up" OR Engcom$ = "u" THEN Upset% = 1 GOTO Endeng: END IF IF Engcom$ = "down" OR Engcom$ = "d" THEN Downset% = 1 GOTO Endeng: END IF IF Engcom$ = "abort" OR Engcom$ = "/q" THEN Quitset% = 2 GOTO Endeng: END IF IF Engcom$ = "help" OR Engcom$ = "h" OR Engcom$ = "?" GOTO Helpkeys: IF Engcom$ = "inventory" OR Engcom$ = "items" OR Engcom$ = "item" OR Engcom$ = "i" GOTO EngInventory: IF Engcom$ = "/scotty" THEN INPUT "[Enter room number, Captain:] ", Roomjump% PRINT "Beaming you to room"; Roomjump%; "now, Captain." GOTO Endeng: END IF IF Engcom$ = "take" OR Engcom$ = "pickup" OR Engcom$ = "pick up" OR Engcom$ = "get" OR Engcom$ = "remove" OR Engcom$ = "take out" THEN PRINT "Take what?" GOTO Engloop: END IF IF LEFT$(Engcom$, 4) = "take" OR LEFT$(Engcom$, 6) = "pickup" OR LEFT$(Engcom$, 7) = "pick up" OR LEFT$(Engcom$, 3) = "get" OR LEFT$(Engcom$, 6) = "remove" GOTO GoTake: IF Engcom$ = "drop" OR Engcom$ = "put down" OR Engcom$ = "throw away" OR Engcom$ = "set down" THEN PRINT "Drop what?" GOTO Engloop: END IF IF LEFT$(Engcom$, 4) = "drop" OR LEFT$(Engcom$, 8) = "put down" OR LEFT$(Engcom$, 10) = "throw away" OR LEFT$(Engcom$, 8) = "set down" GOTO GoDrop: IF Engcom$ = "look room" OR Engcom$ = "look at room" OR Engcom$ = "look at the room" OR Engcom$ = "examine room" OR Engcom$ = "examine the room" THEN Lookset% = 1 GOTO Endeng: END IF IF Engcom$ = "look at" OR Engcom$ = "examine" OR Engcom$ = "look in" THEN PRINT "Examine what?" GOTO Engloop: END IF IF LEFT$(Engcom$, 7) = "look at" OR LEFT$(Engcom$, 7) = "examine" OR LEFT$(Engcom$, 7) = "look in" THEN GOTO GoExamine: IF Engcom$ = "put" OR Encom$ = "put in" OR Engcom$ = "put on" THEN PRINT "Put what where?" GOTO Engloop: END IF IF LEFT$(Engcom$, 3) = "put" THEN GOTO GoPutin: PRINT "I do not understand." GOTO Engloop: '---------------------------------------------------------------------------- GoTake: Take GOTO Engloop: '---------------------------------------------------------------------------- GoDrop: Drop GOTO Engloop: '---------------------------------------------------------------------------- GoExamine: Examine GOTO Engloop: '---------------------------------------------------------------------------- GoPutin: PutIn GOTO Engloop: '---------------------------------------------------------------------------- EngInventory: Inventory GOTO Engloop: '---------------------------------------------------------------------------- Helpkeys: PRINT "Some commands to get you started:" PRINT PRINT "LOOK / L NORTH / N SOUTH / S EAST / E WEST / W" PRINT "UP / U DOWN / D RESET SAVE RESTORE" PRINT "QUIT /Q" PRINT PRINT "I would give you a few more hints, but half the challenge of the game is to " PRINT "discovering the commands that will navigate you through this world." GOTO Engloop: '---------------------------------------------------------------------------- Endeng: '//////////////////////////////////////////////////////////////////////////// END SUB SUB Examine '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ '---------------------------------------------------------------------------- Exmitem$ = RIGHT$(Engcom$, 7) IF Exmitem$ = "lantern" AND Lanternroom% = 0 THEN PRINT "It looks a bit weathered, but otherwise in good condition." GOTO EndExamine: END IF Exmitem$ = RIGHT$(Engcom$, 6) IF Exmitem$ = "candle" AND Candleroom% = 0 THEN PRINT "A wax candle." GOTO EndExamine: END IF Exmitem$ = RIGHT$(Engcom$, 7) IF Exmitem$ = "matches" AND Matchesroom% = 0 THEN PRINT "The matchbox is stained yellow from years gone by." GOTO EndExamine: END IF Exmitem$ = RIGHT$(Engcom$, 3) IF Exmitem$ = "axe" AND Axeroom% = 0 THEN PRINT "The blade is rusty, but it still has an edge." GOTO EndExamine: END IF Exmitem$ = RIGHT$(Engcom$, 3) IF Exmitem$ = "bag" AND Bagroom% = 0 AND BagInv1% = 0 THEN PRINT "A large canvas bag." GOTO EndExamine: END IF IF Exmitem$ = "bag" AND Bagroom% = 0 AND BagInv1% > 0 THEN BagInventory GOTO EndExamine: END IF NoitemExamine: PRINT "You do not have that." EndExamine: '//////////////////////////////////////////////////////////////////////////// END SUB SUB Inventory '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ IF Inv1% = 0 THEN PRINT "You are not carrying anything." GOTO EndInventory: END IF PRINT "Items you are carrying:" PRINT IF Lanternroom% = 0 THEN PRINT "Lantern" IF Candleroom% = 0 THEN PRINT "Candle" IF Matchesroom% = 0 THEN PRINT "Matches" IF Axeroom% = 0 THEN PRINT "Axe" IF Bagroom% = 0 THEN PRINT "Bag" IF Bagroom% = 0 AND BagInv1% > 0 THEN BagInventory '---------------------------------------------------------------------------- EndInventory: '//////////////////////////////////////////////////////////////////////////// END SUB SUB Objects '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ '--------[Object/Item list:]------------------------------------------------- '1 - lantern '2 - candle '3 - matches '4 - axe '5 - bag '---------------------------------------------------------------------------- Lanternset% = 0 'reset all the item flags to 0 (have not been picked up) Candleset% = 0 Matchesset% = 0 Axeset% = 0 Bagset% = 0 '--------[Set object/item indicators]---------------------------------------- IF Lanternroom% = Inroom% THEN Lanternset% = 1 PRINT "There is a lantern here." END IF IF Candleroom% = Inroom% THEN Candleset% = 1 PRINT "There is a candle here." END IF IF Matchesroom% = Inroom% THEN Matchesset% = 1 PRINT "There is a box of matches here." END IF IF Axeroom% = Inroom% THEN Axeset% = 1 PRINT "There is an axe here." END IF IF Bagroom% = Inroom% THEN Bagset% = 1 PRINT "There is a bag here." END IF '---------------------------------------------------------------------------- EndObjects: '//////////////////////////////////////////////////////////////////////////// END SUB SUB PutIn '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ '--------[Trim the few grammar choices out of the string first]-------------- IF LEFT$(Engcom$, 7) = "put the" THEN Putitem$ = MID$(Engcom$, 9, 80) GOTO Putin1: END IF IF LEFT$(Engcom$, 3) = "put" THEN Putitem$ = MID$(Engcom$, 5, 80) GOTO Putin1: END IF '-------[Sort through items that can contain other items in]----------------- Putin1: IF RIGHT$(Putitem$, 3) = "bag" GOTO PutinBag: PRINT "That doesn't go there." GOTO EndPutin: '--------[Bag]--------------------------------------------------------------- PutinBag: IF Bagroom% > 0 THEN PRINT "You don't have a bag to put anything in." GOTO EndPutin: END IF IF BagInv1% = 3 THEN PRINT "The bag is full." GOTO EndPutin: END IF Putitem1$ = LEFT$(Putitem$, 7) IF Putitem1$ = "lantern" AND Lanternroom% > 0 GOTO DonthavePutin: IF Putitem1$ = "lantern" AND Lanternroom% = 0 THEN Lanternroom% = -5 Inv1% = Inv1% - 1 BagInv1% = BagInv1% + 1 PRINT "Done." GOTO EndPutin: END IF Putitem1$ = LEFT$(Putitem$, 6) IF Putitem1$ = "candle" AND Candleroom% > 0 GOTO DonthavePutin: IF Putitem1$ = "candle" AND Candleroom% = 0 THEN Candleroom% = -5 Inv1% = Inv1% - 1 BagInv1% = BagInv1% + 1 PRINT "Done." GOTO EndPutin: END IF Putitem1$ = LEFT$(Putitem$, 7) IF Putitem1$ = "matches" AND Matchesroom% > 0 GOTO DonthavePutin: IF Putitem1$ = "matches" AND Matchesroom% = 0 THEN Matchesroom% = -5 Inv1% = Inv1% - 1 BagInv1% = BagInv1% + 1 PRINT "Done." GOTO EndPutin: END IF Putitem1$ = LEFT$(Putitem$, 3) IF Putitem1$ = "axe" AND Axeroom% > 0 GOTO DonthavePutin: IF Putitem1$ = "axe" AND Axeroom% = 0 THEN Axeroom% = -5 Inv1% = Inv1% - 1 BagInv1% = BagInv1% + 1 PRINT "Done." GOTO EndPutin: END IF Putitem1$ = LEFT$(Putitem$, 3) IF Putitem1$ = "bag" AND BagInv1% = 0 THEN PRINT "The bag has been turned inside out." GOTO EndPutin: ELSE PRINT "Done... ...Hey, wait a minute!" GOTO EndPutin END IF '---------------------------------------------------------------------------- DonthavePutin: PRINT "You don't have what you want to put in that." GOTO EndPutin: '---------------------------------------------------------------------------- EndPutin: '//////////////////////////////////////////////////////////////////////////// END SUB SUB Room1 '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Inroom% = 1 PRINT PRINT PRINT PRINT "ROOM I" PRINT IF Roomset1% = 1 GOTO Engloop1: Look1: PRINT "Room 1, north Room 2, north east Room 3" PRINT Roomset1% = 1 Engloop1: Objects Engine IF Roomjump% > 0 GOTO Endroom1: IF Resetprogram% = 1 THEN GOTO Endroom1: IF Quitset% > 0 GOTO Endroom1: IF Lookset% = 1 GOTO Look1: IF Northset% = 1 THEN Goroom% = 2 GOTO Endroom1: END IF IF Southset% = 1 THEN PRINT "Blocked south" IF Eastset% = 1 THEN PRINT "Blocked east" IF Westset% = 1 THEN PRINT "Blocked west" IF Neset% = 1 THEN Goroom% = 3 GOTO Endroom1: END IF IF Seset% = 1 THEN PRINT "Blocked south east" IF Swset% = 1 THEN PRINT "Blocked south west" IF Nwset% = 1 THEN PRINT "Blocked north west" IF Upset% = 1 THEN PRINT "Blocked up" IF Downset% = 1 THEN PRINT "Blocked down" PRINT GOTO Engloop1: Endroom1: '//////////////////////////////////////////////////////////////////////////// END SUB SUB Room2 '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Inroom% = 2 PRINT PRINT PRINT PRINT "ROOM II" PRINT IF Roomset2% = 1 GOTO Engloop2: Look2: PRINT "Room 2, south Room 1, east Room 3" PRINT Roomset2% = 1 Engloop2: Objects Engine IF Roomjump% > 0 GOTO Endroom2: IF Resetprogram% = 1 THEN GOTO Endroom2: IF Quitset% > 0 GOTO Endroom2: IF Lookset% = 1 GOTO Look2: IF Northset% = 1 THEN PRINT "Blocked north" IF Southset% = 1 THEN Goroom% = 1 GOTO Endroom2: END IF IF Eastset% = 1 THEN Goroom% = 3 GOTO Endroom2: END IF IF Westset% = 1 THEN PRINT "Blocked west" IF Neset% = 1 THEN PRINT "Blocked north east" IF Seset% = 1 THEN PRINT "Blocked south east" IF Swset% = 1 THEN PRINT "Blocked south west" IF Nwset% = 1 THEN PRINT "Blocked north west" IF Upset% = 1 THEN PRINT "Blocked up" IF Downset% = 1 THEN PRINT "Blocked down" PRINT GOTO Engloop2: Endroom2: '//////////////////////////////////////////////////////////////////////////// END SUB SUB Room3 '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Inroom% = 3 PRINT PRINT PRINT PRINT "ROOM III" PRINT IF Roomset3% = 1 GOTO Engloop3: Look3: PRINT "Room 3, west Room 2, down Room 4, south west Room 1" PRINT Roomset3% = 1 Engloop3: Objects Engine IF Roomjump% > 0 GOTO Endroom3: IF Resetprogram% = 1 THEN GOTO Endroom3: IF Quitset% > 0 GOTO Endroom3: IF Lookset% = 1 GOTO Look3: IF Northset% = 1 THEN PRINT "Blocked north" IF Southset% = 1 THEN PRINT "Blocked south" IF Eastset% = 1 THEN PRINT "Blocked east" IF Westset% = 1 THEN Goroom% = 2 GOTO Endroom3: END IF IF Neset% = 1 THEN PRINT "Blocked north east" IF Seset% = 1 THEN PRINT "Blocked south east" IF Swset% = 1 THEN Goroom% = 1 GOTO Endroom3: END IF IF Nwset% = 1 THEN PRINT "Blocked north west" IF Upset% = 1 THEN PRINT "Blocked up" IF Downset% = 1 THEN Goroom% = 4 GOTO Endroom3: END IF PRINT GOTO Engloop3: Endroom3: '//////////////////////////////////////////////////////////////////////////// END SUB SUB Room4 '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Inroom% = 4 PRINT PRINT PRINT PRINT "ROOM IV" PRINT IF Roomset4% = 1 GOTO Engloop4: Look4: PRINT "Room 4, up Room 3, west Room 5" PRINT Roomset4% = 1 Engloop4: Objects Engine IF Roomjump% > 0 GOTO Endroom4: IF Resetprogram% = 1 THEN GOTO Endroom4: IF Quitset% > 0 GOTO Endroom4: IF Lookset% = 1 GOTO Look4: IF Northset% = 1 THEN PRINT "Blocked north" IF Southset% = 1 THEN PRINT "Blocked south" IF Eastset% = 1 THEN PRINT "Blocked east" IF Westset% = 1 THEN Goroom% = 5 GOTO Endroom4: END IF IF Neset% = 1 THEN PRINT "Blocked north east" IF Seset% = 1 THEN PRINT "Blocked south east" IF Swset% = 1 THEN PRINT "Blocked south west" IF Nwset% = 1 THEN PRINT "Blocked north west" IF Upset% = 1 THEN Goroom% = 3 GOTO Endroom4: END IF IF Downset% = 1 THEN PRINT "Blocked down" PRINT GOTO Engloop4: Endroom4: '//////////////////////////////////////////////////////////////////////////// END SUB SUB Room5 '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Inroom% = 5 PRINT PRINT PRINT PRINT "ROOM V" PRINT IF Roomset5% = 1 GOTO Engloop5: Look5: PRINT "Room 5, east Room 4" PRINT Roomset5% = 1 Engloop5: Objects Engine IF Roomjump% > 0 GOTO Endroom5: IF Resetprogram% = 1 THEN GOTO Endroom5: IF Quitset% > 0 GOTO Endroom5: IF Lookset% = 1 GOTO Look5: IF Northset% = 1 THEN PRINT "Blocked north" IF Southset% = 1 THEN PRINT "Blocked south" IF Eastset% = 1 THEN Goroom% = 4 GOTO Endroom5: END IF IF Westset% = 1 THEN PRINT "Blocked west" IF Neset% = 1 THEN PRINT "Blocked north east" IF Seset% = 1 THEN PRINT "Blocked south east" IF Swset% = 1 THEN PRINT "Blocked south west" IF Nwset% = 1 THEN PRINT "Blocked north west" IF Upset% = 1 THEN PRINT "Blocked up" IF Downset% = 1 THEN PRINT "Blocked down" PRINT GOTO Engloop5: Endroom5: '//////////////////////////////////////////////////////////////////////////// END SUB SUB Take '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ IF Inv1% = 4 THEN PRINT "You cannot possibly carry any more items." GOTO EndTake: END IF '--------[Item requested from command line]---------------------------------- Takeitem$ = RIGHT$(Engcom$, 7) IF Takeitem$ = "lantern" AND Lanternroom% = 0 GOTO HaveitemTake: IF Takeitem$ = "lantern" AND Lanternset% > 0 THEN Inv1% = Inv1% + 1 Lanternroom% = 0 PRINT "Taken." GOTO EndTake: END IF IF Takeitem$ = "lantern" AND Lanternroom% = -5 THEN Inv1% = Inv1% + 1 BagInv1% = BagInv1% - 1 Lanternroom% = 0 PRINT "Taken." GOTO EndTake: END IF Takeitem$ = RIGHT$(Engcom$, 6) IF Takeitem$ = "candle" AND Candleroom% = 0 GOTO HaveitemTake: IF Takeitem$ = "candle" AND Candleset% > 0 THEN Inv1% = Inv1% + 1 Candleroom% = 0 PRINT "Taken." GOTO EndTake: END IF IF Takeitem$ = "candle" AND Candleroom% = -5 THEN Inv1% = Inv1% + 1 BagInv1% = BagInv1% - 1 Candleroom% = 0 PRINT "Taken." GOTO EndTake: END IF Takeitem$ = RIGHT$(Engcom$, 7) IF Takeitem$ = "matches" AND Matchesroom% = 0 GOTO HaveitemTake: IF Takeitem$ = "matches" AND Matchesset% > 0 THEN Inv1% = Inv1% + 1 Matchesroom% = 0 PRINT "Taken." GOTO EndTake: END IF IF Takeitem$ = "matches" AND Matchesroom% = -5 THEN Inv1% = Inv1% + 1 BagInv1% = BagInv1% - 1 Matchesroom% = 0 PRINT "Taken." GOTO EndTake: END IF Takeitem$ = RIGHT$(Engcom$, 3) IF Takeitem$ = "axe" AND Axeroom% = 0 GOTO HaveitemTake: IF Takeitem$ = "axe" AND Axeset% > 0 THEN Inv1% = Inv1% + 1 Axeroom% = 0 PRINT "Taken." GOTO EndTake: END IF IF Takeitem$ = "axe" AND Axeroom% = -5 THEN Inv1% = Inv1% + 1 BagInv1% = BagInv1% - 1 Axeroom% = 0 PRINT "Taken." GOTO EndTake: END IF Takeitem$ = RIGHT$(Engcom$, 3) IF Takeitem$ = "bag" AND Bagroom% = 0 GOTO HaveitemTake: IF Takeitem$ = "bag" AND Bagset% > 0 THEN Inv1% = Inv1% + 1 Bagroom% = 0 PRINT "Taken." GOTO EndTake: END IF NoitemTake: PRINT "I do not see that here." GOTO EndTake: HaveitemTake: PRINT "You already have that." GOTO EndTake: '---------------------------------------------------------------------------- EndTake: '//////////////////////////////////////////////////////////////////////////// END SUB