EXAPUNKS

EXAPUNKS

View Stats:
My solution to KGOG-TV
NOTE STREAMING BOT
LINK 800
LINK 799
COPY M #FREQ
LINK 800
SUBI M #AZIM X
MARK AIM
TEST X < 0
TJMP DECREASE
TEST X > 0
TJMP INCREASE
LINK -1
COPY M X
TEST X = 0
FJMP ELEV
MARK TRANSMIT
COPY M #DATA
JUMP TRANSMIT

MARK DECREASE
COPY -1 #MOTR
ADDI X 1 X
JUMP AIM
MARK INCREASE
COPY 1 #MOTR
SUBI X 1 X
JUMP AIM

MARK ELEV
LINK 801
SUBI M #ELEV X
JUMP AIM

NOTE ENCRYPTION BOT
GRAB 300
SEEK 5
COPY F M
SEEK -5
COPY F M
COPY 1 M
SEEK 1
COPY F M
COPY 0 M
DROP
GRAB 301
SEEK 1
LINK 800
MARK ENCRYPT
TEST EOF
TJMP END
MODE
COPY M X
MODE
TEST F > X
SEEK -1
TJMP WRAP
SUBI 9999 X X
ADDI F X M
JUMP ENCRYPT
MARK WRAP
SUBI F X X
SUBI X 1 M
JUMP ENCRYPT

MARK END
WIPE
KILL
LINK 799
KILL

NOTE HELPER BOT
LINK 800
GRAB 199
MODE
MARK LOOP
COPY F X
SUBI 9999 X M
TEST EOF
TJMP RESET
JUMP LOOP
MARK RESET
SEEK -9999
JUMP LOOP

I have noticed I had an higher Activity score than majority of people on this?
Was curious about where I went wrong xD
Was it the way in which I'm ecrypting the video?
I had attempted using "MODI 10000" just to be reminded I can't use values greater than 9999, so couldn't think to a better solution than the excessive math above...
How did you guys handled that?
< >
Showing 1-4 of 4 comments
Often the optimization goals will contradict.
My best solution (cycle-wise) to this puzzle has 311 cycles, but an activity of 59!

My best solution activity-wise is 8.
I only optimized for cycles in the game, though, so it's been by chance.

XA

LINK 800 LINK 799 REPL AZE REPL ELE MARK FREAQ NOOP NOOP NOOP NOOP NOOP COPY M #FREQ COPY 1 M HALT MARK AZE COPY M X LINK 800 SUBI #AZIM X X MARK ADJUSTMOTOR TEST X < 0 TJMP LOWAZ MARK BIGAZ COPY X T MARK LOWERAZ COPY -1 #MOTR SUBI T 1 T TJMP LOWERAZ JUMP FINISHED MARK LOWAZ SUBI 0 X T MARK RAISEAZ COPY 1 #MOTR SUBI T 1 T TJMP RAISEAZ JUMP FINISHED MARK ELE COPY M X LINK 801 SUBI #ELEV X X JUMP ADJUSTMOTOR MARK FINISHED LINK -1 COPY 1 M

XB

;READER GRAB 300 SEEK 1 COPY F M SEEK 1 COPY F M SEEK 1 COPY F M DROP GRAB 301 LINK 800 VOID M VOID M VOID M REPL KEYHOLDER LINK 799 MARK ENCODER COPY F #DATA MARK WRITE TEST EOF TJMP ENDOFFILE COPY M X ADDI F X T TEST T < 9999 TJMP WRITEIT SEEK -1 SUBI F 5000 T SUBI X 5000 X ADDI X T T TEST T > -1 TJMP WRITE_FX COPY 9999 #DATA JUMP WRITE MARK WRITE_FX SEEK -1 SUBI F 5000 T ADDI X T #DATA JUMP WRITE MARK WRITEIT SEEK -1 ADDI F X #DATA JUMP WRITE MARK KEYHOLDER GRAB 199 ; LINK 799 MARK READ TEST MRD TJMP SUICIDE COPY F M TEST EOF FJMP READ SEEK -9999 JUMP READ MARK ENDOFFILE VOID M COPY -9999 M WIPE HALT MARK SUICIDE VOID M
Subtracting 5000 from both when the register with the sum is filled, doing the sum and then checking for the 9999 corner case, I see - interesting, I hadn't tought of that :D

By the way, I should explain what I tried for people that don't have the time to check the code -
if I recall correctly, essentially I subtracted the encription value from 9999 to check how much space there was before overflowing, and then compared with the movie value, to see if it was greater or lesser than that space, example:

Encryption key 3000
Movie value 8500
Expected Encripted movie 1500

So the helper bot would send the amount before overflowing the register 6.999 (9999 - 3000) to the encryption bot, and if the movie value exceeded that space (8500 > 6999) it would subtract the space (8500 - 6999 = 1501 ) and then subtract 1 once again to get to the correct value 1500.
So in a sense, the value of the encryption key that needed to be added (3000) was already embedded in that 6999

...although thinking about it now, I'm confused as to why it seemed obvious then, I don't think I could reach the same conclusion again... my math skills are weak xD
Originally posted by マルコ:
Subtracting 5000 from both when the register with the sum is filled, doing the sum and then checking for the 9999 corner case, I see - interesting, I hadn't tought of that :D

It didn't feel elegant. :D

Here's the best I could come up with (in a solution with way more "activity"):

MARK NEXT_VAL
SUBI M 9999 X
ADDI X F X
TEST X > 0
TJMP SEND_MODULO_VAL
ADDI X 9999 X
REPL ANT
JUMP NEXT_VAL
MARK SEND_MODULO_VAL
SUBI X 1 X
REPL ANT
JUMP NEXT_VAL

It is based on the observation that all numbers incoming (video and key) are positive.
This is also a hint for further levels: Sometimes there's constraints in the data that are not in the description, or even additional stuff to observe in the visual display...
275 / 73 / 9
My solution uses 2 teams, first one adjust freq, azimuth and elevation, second one is for encoding and transmitting.

For the math part i used this trick:
Coder just subtracts 9999 from the key (assumption is that keys are always positive) and send result to the writer in an endless loop.
Writer adds the received value to the movie data
if result is negative: add 9999
if positive: sub 1

XA
GRAB 300 SEEK 1 COPY F X REPL AZI SEEK 1 COPY F X SEEK 1 COPY F T DROP LINK 800 LINK 799 COPY T #FREQ LINK 801 MARK ELE_TEST SUBI X #ELEV X TEST X < 0 TJMP MOTOR_DOWN FJMP MOTOR_UP MARK AZI LINK 800 LINK 799 LINK 800 MARK AZI_TEST SUBI X #AZIM X TEST X < 0 TJMP MOTOR_DOWN MARK MOTOR_UP COPY X T MARK M_U COPY 1 #MOTR SUBI T 1 T TJMP M_U HALT MARK MOTOR_DOWN MULI X -1 T MARK M_D COPY -1 #MOTR SUBI T 1 T TJMP M_D

XB
GRAB 301 VOID F LINK 800 REPL CODER MARK LOOP TEST EOF TJMP LOOP_END ADDI M F X TEST X < 0 SEEK -1 TJMP ADJ SUBI X 1 F JUMP LOOP MARK ADJ ADDI X 9999 F JUMP LOOP MARK LOOP_END KILL LINK 799 SEEK -9999 MARK TRX COPY F #DATA TEST EOF FJMP TRX WIPE HALT MARK CODER GRAB 199 MARK CODE SUBI F 9999 M TEST EOF FJMP CODE SEEK -9999 JUMP CODE

also have solution with activity 8, but they are way worst on cycles and length
< >
Showing 1-4 of 4 comments
Per page: 1530 50