This is the entire program. When i originally wrote this, i remed as much as possible, but i don't know how documented it is now. If you have a question or more than one question, or you need some documentation on a part of the program, email me at
[email protected] If anyone could figure out why when the program returns from the map subroutine to the menu subroutine that it goes beserk (it looks weird screen flashes like it is running through a loop 50,000 times). If you can help it would be of great help.
p.s. Ctrl + Break is turned off only in the map subroutine, to exit in that section, press "q"
' Michael Davis
DIM Price(7), Pricer(7) ' the price for the seven items
RANDOMIZE TIMER
Debt = 5000 ' the amount of money owed to the lunch lady (loan Shark)
Deposited = 0 ' the amount of money in the piggy bank in the beginning
YourMoney = 10000 ' The how much money you start with
Pockets = 100 ' The number of items you can hold
TotalAmount = 0 ' The total amount of items you have
Location$ = "Bathroom" ' the default location to sell at
'________________________________________________________________
Choicer = 0 ' a variable so you can redo the prices each time.
'________________________________________________________________
Rolex = 0
Gold = 0
Stereo = 0
Television = 0
CompactD = 0
LittleTV = 0
Spit = 0
days = 0
FOR x = 1 TO 3000 ' My intro and signature
COLOR 4, 0
CLS
LOCATE 10
PRINT TAB(24); "ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ"
PRINT TAB(24); "ÛÛÛÛÛÛÛÛÛÛÛ BY ÛÛÛÛÛÛÛÛÛÛÛ"
PRINT TAB(24); "ÛÛÛÛÛÛÛÛÛÛÛ MICHAEL ÛÛÛÛÛÛÛÛÛÛÛ"
PRINT TAB(24); "ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ"
PRINT : PRINT : PRINT
COLOR 7, 0
NEXT x
CLS
PRINT : PRINT : PRINT
PRINT TAB(29); "Welcome the School Wars"
PRINT : PRINT
PRINT TAB(15); "In this game, you are a SCHOOL TEACHER, and you sell/buy";
PRINT TAB(15); "confiscated materials to other teachers and/or ";
PRINT TAB(15); "students. You have 45 days to make as much money ";
PRINT TAB(15); "as possible. Beware of the principal, or you ";
PRINT TAB(15); "might get caught. Also, you may sell inside the ";
PRINT TAB(15); "office for higher prices, but your chance of being";
PRINT TAB(15); "is greater. Take Caution, and Sell Well"
PRINT
SLEEP 15
WHILE days <= 45
WHILE Choice <> 8 AND days <= 45 ' Prints menu until user makes selection
IF Choicer <> 1 THEN
'------------Generate the Prices----------------
Price(1) = INT(RND * 400001) + 200000
Price(2) = INT(RND * 40001) + 140000
Price(3) = INT(RND * 20001) + 80000
Price(4) = INT(RND * 20001) + 40000
Price(5) = INT(RND * 20001) + 16000
Price(6) = INT(RND * 2001) + 9000
Price(7) = INT(RND * 2001) + 2000
'------------------------------------------------
END IF
CLS
PRINT : PRINT
PRINT TAB(23); "ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿"
PRINT TAB(23); "³ School Wars ³"
PRINT TAB(23); "ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"
PRINT
COLOR 4, 0
PRINT TAB(36); "Day = "; days
COLOR 7, 0
PRINT
KEY 15, CHR$(0) + CHR$(16)
KEY 16, CHR$(0) + CHR$(57)
KEY(16) ON
KEY(15) ON
KEY(11) ON
KEY(14) ON
BeenDown = 0
Choice = 1
COLOR 0, 7
LOCATE 9, 29
PRINT "* 1. Price List"
COLOR 7, 0
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
LOCATE 16, 29
PRINT " 8. Quit"
WHILE x <> 2
DEF SEG = 0
Status% = PEEK(&H417) 'Read keyboard status.
POKE &H417, (&H0) 'Change status. (all off)
ON KEY(15) GOSUB Quiter
ON KEY(16) GOSUB Checker
IF Mike = 69 THEN
Mike = 0
Choice = 1
KEY(16) ON
BeenDown = 0
CLS
PRINT : PRINT
PRINT TAB(23); "ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿"
PRINT TAB(23); "³ School Wars ³"
PRINT TAB(23); "ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"
PRINT
COLOR 4, 0
PRINT TAB(36); "Day = "; days
COLOR 7, 0
PRINT
COLOR 0, 7
LOCATE 9, 29
PRINT "* 1. Price List"
COLOR 7, 0
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
LOCATE 16, 29
PRINT " 8. Quit"
END IF
ON KEY(11) GOSUB Upper
ON KEY(14) GOSUB Downer
WEND
WEND
WEND
END
Upper:
KEY(16) ON
CLS
PRINT : PRINT
PRINT TAB(23); "ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿"
PRINT TAB(23); "³ School Wars ³"
PRINT TAB(23); "ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"
PRINT
COLOR 4, 0
PRINT TAB(36); "Day = "; days
COLOR 7, 0
PRINT
IF BeenDown = 0 THEN
Choice = 1
COLOR 0, 7
LOCATE 9, 29
PRINT "* 1. Price List"
COLOR 7, 0
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
LOCATE 16, 29
PRINT " 8. Quit"
END IF
IF BeenDown = 1 THEN
Choice = 1
BeenDown = 0
COLOR 0, 7
LOCATE 9, 29
PRINT "* 1. Price List"
COLOR 7, 0
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
LOCATE 16, 29
PRINT " 8. Quit"
END IF
IF BeenDown = 2 THEN
Choice = 2
BeenDown = 1
COLOR 7, 0
LOCATE 9, 29
PRINT " 1. Price List"
COLOR 0, 7
LOCATE 10, 29
PRINT "* 2. Buy"
COLOR 7, 0
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
LOCATE 16, 29
PRINT " 8. Quit"
END IF
IF BeenDown = 3 THEN
Choice = 3
BeenDown = 2
COLOR 7, 0
LOCATE 9, 29
PRINT " 1. Price List"
LOCATE 10, 29
PRINT " 2. Buy"
COLOR 0, 7
LOCATE 11, 29
PRINT "* 3. Sell"
LOCATE 12, 29
COLOR 7, 0
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
LOCATE 16, 29
PRINT " 8. Quit"
END IF
IF BeenDown = 4 THEN
Choice = 4
BeenDown = 3
COLOR 7, 0
LOCATE 9, 29
PRINT " 1. Price List"
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
COLOR 0, 7
LOCATE 12, 29
PRINT "* 4. Move"
COLOR 7, 0
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
LOCATE 16, 29
PRINT " 8. Quit"
END IF
IF BeenDown = 5 THEN
Choice = 5
BeenDown = 4
COLOR 7, 0
LOCATE 9, 29
PRINT " 1. Price List"
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
COLOR 0, 7
LOCATE 13, 29
PRINT "* 5. Lunch Lady(loan shark)"
COLOR 7, 0
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
LOCATE 16, 29
PRINT " 8. Quit"
END IF
IF BeenDown = 6 THEN
Choice = 6
BeenDown = 5
COLOR 7, 0
LOCATE 9, 29
PRINT " 1. Price List"
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
COLOR 0, 7
LOCATE 14, 29
PRINT "* 6. Penny Bank"
COLOR 7, 0
LOCATE 15, 29
PRINT " 7. Desk"
LOCATE 16, 29
PRINT " 8. Quit"
END IF
IF BeenDown = 7 THEN
Choice = 7
BeenDown = 6
COLOR 7, 0
LOCATE 9, 29
PRINT " 1. Price List"
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
COLOR 0, 7
LOCATE 15, 29
PRINT "* 7. Desk"
COLOR 7, 0
LOCATE 16, 29
PRINT " 8. Quit"
END IF
IF BeenDown = 8 THEN
Choice = 8
BeenDown = 7
COLOR 7, 0
LOCATE 9, 29
PRINT " 1. Price List"
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
COLOR 0, 7
LOCATE 16, 29
PRINT "* 8. Quit"
COLOR 7, 0
END IF
RETURN
Downer:
KEY(16) ON
CLS
PRINT : PRINT
PRINT TAB(23); "ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿"
PRINT TAB(23); "³ School Wars ³"
PRINT TAB(23); "ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"
PRINT
COLOR 4, 0
PRINT TAB(36); "Day = "; days
COLOR 7, 0
PRINT
IF BeenDown >= 8 THEN
Choice = 8
BeenDown = 8
COLOR 7, 0
LOCATE 9, 29
PRINT " 1. Price List"
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
COLOR 0, 7
LOCATE 16, 29
PRINT "* 8. Quit"
COLOR 7, 0
END IF
IF BeenDown = 7 THEN
Choice = 8
BeenDown = 8
COLOR 7, 0
LOCATE 9, 29
PRINT " 1. Price List"
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
COLOR 0, 7
LOCATE 16, 29
PRINT "* 8. Quit"
COLOR 7, 0
END IF
IF BeenDown = 6 THEN
Choice = 7
BeenDown = 7
COLOR 7, 0
LOCATE 9, 29
PRINT " 1. Price List"
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
COLOR 0, 7
LOCATE 15, 29
PRINT "* 7. Desk"
COLOR 7, 0
LOCATE 16, 29
PRINT " 8. Quit"
END IF
IF BeenDown = 5 THEN
Choice = 6
BeenDown = 6
COLOR 7, 0
LOCATE 9, 29
PRINT " 1. Price List"
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
COLOR 0, 7
LOCATE 14, 29
PRINT "* 6. Penny Bank"
COLOR 7, 0
LOCATE 15, 29
PRINT " 7. Desk"
LOCATE 16, 29
PRINT " 8. Quit"
END IF
IF BeenDown = 4 THEN
Choice = 5
BeenDown = 5
COLOR 7, 0
LOCATE 9, 29
PRINT " 1. Price List"
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
COLOR 0, 7
LOCATE 13, 29
PRINT "* 5. Lunch Lady(loan shark)"
COLOR 7, 0
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
LOCATE 16, 29
PRINT " 8. Quit"
END IF
IF BeenDown = 3 THEN
Choice = 4
BeenDown = 4
COLOR 7, 0
LOCATE 9, 29
PRINT " 1. Price List"
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
COLOR 0, 7
LOCATE 12, 29
PRINT "* 4. Move"
COLOR 7, 0
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
LOCATE 16, 29
PRINT " 8. Quit"
END IF
IF BeenDown = 2 THEN
Choice = 3
BeenDown = 3
COLOR 7, 0
LOCATE 9, 29
PRINT " 1. Price List"
LOCATE 10, 29
PRINT " 2. Buy"
COLOR 0, 7
LOCATE 11, 29
PRINT "* 3. Sell"
COLOR 7, 0
LOCATE 12, 29
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
LOCATE 16, 29
PRINT " 8. Quit"
END IF
IF BeenDown = 1 THEN
Choice = 2
BeenDown = 2
COLOR 7, 0
LOCATE 9, 29
PRINT " 1. Price List"
COLOR 0, 7
LOCATE 10, 29
PRINT "* 2. Buy"
COLOR 7, 0
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
LOCATE 16, 29
PRINT " 8. Quit"
END IF
IF BeenDown = 0 THEN
Choice = 1
BeenDown = 1
COLOR 0, 7
LOCATE 9, 29
PRINT "* 1. Price List"
COLOR 7, 0
LOCATE 10, 29
PRINT " 2. Buy"
LOCATE 11, 29
PRINT " 3. Sell"
LOCATE 12, 29
PRINT " 4. Move"
LOCATE 13, 29
PRINT " 5. Lunch Lady(loan shark)"
LOCATE 14, 29
PRINT " 6. Penny Bank"
LOCATE 15, 29
PRINT " 7. Desk"
LOCATE 16, 29
PRINT " 8. Quit"
END IF
RETURN
Quiter:
x = 2
Choice = 8
days = 600
RETURN
Checker:
CLS
Mike = 69
KEY(16) OFF
IF Choice = 1 THEN Choicer = 1
IF Choice = 1 THEN GOSUB Price
IF Choice = 2 THEN GOSUB BUY
IF Choice = 3 THEN GOSUB Sell
IF Choice = 4 THEN GOSUB Move
IF Choice = 5 THEN GOSUB Shark
IF Choice = 6 THEN GOSUB Bank
IF Choice = 7 THEN GOSUB Desk
IF Choice = 8 THEN END
IF days > 45 THEN GOSUB Ending
Choice = 0
RETURN
Price: ' Prints the price list
CLS
PRINT : PRINT : PRINT
PRINT TAB(32); "Prices for "; Location$ ' prints your location
PRINT : PRINT
FOR x = 1 TO 7
IF x = 1 THEN PRINT TAB(14); "Rolex";
IF x = 2 THEN PRINT TAB(14); "Gold Earrings";
IF x = 3 THEN PRINT TAB(14); "Stereo System";
IF x = 4 THEN PRINT TAB(14); "T.V.";
IF x = 5 THEN PRINT TAB(14); "Portable Cd Player";
IF x = 6 THEN PRINT TAB(14); "Miniuature T.V.";
IF x = 7 THEN PRINT TAB(14); "Spitwad Launcher";
PRINT TAB(60); USING "###,###.##"; Price(x)
IF x = 7 THEN
PRINT TAB(14); "Your money"; TAB(55);
PRINT USING "$###,###,###.##"; YourMoney
END IF
IF x = 7 THEN
PRINT TAB(14); "Day = "; days
END IF
NEXT x
PRINT
INPUT "Press <ENTER> to continue", Dummy$
Choice = 0
RETURN
BUY:
Switcher$ = "NO" ' Tells if they made a purchase or not
WHILE Switcher$ = "NO" 'Loops until they make a complete purchase or quit
DO
CLS
PRINT : PRINT : PRINT : PRINT : PRINT : PRINT
PRINT TAB(29); "(1) Rolex"
PRINT TAB(29); "(2) Gold Earrings"
PRINT TAB(29); "(3) Stereo System"
PRINT TAB(29); "(4) T.V."
PRINT TAB(29); "(5) Portable Cd Player"
PRINT TAB(29); "(6) Miniuature T.V."
PRINT TAB(29); "(7) Spitwad Launcher"
PRINT TAB(29); "(8) Return to Main Menu"
PRINT : PRINT
INPUT "What would you like to buy"; Bought$
Bought$ = UCASE$(Bought$)
IF Bought$ = "8" THEN
Choice = 0
RETURN
END IF
LOOP UNTIL VAL(Bought$) <= 8 AND VAL(Bought$) > 0 'loops until u pick 1-8
'___________________________________
' I changed the menu and was to lazy to change the whole program
' so these make it ok. :)
IF Bought$ = "1" THEN Bought$ = "RX"
IF Bought$ = "2" THEN Bought$ = "GE"
IF Bought$ = "3" THEN Bought$ = "SS"
IF Bought$ = "4" THEN Bought$ = "TV"
IF Bought$ = "5" THEN Bought$ = "CD"
IF Bought$ = "6" THEN Bought$ = "MTV"
IF Bought$ = "7" THEN Bought$ = "SL"
'___________________________________
PRINT
DO
LOCATE 19
PRINT "";
INPUT "How many would you like"; HowMany$
HowMany = VAL(HowMany$)
LOOP UNTIL HowMany >= 1 ' Loops until you pick a number over 1
'___________________________________________________________________
' these tell the computer what item it is so it can choose the
' correct array from the price menu
IF Bought$ = "RX" THEN xer = 1
IF Bought$ = "GE" THEN xer = 2
IF Bought$ = "SS" THEN xer = 3
IF Bought$ = "TV" THEN xer = 4
IF Bought$ = "CD" THEN xer = 5
IF Bought$ = "MTV" THEN xer = 6
IF Bought$ = "SL" THEN xer = 7
' remember price that you bought it at.
IF Bought$ = "RX" THEN BoughtPrice(xer) = Price(xer)
IF Bought$ = "GE" THEN BoughtPrice(xer) = Price(xer)
IF Bought$ = "SS" THEN BoughtPrice(xer) = Price(xer)
IF Bought$ = "TV" THEN BoughtPrice(xer) = Price(xer)
IF Bought$ = "CD" THEN BoughtPrice(xer) = Price(xer)
IF Bought$ = "MTV" THEN BoughtPrice(xer) = Price(xer)
IF Bought$ = "SL" THEN BoughtPrice(xer) = Price(xer)
'___________________________________________________________________
IF HowMany > Pockets THEN ' makes sure you're not asking for more
Switcher$ = "NO" ' than you can hold.
Sold$ = "No Sale"
PRINT "You can't do that, stupid!!!"
INPUT "Hit <ENTER> to continue", Dummy$
CLS
END IF
IF HowMany * Price(xer) > YourMoney THEN ' Makes sure you can afford it
Switcher$ = "NO"
PRINT "You can't afford that, stupid!!!"
Sold$ = "No Sale"
INPUT "Hit <ENTER> to continue", Dummy$
END IF
'________________________________________________________________
' this lets you buy if you can afford it and hold it all.
IF HowMany <= Pockets AND HowMany * Price(xer) < YourMoney THEN
Switcher$ = "Yes"
TotalAmount = TotalAmount + HowMany
Pockets = Pockets - HowMany
YourMoney = YourMoney - HowMany * Price(xer)
IF Bought$ = "RX" THEN Rolex = Rolex + HowMany
IF Bought$ = "GE" THEN Gold = Gold + HowMany
IF Bought$ = "SS" THEN Stereo = Stereo + HowMany
IF Bought$ = "TV" THEN Television = Television + HowMany
IF Bought$ = "CD" THEN CompactD = CompactD + HowMany
IF Bought$ = "MTV" THEN LittleTV = LittleTV + HowMany
IF Bought$ = "SL" THEN Spit = Spit + HowMany
IF Bought$ = "RX" THEN Pricer(1) = Price(1)
IF Bought$ = "GE" THEN Pricer(2) = Price(2)
IF Bought$ = "SS" THEN Pricer(3) = Price(3)
IF Bought$ = "TV" THEN Pricer(4) = Price(4)
IF Bought$ = "CD" THEN Pricer(5) = Price(5)
IF Bought$ = "MTV" THEN Pricer(6) = Price(6)
IF Bought$ = "SL" THEN Pricer(7) = Price(7)
INPUT "Press <ENTER> to continue", Dummy$
END IF
'____________________________________________________________________
WEND
Choice = 0
RETURN
Sell:
Switcher$ = "NO" ' Makes sure a real sale is made.
WHILE Switcher$ = "NO" ' Keeps you in until you make a sale or press 8
DO ' this prints the menu until they choose one of the options
CLS
PRINT : PRINT : PRINT : PRINT : PRINT : PRINT
PRINT TAB(29); "(1) Rolex"
PRINT TAB(29); "(2) Gold Earrings"
PRINT TAB(29); "(3) Stereo System"
PRINT TAB(29); "(4) T.V."
PRINT TAB(29); "(5) Portable Cd Player"
PRINT TAB(29); "(6) Miniuature T.V."
PRINT TAB(29); "(7) Spitwad Launcher"
PRINT TAB(29); "(8) Return to Main Menu"
PRINT : PRINT
INPUT "What would you like to sell"; Sold$
Sold$ = UCASE$(Sold$) ' Makes their answer uppercase
LOOP UNTIL VAL(Sold$) > 0 AND VAL(Sold$) <= 8
IF VAL(Sold$) = 8 THEN
Choice = 0
RETURN ' returns to main menu if 8 is pressed
END IF
'____________________________________________________________
' this is the result of me changing the menus. Instead of numbers I
' had letters when i wrote the program.These fix it.
IF Sold$ = "1" THEN Sold$ = "RX"
IF Sold$ = "2" THEN Sold$ = "GE"
IF Sold$ = "3" THEN Sold$ = "SS"
IF Sold$ = "4" THEN Sold$ = "TV"
IF Sold$ = "5" THEN Sold$ = "CD"
IF Sold$ = "6" THEN Sold$ = "MTV"
IF Sold$ = "7" THEN Sold$ = "SL"
'____________________________________________________________
'__________________________________________________________________
' these tell the computer what item it is so it can choose the
' correct array from the price menu
IF Sold$ = "RX" THEN xer = 1
IF Sold$ = "GE" THEN xer = 2
IF Sold$ = "SS" THEN xer = 3
IF Sold$ = "TV" THEN xer = 4
IF Sold$ = "CD" THEN xer = 5
IF Sold$ = "MTV" THEN xer = 6
IF Sold$ = "SL" THEN xer = 7
' tells price at which the product was bought
IF Sold$ = "RX" THEN BoughtPrice(xer) = 0
IF Sold$ = "GE" THEN BoughtPrice(xer) = 0
IF Sold$ = "SS" THEN BoughtPrice(xer) = 0
IF Sold$ = "TV" THEN BoughtPrice(xer) = 0
IF Sold$ = "CD" THEN BoughtPrice(xer) = 0
IF Sold$ = "MTV" THEN BoughtPrice(xer) = 0
IF Sold$ = "SL" THEN BoughtPrice(xer) = 0
'__________________________________________________________________
IF Sold$ = "Q" THEN
Choice = 0
RETURN
END IF
SELECT CASE Sold$
CASE IS = "RX" ' if they choose the rolex
IF Rolex >= 1 THEN
INPUT "How many would you like to sell?", HowMany$
HowMany = VAL(HowMany$)
IF HowMany <= Rolex THEN
Switcher$ = "Yes"
TotalAmount = TotalAmount - HowMany
Pockets = Pockets + HowMany
YourMoney = YourMoney + HowMany * Price(xer)
Rolex = Rolex - HowMany
ELSEIF HowMany > Rolex THEN
Switcher$ = "NO"
Sold$ = "No Sale"
PRINT "You can't sell that many!!!"
END IF
ELSEIF Rolex < 1 THEN
PRINT "You don't have any of these to sell!!!!"
Sold$ = "No Sale"
END IF
CASE IS = "GE" ' If they choose the golden earring
IF Gold >= 1 THEN
INPUT "How many would you like to sell?", HowMany$
HowMany = VAL(HowMany$)
IF HowMany <= Gold THEN
Switcher$ = "Yes"
TotalAmount = TotalAmount - HowMany
Pockets = Pockets + HowMany
YourMoney = YourMoney + HowMany * Price(xer)
Gold = Gold - HowMany
ELSEIF HowMany > Gold THEN
Switcher$ = "NO"
Sold$ = "No Sale"
PRINT "You can't sell that many!!!"
END IF
ELSEIF Gold < 1 THEN
Sold$ = "No Sale"
PRINT "You don't have any of these to sell!!!!"
END IF
CASE IS = "SS" ' if they choose the Stereo System
IF Stereo >= 1 THEN
INPUT "How many would you like to sell?", HowMany$
HowMany = VAL(HowMany$)
IF HowMany <= Stereo THEN
Switcher$ = "Yes"
TotalAmount = TotalAmount - HowMany
Pockets = Pockets + HowMany
YourMoney = YourMoney + HowMany * Price(xer)
Stereo = Stereo - HowMany
ELSEIF HowMany > Stereo THEN
Switcher$ = "NO"
Sold$ = "No Sale"
PRINT "You can't sell that many!!!"
END IF
ELSEIF Stereo < 1 THEN
Sold$ = "No Sale"
PRINT "You don't have any of these to sell!!!!"
END IF
CASE IS = "TV" ' IF They choose the large Television
IF Television >= 1 THEN
INPUT "How many would you like to sell?", HowMany$
HowMany = VAL(HowMany$)
IF HowMany <= Television THEN
Switcher$ = "Yes"
TotalAmount = TotalAmount - HowMany
Pockets = Pockets + HowMany
YourMoney = YourMoney + HowMany * Price(xer)
Television = Television - HowMany
ELSEIF HowMany > Television THEN
Switcher$ = "NO"
Sold$ = "No Sale"
PRINT "You can't sell that many!!!"
END IF
ELSEIF Television < 1 THEN
Sold$ = "No Sale"
PRINT "You don't have any of these to sell!!!!"
END IF
CASE IS = "CD" ' If they choose Portable Cd Player
IF CompactD >= 1 THEN
INPUT "How many would you like to sell?", HowMany$
HowMany = VAL(HowMany$)
IF HowMany <= CompactD THEN
Switcher$ = "Yes"
TotalAmount = TotalAmount - HowMany
Pockets = Pockets + HowMany
YourMoney = YourMoney + HowMany * Price(xer)
CompactD = CompactD - HowMany
ELSEIF HowMany > CompactD THEN
Switcher$ = "NO"
Sold$ = "No Sale"
PRINT "You can't sell that many!!!"
END IF
ELSEIF CompactD < 1 THEN
Sold$ = "No Sale"
PRINT "You don't have any of these to sell!!!!"
END IF
CASE IS = "MTV" ' if they choose Miniuature T.V.
IF LittleTV >= 1 THEN
INPUT "How many would you like to sell?", HowMany$
HowMany = VAL(HowMany$)
IF HowMany <= LittleTV THEN
Switcher$ = "Yes"
TotalAmount = TotalAmount - HowMany
Pockets = Pockets + HowMany
YourMoney = YourMoney + HowMany * Price(xer)
LittleTV = LittleTV - HowMany
ELSEIF HowMany > LittleTV THEN
Switcher$ = "NO"
Sold$ = "No Sale"
PRINT "You can't sell that many!!!"
END IF
ELSEIF LittleTV < 1 THEN
PRINT "You don't have any of these to sell!!!!"
Sold$ = "No Sale"
END IF
CASE IS = "SL" ' if they choose spitwad launcher
IF Spit >= 1 THEN
INPUT "How many would you like to sell?", HowMany$
HowMany = VAL(HowMany$)
IF HowMany <= Spit THEN
Switcher$ = "Yes"
TotalAmount = TotalAmount - HowMany
Pockets = Pockets + HowMany
YourMoney = YourMoney + HowMany * Price(xer)
Spit = Spit - HowMany
ELSEIF HowMany > Spit THEN
Switcher$ = "NO"
Sold$ = "No Sale"
PRINT "You can't sell that many!!!"
END IF
ELSEIF Spit < 1 THEN
PRINT "You don't have any of these to sell!!!!"
Sold$ = "No Sale"
END IF
END SELECT
INPUT "Hit <ENTER> to continue", Dummy$
Choice = 0
RETURN
WEND
Move:
CLS
LOCATE 11, (80 - LEN("USE THE NUMPAD ARROWS")) / 2
PRINT "USE THE NUMPAD ARROWS"
PRINT TAB((80 - LEN("HIT <ENTER> TO CONTINUE")) / 2);
INPUT "HIT <ENTER> TO CONTINUE"; Dummy$
Choice$ = "0"
WHILE Choice$ <> "7"
CLS
RANDOMIZE TIMER
Row = 11
Col = 40
End$ = "no"
KEY(15) ON
KEY(11) ON
KEY(12) ON
KEY(13) ON
KEY(14) ON
GOSUB PrintMap
WHILE End$ <> "yes"
DEF SEG = 0
Status% = PEEK(&H417) 'Read keyboard status.
POKE &H417, (&H0) 'Change status. (all off)
ON KEY(11) GOSUB Up
ON KEY(12) GOSUB Left
ON KEY(13) GOSUB Right
ON KEY(14) GOSUB Down
WEND
RETURN
END
Up:
Row = Row - 1
IF Row < 4 THEN Row = 3
IF Row <= 8 AND Row > 6 AND Col <= 11 THEN Row = 8
IF Col = 15 AND Row <= 8 AND Row > 6 THEN Row = 8
GOSUB PrintMap
RETURN
Down:
Row = Row + 1
IF Row > 22 THEN Row = 22
IF Row >= 6 AND Row < 8 AND Col <= 11 THEN Row = 6
GOSUB PrintMap
RETURN
Left:
Col = Col - 1
IF Col < 2 THEN Col = 2
IF Col <= 16 AND Col > 14 AND Row <= 7 THEN Col = 16
IF Col <= 12 AND Row = 7 THEN Col = 12
GOSUB PrintMap
RETURN
Right:
Col = Col + 1
IF Col > 77 THEN Col = 77
IF Row <= 7 AND Col >= 14 AND Col < 16 THEN Col = 14
GOSUB PrintMap
RETURN
PrintMap:
CLS
x = 2
y = 0
CLS
FOR z = 1 TO 78
LOCATE x, y + z
PRINT CHR$(196)
NEXT z
PRINT CHR$(179); TAB(15); CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(15); CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(4);
COLOR 4, 0
PRINT "Bathroom";
COLOR 7, 0
PRINT TAB(15); CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(15); CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(2); CHR$(196); TAB(3); CHR$(196);
PRINT TAB(4); CHR$(196); TAB(5); CHR$(196); TAB(6); CHR$(196);
PRINT TAB(7); CHR$(196); TAB(8); CHR$(196); TAB(9); CHR$(196);
PRINT TAB(10); CHR$(196); TAB(11); CHR$(196);
PRINT TAB(15); CHR$(217); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); TAB(78); CHR$(179)
PRINT CHR$(179); "Col = "; Col; " Row = "; Row;
PRINT TAB(78); CHR$(179)
PRINT CHR$(179); TAB(78); CHR$(179)
LOCATE Row, Col
PRINT "*"
FOR z = 1 TO 78
LOCATE x + 21, y + z
PRINT CHR$(196)
NEXT z
IF Col <= 11 AND Col >= 4 AND Row = 5 THEN
Choice = 1
GOSUB Location
END IF
RETURN
Location:
IF Choice = 1 THEN
Location$ = "Bathroom"
days = days + 1
Choicer = 0
Choice$ = "7"
End$ = "yes"
END IF
IF Choice = 2 THEN
Location$ = "Office"
days = days + 1
Choicer = 0
END IF
IF Choice = 3 THEN
Location$ = "C Hall"
days = days + 1
Choicer = 0
END IF
IF Choice = 4 THEN
Location$ = "D Hall"
days = days + 1
Choicer = 0
END IF
IF Choice = 5 THEN
Location$ = "E Hall"
days = days + 1
Choicer = 0
END IF
IF Choice = 6 THEN
Location$ = "Playground"
days = days + 1
Choicer = 0
END IF
IF Choice >= 1 AND Choice <= 5 THEN
CLS
LOCATE 13, 37
PRINT Location$
SLEEP 5
END IF
IF Choice = 6 THEN
CLS
LOCATE 13, 35
PRINT Location$
SLEEP 5
END IF
WEND
Choice = 0
RETURN
Choice = 0
RETURN
Shark:
Choice = 0
WHILE Choice <> 3
CLS
PRINT : PRINT
PRINT TAB(23); "ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿"
PRINT TAB(23); "³ Loan Shark ³"
PRINT TAB(23); "ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"
PRINT : PRINT
PRINT TAB(30); "1. Borrow"
PRINT TAB(30); "2. Repay"
PRINT TAB(30); "3. Main Menu"
PRINT : PRINT TAB(8);
INPUT "What is your choice? ", Choice$
Choice = VAL(Choice$)
IF Choice = 1 THEN
IF Debt < 99999 THEN
CLS
PRINT : PRINT : PRINT : PRINT
PRINT TAB(28); "Your debt is "; USING "##,###.##"; Debt
PRINT
PRINT TAB(16);
PRINT "Lunch Lady: 'How much would you like to borrow?'";
INPUT " ", Borrow
IF Borrow < 10000 THEN
PRINT TAB(39); "OK"
YourMoney = YourMoney + Borrow
Debt = Debt + Borrow
ELSEIF Borrow > 10000 THEN
PRINT TAB(28); "Do you think I am crazy?"
END IF
ELSEIF Debt > 99999 THEN
CLS
PRINT : PRINT : PRINT : PRINT : PRINT
PRINT TAB(20); "Lunch Lady: 'You have borrowed too much.'"
PRINT TAB(20); "Lunch Lady: 'Maybe you should repay me.'"
END IF
END IF
IF Choice = 2 THEN
CLS
PRINT : PRINT : PRINT : PRINT : PRINT : PRINT
PRINT TAB(14);
PRINT "Lunch Lady: 'I didn't think you would ever repay me'"
PRINT TAB(20);
INPUT "Lunch Lady: 'How much are you repaying?'", Repay
IF Repay > YourMoney THEN
PRINT TAB(27); "You don't have that much!!"
END IF
IF Repay > Debt THEN
PRINT TAB(22); "Thanks, but thats a little too much."
END IF
IF Repay <= YourMoney AND Repay <= Debt THEN
PRINT TAB(37); "Thanks!"
YourMoney = YourMoney - Repay
Debt = Debt - Repay
END IF
END IF
INPUT "Hit <ENTER> to continue", Dummy$
Choice = 0
RETURN
WEND
Choice = 0
RETURN
Bank:
Choice = 0
WHILE Choice <> 3
CLS
PRINT : PRINT
PRINT TAB(24); "ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿"
PRINT TAB(24); "³ Piggy Bank ³"
PRINT TAB(24); "ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ"
PRINT : PRINT
PRINT TAB(38); "1. Deposit"
PRINT TAB(38); "2. Remove"
PRINT TAB(38); "3. Main Menu"
PRINT : PRINT TAB(17);
INPUT "What is your choice? ", Choice$
Choice = VAL(Choice$)
IF Choice = 1 THEN
CLS
LOCATE 12
PRINT ;
PRINT TAB(26); "Money in the piggy is "; Deposited
PRINT
PRINT TAB(23);
INPUT "How much would you like to put in?", Deposit$
Deposit = VAL(Deposit$)
IF Deposit > YourMoney THEN
PRINT TAB(21); "You don't have that much to deposit!!!"
END IF
IF Deposit <= YourMoney THEN
PRINT TAB(38); "OK"
Deposited = Deposited + Deposit
YourMoney = YourMoney - Deposit
END IF
END IF
IF Choice = 2 THEN
CLS
LOCATE 12
PRINT ;
PRINT TAB(26); "Money in the piggy is "; Deposited
PRINT
PRINT TAB(22);
INPUT "How much would you like to take out?", Withdrawl$
Withdrawl = VAL(Withdrawl$)
IF Withdrawl > Deposited THEN
PRINT TAB(21);
PRINT "You don't have that much in the bank!!!"
END IF
IF Withdrawl <= Deposited THEN
PRINT TAB(39); "OK"
YourMoney = YourMoney + Withdrawl
Deposited = Deposited - Withdrawl
PRINT TAB(5);
PRINT "You now have "; Deposited; " in the bank."
END IF
END IF
WEND
INPUT "Hit <ENTER> to continue", Dummy$
Choice = 0
RETURN
Desk:
CLS
PRINT : PRINT : PRINT : PRINT
FOR x = 1 TO 7
IF x = 1 THEN PRINT TAB(10); "Rolex";
IF x = 2 THEN PRINT TAB(10); "Gold Earrings";
IF x = 3 THEN PRINT TAB(10); "Stereo System";
IF x = 4 THEN PRINT TAB(10); "T.V.";
IF x = 5 THEN PRINT TAB(10); "Portable Cd Player";
IF x = 6 THEN PRINT TAB(10); "Miniuature T.V.";
IF x = 7 THEN PRINT TAB(10); "Spitwad Launcher";
IF x = 1 THEN
PRINT TAB(35); USING "######"; Rolex;
PRINT TAB(46); USING "#,###,###"; BoughtPrice(1)
END IF
IF x = 2 THEN
PRINT TAB(35); USING "######"; Gold;
PRINT TAB(46); USING "#,###,###"; BoughtPrice(2)
END IF
IF x = 3 THEN
PRINT TAB(35); USING "######"; Stereo;
PRINT TAB(46); USING "#,###,###"; BoughtPrice(3)
END IF
IF x = 4 THEN
PRINT TAB(35); USING "######"; Television;
PRINT TAB(46); USING "#,###,###"; BoughtPrice(4)
END IF
IF x = 5 THEN
PRINT TAB(35); USING "######"; CompactD;
PRINT TAB(46); USING "#,###,###"; BoughtPrice(5)
END IF
IF x = 6 THEN
PRINT TAB(35); USING "######"; LittleTV;
PRINT TAB(46); USING "#,###,###"; BoughtPrice(6)
END IF
IF x = 7 THEN
PRINT TAB(35); USING "######"; Spit;
PRINT TAB(46); USING "#,###,###"; BoughtPrice(7)
END IF
IF x = 7 THEN
PRINT
PRINT TAB(10); "Your money"; TAB(55);
PRINT USING "$###,###,###.##"; YourMoney
END IF
NEXT x
PRINT
INPUT "Hit <ENTER> to continue", Dummy$
Choice = 0
RETURN
Ending:
CLS
LOCATE 11, (80 - LEN("Game Over")) / 2
COLOR 4, 0
PRINT "Game Over"
COLOR 7, 0
PRINT TAB(10); "Your Net Total = "; USING "###,###,###.##"; YourMoney
PRINT TAB(10); "Money owed = "; TAB(31); USING "###,###.##"; Debt
PRINT TAB(10); "Money is bank = "; USING "###,###,###.##"; Deposited
EndResultMoney = YourMoney - Debt
EndResultMoney = EndResultMoney + Deposited
PRINT TAB(27); "--------------"
PRINT TAB(27); USING "###,###,###.##"; EndResultMoney
PRINT
INPUT "Hit <ENTER> to continue"; Dummy$
Choice = 8
RETURN