Skip to content

Instantly share code, notes, and snippets.

@eamonnbell
Created August 28, 2013 03:00
Show Gist options
  • Save eamonnbell/6361690 to your computer and use it in GitHub Desktop.
Save eamonnbell/6361690 to your computer and use it in GitHub Desktop.
DBZ.BAS, possibly the earliest computer program I ever worked on back in (no troll) primary school. QBASIC
acrd = 250
bcrd = 250
4676 CLS
PRINT "LadBroken - Betting Xtreme - Planet Namik Special!"
PRINT
INPUT "Better 1 : ", nba$
INPUT "Better 2 : ", nbb$
PRINT nba$; " : Credit E"; acrd
INPUT "How much do you want do bet? ", amnt
INPUT "Who do you want to bet on? P 1 - 2 : ", aper
PRINT "Thanks...Next better!"
acrd = acrd - amnt
pool = pool + amnt
PRINT nbb$; " : Credit E"; bcrd
INPUT "How much do you want do bet? ", bmnt
INPUT "Who do you want to bet on? P 1 - 2 : ", bper
PRINT "Thanks..."
bcrd = bcrd - bmnt
pool = pool + bmnt
PRINT "The heat is on...!"
SLEEP 2
ahealth = 100
bhealth = 100
anrg = 100
bnrg = 100
CLS
COLOR 15
PRINT " ***** DragonBallZ *****"
VIEW PRINT 2 TO 24
PRINT
PRINT
INPUT "Player 1 : ", pa$
INPUT "Player 2 : ", pb$
CLS
PRINT pa$; " and "; pb$
PRINT "you need 50 energy + 10 health to attack. Attacks will take a"
PRINT "random amount of health off the opponent.You need 75 energy + 5 health to defend"
PRINT "Defending will add 45 health to you. You will receive 10 energy per turn."
PRINT "You can survive without energy. The winner is the player who either has :"
PRINT " * The most health after 45 turns"
PRINT " * Beaten the other player from his health"
PRINT "You start with : 100 health and 100 energy each..."
PRINT "Tip : The size of your attack gives you a clue to the amount of damage!"
PRINT "Press Ctrl..."
SLEEP
CLS
COLOR 15
PRINT " "; pa$; " vs. "; pb$
PRINT
VIEW PRINT 3 TO 24
1 CLS
COLOR 15
trn = trn + 1
IF ahealth <= 0 THEN winner$ = pb$: win = 2: GOTO 45
IF bhealth <= 0 THEN winner$ = pa$: win = 1: GOTO 45
IF trn = 45 THEN
IF ahealth > bhealth THEN winner$ = pa$: win = 1 ELSE winner$ = pb$: win = 2: GOTO 45
END IF
PRINT " Turn"; trn
PRINT
PRINT ; " "; pa$
PRINT " Health : "; ahealth
PRINT " Energy : "; anrg; ""
LOCATE 5, 55
PRINT ; pb$
LOCATE 6, 55
PRINT "Health : "; bhealth
LOCATE 7, 55
PRINT "Energy : "; bnrg
PRINT
PRINT pa$; "'s go...Do you want to"
INPUT "(A)ttack or (D)efend or (W)ait? ", aod$
SELECT CASE UCASE$(aod$)
CASE IS = "D"
IF ahealth < 5 OR anrg < 75 OR (ahealth < 5 AND anrg < 75) THEN PRINT "Not Enough Energy!": SLEEP 3: GOTO 2
PRINT "Using Resources..."
anrg = anrg - 75
ahealth = ahealth - 5
SLEEP 2
PRINT "Defending..."
ahealth = ahealth + 45
SLEEP 3
CLS
SCREEN 2
SHELL "type pdef"
FOR i = 1 TO 200 STEP 4
CIRCLE (300, 100), i
PLAY "p64"
NEXT i
FOR i = 200 TO 1 STEP -4
CIRCLE (300, 100), i, 0
PLAY "p64"
NEXT i
SLEEP 2
SCREEN 0
COLOR 15
PRINT " ***** DragonBallZ *****"
PRINT " "; pa$; " vs. "; pb$
PRINT
VIEW PRINT 3 TO 24
PRINT
PRINT
PRINT ; " "; pa$
PRINT " Health : "; ahealth
PRINT " Energy : "; anrg; ""
LOCATE 5, 55
PRINT ; pb$
LOCATE 6, 55
PRINT "Health : "; bhealth
LOCATE 7, 55
PRINT "Energy : "; bnrg
PRINT
SLEEP
CASE IS = "A"
'This is Player1's attack seq
IF ahealth < 10 OR anrg < 50 OR (ahealth < 10 AND anrg < 50) THEN PRINT "Not Enough Energy!": SLEEP 3: GOTO 2
PRINT "Using Resources..."
anrg = anrg - 50
ahealth = ahealth - 5
SLEEP 2
PRINT "Attacking..."
RANDOMIZE TIMER
f = INT(RND * 98) + 1
bhealth = bhealth - f
SLEEP 3
CLS
SCREEN 8
SHELL "type pdef"
LOCATE 13, 40
COLOR 4
FOR i = 15 TO 7 STEP -1
LOCATE i, 33
PRINT "��"
LOCATE i, 44
PRINT "��"
PLAY "p64"
NEXT i
FOR i = 15 TO 7 STEP -1
LOCATE i, 33
PRINT " "
LOCATE i, 44
PRINT " "
PLAY "p64"
NEXT i
FOR i = 1 TO f STEP 2
CIRCLE (310, 40), i, 1
PLAY "p64"
NEXT i
PRINT f; "% Damage"
SLEEP 2
SCREEN 0
COLOR 15
PRINT " ***** DragonBallZ *****"
PRINT " "; pa$; " vs. "; pb$
PRINT
VIEW PRINT 3 TO 24
CLS
SLEEP
PRINT
PRINT
PRINT ; " "; pa$
PRINT " Health : "; ahealth
PRINT " Energy : "; anrg; ""
LOCATE 5, 55
PRINT ; pb$
LOCATE 6, 55
PRINT "Health : "; bhealth
LOCATE 7, 55
PRINT "Energy : "; bnrg
PRINT
SLEEP
CASE ELSE
END SELECT
2 LOCATE 9, 47
PRINT pb$; ;
PRINT "'s go...Do you want to"
LOCATE 10, 47
INPUT "(A)ttack or (D)efend or (W)ait? ", aod$
SELECT CASE UCASE$(aod$)
CASE IS = "D"
IF bhealth < 5 OR bnrg < 75 OR (bhealth < 5 AND bnrg < 75) THEN LOCATE 11, 55: PRINT "Not Enough Energy!": SLEEP 3: GOTO 409
LOCATE 11, 55
PRINT "Using Resources..."
bnrg = bnrg - 75
bhealth = bhealth - 5
SLEEP 2
LOCATE 12, 55
PRINT "Defending..."
bhealth = bhealth + 45
SLEEP 3
CLS
SCREEN 2
SHELL "type pdef"
FOR i = 1 TO 200 STEP 4
CIRCLE (300, 100), i
PLAY "p64"
NEXT i
FOR i = 200 TO 1 STEP -4
CIRCLE (300, 100), i, 0
PLAY "p64"
NEXT i
CLS
SHELL "type pdef"
SLEEP 2
SCREEN 0
COLOR 15
PRINT " ***** DragonBallZ *****"
PRINT " "; pa$; " vs. "; pb$
PRINT
VIEW PRINT 3 TO 24
PRINT
PRINT
PRINT ; " "; pa$
PRINT " Health : "; ahealth
PRINT " Energy : "; anrg; ""
LOCATE 5, 55
PRINT ; pb$
LOCATE 6, 55
PRINT "Health : "; bhealth
LOCATE 7, 55
PRINT "Energy : "; bnrg
PRINT
SLEEP
CASE IS = "A"
'This is player2's attack seq
IF bhealth < 10 OR bnrg < 50 OR (bhealth < 10 AND bnrg < 50) THEN PRINT "Not Enough Energy!": SLEEP 3: GOTO 409
LOCATE 11, 55
PRINT "Using Resources..."
bnrg = bnrg - 50
bhealth = bhealth - 5
SLEEP 2
LOCATE 12, 55
PRINT "Attacking..."
RANDOMIZE TIMER
f = INT(RND * 98) + 1
ahealth = ahealth - f
SLEEP 3
CLS
SCREEN 8
SHELL "type pdef"
LOCATE 13, 40
COLOR 4
FOR i = 15 TO 7 STEP -1
LOCATE i, 33
PRINT "��"
LOCATE i, 44
PRINT "��"
PLAY "p64"
NEXT i
FOR i = 15 TO 7 STEP -1
LOCATE i, 33
PRINT " "
LOCATE i, 44
PRINT " "
PLAY "p64"
NEXT i
FOR i = 1 TO f STEP 2
CIRCLE (310, 40), i, 1
PLAY "p64"
NEXT i
PRINT f; "% Damage"
SLEEP 2
SCREEN 0
COLOR 15
PRINT " ***** DragonBallZ *****"
PRINT " "; pa$; " vs. "; pb$
PRINT
VIEW PRINT 3 TO 24
CLS
PRINT
PRINT
PRINT ; " "; pa$
PRINT " Health : "; ahealth
PRINT " Energy : "; anrg; ""
LOCATE 5, 55
PRINT ; pb$
LOCATE 6, 55
PRINT "Health : "; bhealth
LOCATE 7, 55
PRINT "Energy : "; bnrg
PRINT
SLEEP
CASE ELSE
END SELECT
SLEEP
409 CLS
PRINT "Adding energy for next turn..."
anrg = anrg + 10
bnrg = bnrg + 10
SLEEP 3
COLOR 15
GOTO 1
45 CLS
PRINT
PRINT " I declare this DBZ match offically...over!"
PRINT " The winner is : "; winner$; "!"
PRINT " Now to the dirty work..."
PRINT
PRINT "BETTING � BETTING � BETTING � BETTING � BETTING � BETTING � BETTING � BETTING"
PRINT
PRINT "The winner is Player"; win
PRINT "The pool is E"; pool
IF win = aper THEN
PRINT "Winner of the bet is..."; nba$
PRINT "You get 100% of the pool!"
acrd = acrd + pool
PRINT "Credit for "; nba$; " E"; acrd
END IF
IF win = bper THEN
PRINT "Winner of the bet is..."; nbb$
PRINT "You get 100% of the pool!"
PRINT "Credit for "; nbb$; " E"; bcrd
acrd = acrd + pool
END IF
IF win = aper AND win = bper THEN
PRINT "Winner of the bet is..."; nba$; "+"; nbb$
PRINT "You get 50% of the pool each!"
acrd = acrd + pool / 2
bcrd = bcrd + pool / 2
PRINT "Credit for "; nba$; " E"; acrd
PRINT "Credit for "; nbb$; " E"; bcrd
END IF
INPUT "Another Bet Sirs? ", anb$
IF anb$ = "Y" OR anb$ = "y" THEN 4676
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment