EXAPUNKS

EXAPUNKS

View Stats:
DupLawyer Sep 22, 2018 @ 6:38am
Tutorial 4 in 112 cycles?
I've been going back and looking at early code to optimize but I can't see how to do "trash the news tutorial 4" (the countdown one" in so few lines.

I'd really like to understand how this was done as it will likely transfer to other solutions...

my code is below (400 cycles)

I can't see how to reduce two instructions out of the loop!!
If I use "SUBI X 1 F" or "F 1 F" I need to SEEK to test...
I'm missing some what of not needing to test perhaps...


LINK 800 GRAB 200 COPY F X WIPE LINK 800 MAKE COPY X F MARK LOOP SUBI X 1 X COPY X F TEST X = 0 FJMP LOOP
Last edited by DupLawyer; Sep 22, 2018 @ 6:40am
< >
Showing 1-3 of 3 comments
Juling Sep 22, 2018 @ 9:41am 
By using the T register you can omit the test since FJMP will trigger on T = 0.

Also, by using more than one exa...
jokeserver Sep 22, 2018 @ 6:05pm 
The T register trick will get you down to 300ish, because you'll still have a loop of size 3 for the 99 case. 112 cycles means you have to reduce the amortized cost per item... once I realized this and figured out the right number, I got it down to 147.

And remember, that number's the max among all the test cases.
DupLawyer Sep 23, 2018 @ 4:58am 
ahhh, I never thought of that usage of T, very clever

< >
Showing 1-3 of 3 comments
Per page: 1530 50