Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Please help me with my bowling project!
#1
CLS
DO
FRAME% = FRAME% + 1
ROLL2% = 0
PRINT "Frame"; FRAME%;
PRINT " - WHAT WAS YOUR FIRST SCORE FROM 1 - 10 ";
IF BONUS% <> 0 THEN PRINT "(Extra frame) "; : BONUS% = BONUS% - 1
INPUT SCORE1%

IF FLAG% = 1 AND BALL% = 2 THEN
TOTAL% = TOTAL% + STRIKE% + SCORE1%: STRIKE% = STRIKE% - 10
IF FRAME% > 10 AND BONUS% = 0 THEN EXIT DO
ELSE
BALL% = BALL% + 1
END IF

IF FLAG% = -1 THEN
TOTAL% = TOTAL% + 10 + SCORE1%
IF FRAME% > 10 AND BONUS% = 0 THEN EXIT DO
END IF

IF SCORE1% < 10 THEN
PRINT "Frame"; FRAME%;
PRINT " - WHAT WAS YOR SECOND SCORE FROM 1 -"; 10 - SCORE1%;
IF BONUS% <> 0 THEN PRINT "(Extra frame) "; : BONUS% = BONUS% - 1
INPUT SCORE2%
IF STRIKE% <> 0 THEN STRIKE% = STRIKE% + SCORE1% + SCORE2%

IF FLAG% = 1 AND BALL% = 2 THEN
TOTAL% = TOTAL% + STRIKE%: STRIKE% = STRIKE% - 10
END IF

BALL% = BALL% + 1

ELSE
STRIKE% = STRIKE% + 10
END IF

TROLL% = SCORE1% + SCORE2%

IF SCORE1% = 10 THEN

PRINT "RESULTS : STRIKE!";
FLAG% = 1
ELSEIF TROLL% = 10 THEN

PRINT "RESULTS : SPARE!";
FLAG% = -1: BALL% = 0: STRIKE% = 0
ELSE

FLAG% = 0: BALL% = 0
PRINT "RESULTS : OPEN FRAME ";
TOTAL% = TOTAL% + TROLL%: STRIKE% = 0
END IF

TOTAL1% = TROLL%
IF FRAME% = 10 AND FLAG% <> 0 THEN
IF FLAG% = -1 THEN BONUS% = 1 ELSE BONUS% = 2
END IF

PRINT " YOU TOTAL RIGHT NOW IS:"; TOTAL%
PRINT ""

IF FRAME% >= 10 AND BONUS% = 0 THEN EXIT DO





LOOP

PRINT "Your Final Score:"; TOTAL%

*****************************************************
ok this program works if i put in all 10's and gives me the correct answer but for some reason it doesnt work entirely correct

copy my program and run these test data in it

2 4 3 5 7 3 5 2 4 5 10 5 3 10 10 10 2 2

the correct answer is suppose to be 137 but it comes out as 141 also if you ran these test data in its correct

test data correct:

10 10 10 10 10 10 10 10 10 10 10 10
it equals 300 which is correct

and the following are correct too

2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3

it equals 50 and it works correctly

so please help me find out how to fix it and see how to make the first one actually work.......
eath
Reply
#2
Dude, I made a bowling program. In fact, it's one of the most popular on the site! Go to projects, then BOWLING for John. Mine is the first. Then, try Meg's, the last. I'll see if I can find a solution for yours, also.

:wink: :rotfl: :bounce: :oops: :barf:

Just make strikes worth 30 points, and spares worth 20. That always works out.
Reply
#3
ok John i would use your program but im only aloud to use

DO
UnTIL
LOOP
FOR
NEXT
IF
THEN
ELSEIF
ELSE
ENDIF
INPUT
PRINT
AND

all the others like goto and stuff like that im not aloud to use so can you pleaseeeeee!!!!! make a program only using those or could you possibly help me figure out what im doing wrong......because my stuffs not working entirely right even the part where it says my score right now isnt right.............because its suppose to print out 30 for the first one....... =(
eath
Reply
#4
DON'T TYPE IN ALL-CAPS!

Ya.. uhm.. sry about that...


And I don't know anything about bowling.

I just wish people would read the guidelines/forum rules before posting
Reply
#5
Deathman17: Please don't post multiple threads with the same topic/problem. It causes confusion and helps you less, and also please keep subject text to not all uppercase. You'll get more help with your code if you post what is wrong other than its not working and posting all the code.
Reply
#6
sorry about al lcaps but i did post my problem it works most of the time and then it wont add up right the other times if you reread it you will see ive said it already
eath
Reply
#7
what?

Please, use "commas" and "stops" Wink
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)