Drugwar for Sharp EL-9300

Home
Bolo
Programming
Chemistry
More about me
Linx
Legal stuff
History of this page
Sign my guestbook
View my guestbook
Mail me
This program was converted from the Casio version found at http://come.to/happyparrot.casio.games which was converted from the original Texas Instruments version (don't know where to find that version). The program has been functionally modified in only a few ways. For this and other details about the program, please view the Calculator information page.
Sign explanation and key location:
<>      not equal [2ndF] [COMMAND] [C] [6]
%       exponent [Exp]
#       space (where there are several in a row) [ALPHA] [(-)]
!       factorial [MATH] [A] [5]
[       matrix opening bracket [MATH] [E] [3]
]       matrix closing bracket [MATH] [E] [4]
,       comma [ALPHA] [.]
random  random number generator [MATH] [A] [8]
int     integer function [MATH] [A] [2]
{-}     unary minus [(-)]
sqrt(   square root function

NB Case is important outside of quotes!!! (to get uppercase [ALPHA] [2ndF] [letter])
If you have never programmed the EL-9300 before, I suggest that you read the manual or mail me.
I have changed multiple spaces into # character so you can count them more easily.

Create a new program in Matrix Mode called "Drugwar"

ClrT
Print "####Drugwar
Print "##Jassimo 1997
Print ""
Print "Converted for theSharp EL-9300
Print "####by James
Print "Andrewartha 1998
Wait 7
dim A[6,2]
money=2000
loan=5000
bank=0
tspace=100
freespace=100
guns=0
damage=0
day=1
place=3
ClrT
highscore=K
Print ""
Print "Instructions
Print "1) Yes##2) No
Input choice
If choice=1Goto instruc
Label newday
A[1,1]=int 12%3random+16%3
A[2,1]=int 7%3random+5%3
A[3,1]=int 3400random+1%3
A[4,1]=int 420random+330
A[5,1]=int 150random+70
A[6,1]=int 40random+10
event=int 20random+1
ClrT
If event>1Goto chweed
Print "Rival dealers###are selling
Print "cheap dexies!!"
A[6,1]=2
Wait
Goto menu
Label chweed
If event>2Goto chheroin
Print "Weed prices havebottomed-out!!"
A[4,1]=122
Wait
Goto menu
Label chheroin
If event>3Goto exheroin
Print "Pigs are sellingcheap heroin####from last week,sraid!!
A[2,1]=int 1150random+850
Wait
Goto menu
Label exheroin
If event>5Goto excoke
Print "Addicts are#####buying heroin atoutrageous
Print "prices!!
A[2,1]=int 25%3random+18%3
Wait
Goto menu
Label excoke
If event>7Goto mugged
Print "Pigs made a big coke bust!!#####Prices are out- rageous!!
A[1,1]=int 6%4random+8%4
Wait
Goto menu
Label mugged
If event>8Goto newcoat
Print "You were mugged in the subway!
h=int (guns/(guns+1)+1.6)
money=int (h*money/3)
Wait
Goto menu
Label newcoat
If event>9Goto die
If money<300Goto menu
Print "Will you buy a##new trenchcoat##with more
Print "pockets for 200
Input bucks
If bucks<>1Goto menu
tspace=tspace+100
Gosub calcfree
money=money-200
Goto menu
Label die
If event>10Goto gun
Print "There is some###weed here that##smells like goodstuff...
Print "Will you smoke
Input  it
If it<>1Goto menu
Print "You hallucinate on the wildest##trip of your####life. You
Print "stumble onto thetracks and get##creamed by a####train!!
Wait
Goto end
Label gun
If event>12Goto found
If money<500Goto menu
If freespace<5Goto menu
Print "Will you buy a##gun for 400
Input bucks
If buck<>1Goto menu
guns=guns+1
money=money-400
tspace=tspace-5
Gosub calcfree
Goto menu
Label found
If event>13Goto chacid
If freespace<7Goto menu
youfound=int 7random+1
Print youfound
type=int 6random+1
If type=1Goto fcoke
If type=2Goto fheroin
If type=3Goto facid
If type=4Goto fweed
If type=5Goto fspeed
Print "units of dexies
Goto fdead
Label fcoke
Print "units of cocaine
Goto fdead
Label fheroin
Print "units of heroin
Goto fdead
Label facid
Print "units of acid
Goto fdead
Label fweed
Print "units of weed
Goto fdead
Label fspeed
Print "units of speed
Goto fdead
Label fdexies
Print "units of dexies
Label fdead
Print "on a dead duck##in the subway!!
A[type,2]=A[type,2]+youfound
Gosub calcfree
Wait
Goto menu
Label chacid
If event>14Goto pigs
Print "The market has##been flooded####with cheap home-made acid!!
A[3,1]=int 550random+250
Wait
Goto menu
Label pigs
If events>17Goto menu
If tspace-freespace<50Gotomenu
pigs=int ((event-13)/3)+event-14
Print "Officer Hardass
and=pigs
Print and
Print "of his deputies are after you!!
Wait
Label chase
ClrT
Print "Being chased
Print "1) View guns
Print "2) View damage
Print "3) Number of pig
Print "4) Run##5) Fight
Input choice
c=int choice
ClrT
If c=2Goto vdamage
If c=3Goto vpigs
If c=4Goto run
If c=5Goto fight
If c<1Goto chase
If c>5Goto chase
youhave=guns
Print youhave
Print "guns.
Wait
Goto chase
yourdamage=damage
Print yourdamage
Print "30 damage and##you die!!
Wait
Goto chase
Label vpigs
thereare=pigs+1
Print thereare
Print "pigs still
Print "chasing you!
Wait
Goto chase
Label run
x=int 2random
If x=1Goto cantshake
Print "You lost them inan alley!!
day=day+1
Wait
If day=31Goto end
Gotonewday
Label cantshake
Print "You can,t shake them!!
Wait
Goto theyshoot
Label fight
If guns<>0Goto shoot
Print "You don,t have##any guns! You,llhave to run!!
Wait
Goto chase
Label shoot
x=int 2random
If x=0Goto miss
Print "You killed one!!
pigs=pigs-1
Wait
If pigs={-}1Goto alldead
Goto theyshoot
Label miss
Print "You missed!!!
Wait
Label theyshoot
Print "They are firing at you!!
x=int 2random
If x=0Goto theymiss
Print "You,ve been hit!
damage=damage+3
Wait
If damage=30Goto end
Goto chase
Label theymiss
Print "They missed!!
Wait
Goto chase
Label alldead
ClrT
Print "You killed all##of them!
Wait
youfound=int 1250random+750
money=money+youfound
Print youfound
Print "dollars on######Officer Hardass,carcass!!
Wait
If damage=0Goto menu
Print "You are hurt!
If money>1200Goto fixup
Print "But you can,t###afford medical##help...
Wait
Goto menu
Label fixup
Print "Will you pay####1000 dollars fora doctor to sew
Input youup
If youup<>1Goto menu
money=money-1000
damage=0
Label menu
ClrT
Print "1) See prices
Print "2) Trenchcoat
Print "3) Buy 4) Sell
Print "5) Go  6) Bank
Print "7) Loan shark
Input choice
c=int choice
ClrT
Print day
If c=2Goto trenchcoat
If c=3Goto buy
If c=4Goto sell
If c=5Goto go
If c=6Goto bank
If c=7Goto loan
cocaine=A[1,1]
heroin=A[2,1]
acid=A[3,1]
weed=A[4,1]
speed=A[5,1]
dexies=A[6,1]
Print cocaine
Print heroin
Print acid
Wait
Print weed
Print speed
Print dexies
Print money
Wait
Goto menu
Label trenchcoat
cocaine=A[1,2]
heroin=A[2,2]
acid=A[3,2]
weed=A[4,2]
speed=A[5,2]
dexies=A[6,2]
Print cocaine
Print heroin
Print acid
Wait
Print weed
Print speed
Print dexies
Print freespace
Wait
Goto menu
Label notenough
Print "Not enough space
Wait
Label buy
Print "1) Cocaine
Print "2) Heroin
Print "3) Acid##4) Weed
Print "5) Speed
Print "6) Dexies
Input whattobuy
w=int whattobuy
If w<1Goto buy
If w>6Goto buy
youcanafford=int (money/A[w,1])
Print youcanafford
Input howmuch
h=int howmuch
If h<0Goto buy
If h>youcanaffordGoto buy
If h>freespaceGoto notenough
ClrT
money=money-hA[w,1]
A[w,2]=A[w,2]+h
Gosub calcfree
Goto menu
Label sell
Print "1) Cocaine
Print "2) Heroin
Print "3) Acid##4) Weed
Print "5) Speed
Print "6) Dexies
Input whattosell
w=int whattosell
If w<1Goto sell
If w>6Goto sell
youhave=A[w,2]
Print youhave
Input howmuch
h=int howmuch
If h<0Goto sell
If h>youhaveGoto sell
money=money+hA[w,1]
A[w,2]=A[w,2]-h
Gosub calcfree
Goto menu
Label yourealready
Print "You are already there!
Wait
Label go
Print "1) Suicide
Print "2) Stay 3) Bronx
Print "4) Ghetto
Print "5) Central Park
Print "6) Manhatten
Print "7) Brooklyn
Input whereto
w=int whereto
If w<1Goto go
if w>7Goto go
If w=2Goto menu
If w=placeGoto yourealready
place=w
If w=1Goto end
ClrT
Print "Subway
day=day+1
debt=int (1.1debt)
bank=int (1.06bank)
Wait 1
If day=31Goto end
Goto newday
Label loanbronx
Print "The loan shark##only deals in###the Bronx.
Wait
Goto menu
Label loan
If place<>3Goto loanbronx
ClrT
Print "Loan shark
Print "1) Repay
Print "2) Borrow
Print "3) Never mind
Input choice
c=int choice
If c<1Goto loan
If c>3Goto loan
If c=3Goto menu
Label disploan
wallet=money
Print debt
Print wallet
If c=2Goto borrow
Print "Repay
Input howmuch
h=int howmuch
If h<0Goto loan
If h>moneyGoto disploan
If h>debtGoto disploan
debt=debt-h
money=money-h
Goto menu
Label toomuch
Print "You think he is crazy, man!
Wait
Goto disploan
Label borrow
Print "Borrow
Input howmuch
h=int howmuch
If f<0Goto loan
If h+debt>5%4Goto toomuch
debt=debt+h
money=money+h
Goto menu
Label bankbronx
Print "The bank is in##the Bronx.
Wait
Goto menu
Label bank
If place<>3Goto bankbronx
ClrT
Print "Bank
Print "1) View account
Print "2) Deposit
Print "3) Withdraw
Print "4) Goodbye
Input choice
c=int choice
If c<1Goto bank
If c>4Goto bank
If c=4Goto menu
Label dispbank
wallet=money
account=bank
Print account
Print wallet
Wait
If c=1Goto bank
If c=3Goto bankdraw
Print "Deposit
Input howmuch
h=int howmuch
If h>moneyGoto dispbank
If h<0Goto dispbank
moeny=money-h
bank=bank+h
Goto bank
Label bankdraw
Print "Withdraw
Input howmuch
h=int howmuch
If h>bankGoto dispbank
If h<0Goto dispbank
bank=bank-h
money=money-h
Goto bank
Label end
ClrT
Print "Game over!
Print "----------
h=bank-debt+money
h=(abs h+h)/2
outof100=int (sqrt(h)/31.5)
Print "Score
Print outof100
If outof100<=KGoto bye
Print "You got a new###high score!!
K=outof100
Label bye
Wait 5
Print "Thanks for play-ing!
Print "Have a nice day!
End
Label calcfree
freespace=tspace-A[1,2]-A[2,2]-A[3,2]-A[4,2]-A[5,2]-A[6,2]
Return
Label instruc
Print "  Drugwar Help
Print "----------------
Print "This is a game
Print "of buying and
Print "selling. Your
Print "goal is to pay
Print "off your debt to
Print "the loan shark
Wait
Print "and then make as
Print "much money as
Print "possible in a 1
Print "month period.
Wait
Print "Watch out for
Print "the police if
Print "you deal too
Print "heavily!
Wait 
Print "Prices for drugsare
Print "Cocaine 16000-
Print "##########28000
Print "Heroin 5000-
Print "##########12000
Print "Acid###1000-4400
Print "Weed####330-750
Wait
Print "Speed####70-220
Print "Dexies###10-50
Print "Generally, enter
Print "the number of
Print "what you want to
Print "do, but 1=Yes
Print "2=No
Wait
Print "The last number
Print "in the prices
Print "list is your
Print "wallet. The last
Print "number in your
Print "trenchcoat is
Print "free space.
Wait 
ClrT
Goto newday


This page is constantly under construction, so don't worry if some of the linx don't work. If you've been here before, you could also reload this page to get the latest version. This page was last modified 19th June 1999. Best viewed with Netscape Navigator at 800x600 or above. Oh yeah, and don't forget to look at the legal stuff before you copy anything.


Data Analysis AustraliaThis space has been provided by
Data Analysis Australia
Since 26/2/99, you are visitor number
Served by WebCounter