EXAPUNKS

EXAPUNKS

View Stats:
Am I doing my math wrong?
So On the xtreme league baseball, the level wants you to do this:

score = (BA + ZA + APB) / 3 + (WRT * OI) / OD + (PC - PS) * 20

Now I have a solution the works for all 100 tests except for the second one (at least I think it works for all the others, after it passes the test it resets to test 1 and goes through the cycle to test all).

Now am I just getting lucky and just doing the math wrong this entire time?

here is my code:
LINK 800 REPL SENDPLAYERSNUMBS LINK -1 MAKE DROP MAKE COPY -9999 F DROP MARK PLAYERRECEIVESTART GRAB 400 MARK PLAYERRECEIVE COPY M X COPY X F TEST X = -9999 FJMP PLAYERRECEIVE SEEK -1 VOID F DROP MARK PLAYERNUMSEND GRAB 400 TEST EOF TJMP ALLDONE COPY F M SEEK -1 VOID F DROP MARK RECEIVESTART GRAB 401 TEST F = -9999 TJMP FIRSTRECEIVE SEEK -1 COPY M X TEST X > F TJMP REPLACERESTART VOID M DROP JUMP PLAYERNUMSEND MARK FIRSTRECEIVE SEEK -9999 COPY M F COPY M F DROP JUMP PLAYERNUMSEND MARK REPLACERESTART SEEK -9999 VOID F VOID F COPY X F COPY M F DROP JUMP PLAYERNUMSEND MARK SENDPLAYERSNUMBS GRAB 199 MARK NUMBSLOOP TEST EOF TJMP PLAYERTESTSTART COPY F M JUMP NUMBSLOOP MARK PLAYERTESTSTART COPY -9999 M DROP MARK PLAYERTEST GRAB M SEEK 1 COPY F X ADDI X F X ADDI X F X DIVI X 3 X COPY F T MULI T F T ADDI X T X DIVI X F X COPY F T SUBI T F T ADDI X T X MULI X 20 X COPY X M SEEK -9999 COPY F M DROP JUMP PLAYERTEST MARK ALLDONE COPY -9999 M WIPE GRAB 401 VOID F DROP HALT


Note there's only 1 EXA.
< >
Showing 1-3 of 3 comments
You're adding (WRT * OI) to (BA + ZA + APB) / 3 before dividing by OD. Same with adding (PC - PS) to all previos before multiplying by 20.
Originally posted by Nick:
You're adding (WRT * OI) to (BA + ZA + APB) / 3 before dividing by OD. Same with adding (PC - PS) to all previos before multiplying by 20.


Okay so it "should" look something like this then if i am understanding correctly Right?

((BA + ZA + APB) / 3) + ((WRT * OI) / OD) + ((PC - PS) * 20)
Ayup. "division and multiplication go before addition and substraction" in case the parentheses don't explain the scope.
< >
Showing 1-3 of 3 comments
Per page: 1530 50