need help on a program
Posted: Sun Jul 20, 2003 10:21 pm
I'm having a litte problem with my program, here's the code I'm using... I'm somewhat of a beginner, I'm not that professional, I don't care if people think I should go about this differently. My problem is that when I try to run this, my QB compiler highlights DUMMYHP and has an error message that says "duplicate label!" could someone explain what this problem is, why it's there and how to fix it?
1 CLS
2 RESTORE
3 COLOR 0, 0
4 PRINT "."
PRINT "."
PRINT "." 'THESE ARE FOR TAKING UP PUTING THE TEXT BELOW LOWER ON THE SCREEN
PRINT "."
PRINT "."
COLOR 15, 0
10 PRINT " WELCOME TO BOXING TRAINING"
PRINT ""
20 PRINT " PRESS SELECT BUTTONS TO FIGHT THE BALOON DUMMY"
PRINT ""
30 PRINT " PRESS RETURN"
35 SLEEP
PRINT ""
40 PRINT " 'L' FOR LEFTHOOK, 'R' FOR RIGHT HOOK, 'U' FOR UPPERCUT,"
PRINT ""
50 PRINT " AND 'S' FOR A KNUCKLE SANDWHICH"
55 SLEEP
PRINT ""
60 PRINT " EACH DOES A CONSTANTLY RANDOM NUMBER OF DAMAGE"
PRINT ""
70 PRINT " PRESS Q TWICE TO QUIT"
75 SLEEP
PRINT ""
80 PRINT " THE DUMMY HAS LOTS OF DURABILITY, SO IT MIGHT TAKE A WHILE,"
PRINT ""
90 PRINT " KEEP ON TRYING"
PRINT ""
100 PRINT " READY???"
SLEEP
PRINT ""
110 PRINT " GO!!!"
490 LET DUMMYHP = 800
500 DO
520 PRINT
530 BUTTON$ = INKEY$
540 SELECT CASE BUTTON$
550 CASE L
DAMAGE = INT(RND * 40) + 20
IF DAMAGE >= 50 THEN PRINT "KAPOW!!!"
IF DAMAGE <= 30 THEN PRINT "BOP!"
IF DAMAGE >= 29 AND DAMAGE <= 51 THEN PRINT "WHAM!!"
DUMMYHP -DAMAGE
PRINT "DUMMY CURRENTLY HAS "; DUMMYHP; " HP LEFT"
560 CASE R
DAMAGE = INT(RND * 25) + 30
IF DAMAGE >= 50 THEN PRINT "KAPOW!!!"
IF DAMAGE <= 30 THEN PRINT "BOP!"
IF DAMAGE >= 29 AND DAMAGE <= 51 THEN PRINT "WHAM!!"
DUMMYHP -DAMAGE
PRINT "DUMMY CURRENTLY HAS "; DUMMYHP; " HP LEFT"
570 CASE U
DAMAGE = INT(RND * 10) + 40
IF DAMAGE >= 50 THEN PRINT "KAPOW!!!"
IF DAMAGE <= 30 THEN PRINT "BOP!"
IF DAMAGE >= 29 AND DAMAGE <= 51 THEN PRINT "WHAM!!"
DUMMYHP -DAMAGE
PRINT "DUMMY CURRENTLY HAS "; DUMMYHP; " HP LEFT"
580 CASE S
DAMAGE = INT(RND * 70) + 1
IF DAMAGE >= 50 THEN PRINT "KAPOW!!!"
IF DAMAGE <= 30 THEN PRINT "BOP!"
IF DAMAGE >= 29 AND DAMAGE <= 51 THEN PRINT "WHAM!!"
DUMMYHP -DAMAGE
PRINT "DUMMY CURRENTLY HAS "; DUMMYHP; " HP LEFT"
590 END SELECT
IF DUMMYHP <= 1 THEN GOTO 710
700 LOOP UNTIL (UCASE$(BUTTON$) = "Q")
705 GOTO 720
710 PRINT "YOU WON!!!!!!!"
720 END
1 CLS
2 RESTORE
3 COLOR 0, 0
4 PRINT "."
PRINT "."
PRINT "." 'THESE ARE FOR TAKING UP PUTING THE TEXT BELOW LOWER ON THE SCREEN
PRINT "."
PRINT "."
COLOR 15, 0
10 PRINT " WELCOME TO BOXING TRAINING"
PRINT ""
20 PRINT " PRESS SELECT BUTTONS TO FIGHT THE BALOON DUMMY"
PRINT ""
30 PRINT " PRESS RETURN"
35 SLEEP
PRINT ""
40 PRINT " 'L' FOR LEFTHOOK, 'R' FOR RIGHT HOOK, 'U' FOR UPPERCUT,"
PRINT ""
50 PRINT " AND 'S' FOR A KNUCKLE SANDWHICH"
55 SLEEP
PRINT ""
60 PRINT " EACH DOES A CONSTANTLY RANDOM NUMBER OF DAMAGE"
PRINT ""
70 PRINT " PRESS Q TWICE TO QUIT"
75 SLEEP
PRINT ""
80 PRINT " THE DUMMY HAS LOTS OF DURABILITY, SO IT MIGHT TAKE A WHILE,"
PRINT ""
90 PRINT " KEEP ON TRYING"
PRINT ""
100 PRINT " READY???"
SLEEP
PRINT ""
110 PRINT " GO!!!"
490 LET DUMMYHP = 800
500 DO
520 PRINT
530 BUTTON$ = INKEY$
540 SELECT CASE BUTTON$
550 CASE L
DAMAGE = INT(RND * 40) + 20
IF DAMAGE >= 50 THEN PRINT "KAPOW!!!"
IF DAMAGE <= 30 THEN PRINT "BOP!"
IF DAMAGE >= 29 AND DAMAGE <= 51 THEN PRINT "WHAM!!"
DUMMYHP -DAMAGE
PRINT "DUMMY CURRENTLY HAS "; DUMMYHP; " HP LEFT"
560 CASE R
DAMAGE = INT(RND * 25) + 30
IF DAMAGE >= 50 THEN PRINT "KAPOW!!!"
IF DAMAGE <= 30 THEN PRINT "BOP!"
IF DAMAGE >= 29 AND DAMAGE <= 51 THEN PRINT "WHAM!!"
DUMMYHP -DAMAGE
PRINT "DUMMY CURRENTLY HAS "; DUMMYHP; " HP LEFT"
570 CASE U
DAMAGE = INT(RND * 10) + 40
IF DAMAGE >= 50 THEN PRINT "KAPOW!!!"
IF DAMAGE <= 30 THEN PRINT "BOP!"
IF DAMAGE >= 29 AND DAMAGE <= 51 THEN PRINT "WHAM!!"
DUMMYHP -DAMAGE
PRINT "DUMMY CURRENTLY HAS "; DUMMYHP; " HP LEFT"
580 CASE S
DAMAGE = INT(RND * 70) + 1
IF DAMAGE >= 50 THEN PRINT "KAPOW!!!"
IF DAMAGE <= 30 THEN PRINT "BOP!"
IF DAMAGE >= 29 AND DAMAGE <= 51 THEN PRINT "WHAM!!"
DUMMYHP -DAMAGE
PRINT "DUMMY CURRENTLY HAS "; DUMMYHP; " HP LEFT"
590 END SELECT
IF DUMMYHP <= 1 THEN GOTO 710
700 LOOP UNTIL (UCASE$(BUTTON$) = "Q")
705 GOTO 720
710 PRINT "YOU WON!!!!!!!"
720 END