Skip to content

Instantly share code, notes, and snippets.

@mattmanning
Created June 1, 2011 16:09
Show Gist options
  • Save mattmanning/1002653 to your computer and use it in GitHub Desktop.
Save mattmanning/1002653 to your computer and use it in GitHub Desktop.
Drugwars for the TI-82/83/83+ Calculators
Lbl G
ClrHome
Disp " J.M.'S DRUGWAR"," SIMULATION",""," VERSION 2.00",""," JUST SAY NO."
2000→Z
5000→Y
0→V
100→K
1→B
2→N
0→I
0→J
100→T
0→M
0→N
0→O
0→P
0→Q
0→R
Pause
ClrHome
Disp "","ORIGINAL GAME","FOR IBM BY:"," JOHN E. DELL",""
Disp "INSTRUCTIONS?"
Input "(1=YES,2=NO)",X
If X=1
Then
ClrHome
Disp "THIS IS A GAME","OF BUYING AND","SELLING. YOUR","GOAL IS TO PAY-","OFF YOUR DEBT TO","THE LOAN SHARK,","AND THEN MAKE AS"
Pause
ClrHome
Disp "MUCH MONEY AS","POSSIBLE IN A 1","MONTH PERIOD.","WATCH-OUT FOR","THE POLICE IF","YOU DEAL TOO","HEAVILY!"
Pause
ClrHome
Disp "PRICES FOR DRUGS","ARE:","COCAINE:","15000-28000","HEROINE:","5000-12000","ACID: 1000-4200"
Pause
Disp "WEED: 300-720","SPEED: 70-220","LUDES: 10-50"
Pause
ClrHome
Disp "GENERALY, TYPE","THE FIRST LETTER","OF WHAT YOU WANT","TO DO, I.E.:","W=WEED, L=LUDES","ETC..."
Pause
Disp "BUT, 1=YES AND","2=NO"
Pause
ClrHome
Disp "THE LAST NUMBER","IN THE PRICES","LIST IS YOUR","WALLET. THE LAST","NUMBER IN YOUR","TRENCHCOAT IS","FREE SPACE."
Pause
End
Lbl θ
round(rand*12000+16000,0)→C
round(rand*7000+5000,0)→H
round(rand*34+10,0)*100→A
round(rand*42+33,0)*10→W
round(rand*15+7,0)*10→S
round(rand*4+1,0)*10→L
round(rand*20,0)→D
If D=1
Then
ClrHome
Disp "RIVAL DEALERS","ARE SELLING","CHEAP LUDES!!!"
Pause
2→L
End
If D=2
Then
ClrHome
Disp "WEED PRICES HAVE","BOTTOMED-OUT!!!"
Pause
122→W
End
If D=3
Then
ClrHome
Disp "PIGS ARE SELLING","CHEAP HEROINE","FROM LAST WEEK'S","RAID!!!!"
Pause
rand→H
(850+(H*1150))→H
(int(H)→H
End
If D=4 or D=5
Then
ClrHome
Disp "ADDICTS ARE","BUYING HEROINE","AT OUTRAGEOUS","PRICES!!!"
Pause
rand→H
(18000+(H*25000))→H
(int(H)→H
End
If D=6 or D=7
Then
ClrHome
Disp "PIGS MADE A BIG","COKE BUST!","PRICES ARE","OUTRAGEOUS!!!!"
Pause
rand→C
(80000+(C*60000))→C
(int(C)→C
End
If D=8
Then
ClrHome
Disp "YOU WERE MUGGED","IN THE SUBWAY!"
Pause
(Z/3)→Z
(int(Z)→Z
(Z*2)→Z
End
If D=15 and Z≥300
Then
ClrHome
Disp "WILL YOU BUY A","NEW TRENCHCOAT","WITH MORE","POCKETS FOR 200","BUCKS?"
Input X
If X=1
Then
(T+10)→T
(T-M-N-O-P-Q-R)→K
(Z-200)→Z
End
End
If D=14
Then
ClrHome
Disp "THERE'S SOME","WEED HERE THAT","SMELLS LIKE GOOD","STUFF!!"
Pause
Disp "WILL YOU SMOKE"
Input "IT?",X
If X=1
Then
ClrHome
Disp "YOU HALLUCINATE","ON THE WILDEST","TRIP OF YOUR","LIFE,"
Pause
Disp "STUMBLE ON TO","THE SUBWAY","TRACKS AND GET","CREAMED BY A","TRAIN."
Pause
ClrHome
Disp "JUST SAY NO TO","DRUGS."
Pause
Goto C
End
End
If Z≥500 and K≥5
Then
If D=12 or D=13
Then
ClrHome
Disp "WILL YOU BUY A"
round(rand*2,0)→X
If X=0
Disp "BARRETTA"
If X=1
Disp "SATURDAY NIGHT","SPECIAL"
If X=2
Disp ".44 MAGNUM"
Disp "FOR 400 DOLLARS?"
Input X
If X=1
Then
(I+1)→I
(Z-400)→Z
(T-5)→T
(T-M-N-O-P-Q-R)→K
End
End
End
If D=16 and K≥8
Then
int((rand*7+1)→F
ClrHome
Disp "YOU FOUND:",F,"UNITS OF:"
int((rand*5)→X
If X=0
Then
Disp " LUDES"
(R+F)→R
End
If X=1
Then
Disp " SPEED"
(Q+F)→Q
End
If X=2
Then
Disp " WEED"
(P+F)→P
End
If X=3
Then
Disp " ACID"
(O+F)→O
End
If X=4
Then
Disp " HEROINE"
(N+F)→N
End
If X=5
Then
Disp " COCAINE"
(M+F)→M
End
Disp "ON A DEAD DUDE","IN THE SUBWAY!!!"
(T-M-N-O-P-Q-R)→K
Pause
Goto A
End
If D=17
Then
ClrHome
Disp "THE MARKET HAS","BEEN FLOODED","WITH CHEAP HOME-","MADE ACID!!!!"
int((250+(rand*550))→A
Pause
Goto A
End
If D=9 or D=10 or D=11
Then
If (M+N+O+P+Q+R)≥50
Then
ClrHome
If D=9
1→D
If D=10
3→D
If D=11
4→D
Disp "OFFICER HARDASS","AND",D,"OF HIS DEPPUTIES","ARE AFTER YOU!"
Pause
ClrHome
Lbl M
Menu("BEING CHASED!!","VIEW GUNS",H,"VIEW DAMMAGE",I,"NUMBER OF PIGS",J,"RUN",K,"FIGHT",L)
Lbl H
ClrHome
Disp "NUMBER OF GUNS","YOU HAVE:"
Disp I
Pause
Goto M
Lbl I
ClrHome
Disp "YOUR DAMMAGE="
Disp J
Disp "(50 DAMMAGE AND","YOU DIE!)"
Pause
Goto M
Lbl J
ClrHome
Disp "THERE ARE:"
(D+1)→D
Disp D
(D-1)→D
Disp "PIGS STILL","CHASING YOU!"
Pause
Goto M
Lbl K
ClrHome
Disp "","","",""," RUNNING"
round(rand*1,0)→X
If X=0
Then
ClrHome
Disp "YOU LOST THEM IN","AN ALLEY!!"
Pause
If B=31
Then
Goto A
Else
Goto θ
End
End
If X=1
Then
ClrHome
Disp "YOU CAN'T SHAKE","THEM!"
Pause
Goto O
End
Lbl L
If I=0
Then
ClrHome
Disp "YOU DON'T HAVE","ANY GUNS!"
Pause
Disp "YOU HAVE TO RUN!"
Pause
Goto M
Else
round(rand*1,0)→X
If X=0
Then
ClrHome
Disp "YOU MISSED!!!"
Pause
Else
ClrHome
Disp "YOU KILLED ONE!!"
Pause
(D-1)→D
If D=(-1)
Goto N
End
Lbl O
round(rand*1,0)→X
ClrHome
Disp "THEY'RE FIRING","AT YOU!!"
If X=0
Then
Disp "THEY MISSED!!"
Pause
Goto M
Else
Disp "YOU'VE BEEN HIT!"
(J+3)→J
Pause
If J≥50
Then
Disp "YOU'VE BEEN ","KILLED!!"
Pause
Goto C
End
Goto M
End
Lbl N
ClrHome
Disp "YOU KILLED ALL","OF THEM!"
int((rand*1250+750)→X
(Z+X)→Z
Pause
Disp "YOU FOUND"
Disp X
Disp "DOLLARS ON","OFFICER HARDASS'","CARCASS!!"
Pause
If Z≥1200
Then
ClrHome
Disp "WILL YOU PAY","1000 DOLLARS FOR","A DOCTOR TO SEW","YOU UP?"
Input X
If X=1
Then
(Z-1000)→Z
0→J
End
End
End
End
End
Lbl A
ClrHome
Menu("DRUGWAR!","SEE PRICES",1,"TRENCHCOAT",2,"BUY",3,"SELL",4,"JET",5,"SEE LOAN SHARK",6,"VISIT BANK",7)
Lbl 1
ClrHome
Disp C,H,A,W,S,L,Z
Output(1,1,"COCAINE")
Output(2,1,"HEROINE")
Output(3,1,"ACID")
Output(4,1,"WEED")
Output(5,1,"SPEED")
Output(6,1,"LUDES")
Output(7,1,"WALLET")
Pause
Goto A
Lbl 2
ClrHome
Disp M,N,O,P,Q,R,K
Output(1,1,"COCAINE")
Output(2,1,"HEROINE")
Output(3,1,"ACID")
Output(4,1,"WEED")
Output(5,1,"SPEED")
Output(6,1,"LUDES")
Output(7,1,"FREE SPACE")
Pause
Goto A
Lbl 3
ClrHome
Disp "DAY NUMBER:",B
Input "WHAT TO BUY?",F
If F≠C and F≠H and F≠A and F≠W and F≠S and F≠L
Goto 3
int((Z/F)→E
Disp "HOW MUCH?","YOU CAN AFFORD:",E,"YOU CAN HOLD:",K
Input G
If G>K or G<0 or G>E
Goto 3
(Z-(FG))→Z
If F=C
(M+G)→M
If F=H
(N+G)→N
If F=A
(O+G)→O
If F=W
(P+G)→P
If F=S
(Q+G)→Q
If F=L
(R+G)→R
(T-M-N-O-P-Q-R)→K
Goto A
Lbl 4
ClrHome
Disp "DAY NUMBER:",B
Input "WHAT TO SELL?",F
If F≠C and F≠H and F≠A and F≠W and F≠S and F≠L
Goto 4
If F=C
M→E
If F=H
N→E
If F=A
O→E
If F=W
P→E
If F=S
Q→E
If F=L
R→E
Disp "HOW MUCH?","YOU HAVE:",E
Input G
If G>E or G<0
Goto 4
If F=C
(M-G)→M
If F=H
(N-G)→N
If F=A
(O-G)→O
If F=W
(P-G)→P
If F=S
(Q-G)→Q
If F=L
(R-G)→R
(Z+FG)→Z
(T-M-N-O-P-Q-R)→K
Goto A
Lbl 5
ClrHome
Menu("WHERE TO, DUDE?","BRONX",R,"GHETTO",B,"CENTRAL PARK",B,"MANHATTEN",B,"CONEY ISLAND",B,"BROOKLYN",B,"OOPS... STAY!",A)
Lbl R
If N=2
Then
ClrHome
Disp "YOU'RE ALREADY","IN THE BRONX!"
Pause
Goto 5
End
2→N
Goto S
Lbl B
1→N
Lbl S
ClrHome
Disp "","","",""," SUBWAY"
(B+1)→B
int((Y*1.1)→Y
int((V*1.06)→V
If B=31
Goto C
Goto θ
Lbl 6
If N=1
Then
ClrHome
Disp "THE LOAN SHARK","ONLY DEALS IN","THE BRONX."
Pause
Goto A
End
ClrHome
Menu("LOAN SHARK...","REPAY",P,"BORROW",Q)
Lbl P
ClrHome
Disp "YOU'RE DEBT IS:",Y,"YOUR WALLET=",Z,"REPAY HOW MUCH?"
Input F
If F>Z or F<0 or F>Y
Goto 6
(Y-F)→Y
(Z-F)→Z
Goto A
Lbl Q
ClrHome
Disp "YOUR DEBT=",Y,"YOUR WALLET=",Z,"BORROW HOW MUCH"
Input "MORE?",F
If F>5000
Then
ClrHome
Disp "YOU THINK HE'S","CRAZY, MAN?!"
Pause
Goto Q
End
If F<0
Goto 6
(Y+F)→Y
(Z+F)→Z
Goto A
Lbl 7
If N=1
Then
ClrHome
Disp "THE BANK IS IN","THE BRONX."
Pause
Goto A
End
Menu(" BANK ","VIEW ACCOUNT",D,"DEPOSIT",E,"WITHDRAW",F,"GOODBYE",A)
Lbl D
ClrHome
Disp "YOUR ACCOUNT=",V
Pause
Goto 7
Lbl E
ClrHome
Disp "HOW MUCH TO","DEPOSIT?","YOU HAVE:",Z
Input G
If G>Z or G<0
Goto E
(V+G)→V
(Z-G)→Z
Goto 7
Lbl F
ClrHome
Disp "HOW MUCH TO","WITHDRAW?","ACCOUNT=",V
Input X
If X>V or X<0
Goto F
(V-X)→V
(Z+X)→Z
Goto 7
Lbl C
ClrHome
Disp " GAME OVER!"
(V+Z-Y)→V
If V<0
Then
0→V
Else
(√(V/31.5)→V
If V>100
100→V
End
round(V,0)→V
Disp "YOUR SCORE (ON A","SCALE OF 1 TO","100)=",V,""
Pause
Input "PLAY AGAIN?",V
If V=1
Goto G
ClrHome
Disp " THANKS FOR"," PLAYING!"
Pause
ClrHome
Disp "","","REMEMBER:","","WATCH YOUR BACK."
Pause
Disp "","HAVE A NICE DAY!"
@ileathan
Copy link

ileathan commented Dec 28, 2023

This was my era during high school and loved playing this game. I have found a TI-83 and a unit-to-unit cable. Is there an easy way to download this game as i would love it for the mancave. Help would be appreciated

Here is a .8xp file that I made using TI-Coder with the above code https://t7.vc/dl/DRUGWARS.8xp

You could use "TI CONNECT" (need TI-83 to USB adaptor) to push it onto your calculator.

@darth-crunchus
Copy link

darth-crunchus commented Jan 6, 2024

This was my era during high school and loved playing this game. I have found a TI-83 and a unit-to-unit cable. Is there an easy way to download this game as i would love it for the mancave. Help would be appreciated

Here is a .8xp file that I made using TI-Coder with the above code https://t7.vc/dl/DRUGWARS.8xp

You could use "TI CONNECT" (need TI-83 to USB adaptor) to push it onto your calculator.

The only thing you have to watch out for is, after you get it on your calculator, you need to go into the BASIC editor and modify the conditional blocks in Lbl 3 and Lbl 4; TI-Coder apparently doesn't like inequality symbols, as they appear as like weird floating commas? instead of =/=, and some of the "F"s in those Lbls are displayed as "f"s, which is also going to cause errors. Everything else seems fine, though I haven't enountered many of the game's random encounters yet. Also, in the 23 years I've been messing around with TI-BASIC, I never knew you could pass alphanumeric characters to normal variables using Input commands. I was under the impression they HAD to contain numbers and numbers only. Or is it that when you answer a numeric input with a letter, what you're actually doing is transferring the value contained in that variable to the receiving variable?

@ileathan
Copy link

ileathan commented Jan 6, 2024

Maybe I misunderstood but the code never passes alphanumeric characters as input but you can, it treats them as a variable length string I would use them to store usernames or even entire phonebook program with 1 variable lol.

@darth-crunchus
Copy link

Yeah, it appears that it just dumps the values stored in C, H, A, W, S, and L into the prompt behind the scenes. Still a neat feature. I've been messing with this for the past couple of weeks, and I've gotten it working completely on my TI-84 Plus CE, even adding a couple random encounters back in, namely the police dogs encounter and the brownies encounter, and restored a few things like random pricing to guns and trench coat upgrades, and even the random size to how much extra storage each trench coat gives you, and added the fourth gun back in. It's up to 6310B, but hey, still not as big as Pimp Quest lol That's still got a good half KB over this.

@DenverGamer
Copy link

Hello, I have no idea what I am doing. Can someone help me play this on TI-82? Trying to create the file

@DrChorizaso
Copy link

Can some one please help i got the game to show up it runs and all but every time to go to buy or sell i type W and as soon as i hit enter it kicks me back to mirage

@SmarterJoker
Copy link

Yeah, it appears that it just dumps the values stored in C, H, A, W, S, and L into the prompt behind the scenes. Still a neat feature. I've been messing with this for the past couple of weeks, and I've gotten it working completely on my TI-84 Plus CE, even adding a couple random encounters back in, namely the police dogs encounter and the brownies encounter, and restored a few things like random pricing to guns and trench coat upgrades, and even the random size to how much extra storage each trench coat gives you, and added the fourth gun back in. It's up to 6310B, but hey, still not as big as Pimp Quest lol That's still got a good half KB over this.

I know this is a while back, but do you still have the 8x file of this? Please let me know, thanks.

@darth-crunchus
Copy link

Yeah, it appears that it just dumps the values stored in C, H, A, W, S, and L into the prompt behind the scenes. Still a neat feature. I've been messing with this for the past couple of weeks, and I've gotten it working completely on my TI-84 Plus CE, even adding a couple random encounters back in, namely the police dogs encounter and the brownies encounter, and restored a few things like random pricing to guns and trench coat upgrades, and even the random size to how much extra storage each trench coat gives you, and added the fourth gun back in. It's up to 6310B, but hey, still not as big as Pimp Quest lol That's still got a good half KB over this.

I know this is a while back, but do you still have the 8x file of this? Please let me know, thanks.

Sorry it's taken so long to reply, but yes! I do I actual;ly just updated it today. I kinda went a little overboard...it's now up to 11429B. I've been busy, trying to get it as close to the DOS original as I can, including random seeding of the rand( function. Here's a plain-text version: https://pastebin.com/4dUuw0BR . It may or may not preserve the signing for the negative ints

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment