Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
GuavaMoment
Aug 13, 2006

YouTube dude

Carbon dioxide posted:

Since I spent a lot of time getting the cycles down to 122, I'll leave the low size optimization to the threads.

Seeking back 6 and copying over the last six entries is a good trick and that got me down to 122 also. I only had a 32 line solution so thanks for the help on that one too silentsnack!

I'm really looking forward to the next level as I liked it a lot, and spent a lot of time on it. I'm still chasing down one cycle I know is possible, so maybe you all can help?

Adbot
ADBOT LOVES YOU

Carbon dioxide
Oct 9, 2012

GuavaMoment posted:

I'm really looking forward to the next level as I liked it a lot, and spent a lot of time on it. I'm still chasing down one cycle I know is possible, so maybe you all can help?

Feel free to all help each other out, just don't post about levels yet before I covered them in my LP.

Speaking of, I'm not entirely sure how my schedule will work out next week with Easter and such. The update might be delayed a bit.

Carbon dioxide
Oct 9, 2012

Part 22 - StreetSmarts GIS Database

=== Trash World Inbox ===

silentsnack posted:

code:
GRAB 301
LINK 800

MARK LOOP
REPL PAYLOAD
COPY 11 T

MARK DIALER
COPY F #DIAL
SUBI T 1 T
TJMP DIALER

COPY 800 M

TEST EOF
COPY -1 #DIAL
FJMP LOOP

MARK PAYLOAD
LINK -1
GRAB 300
COPY F X
COPY F T
DROP

LINK 800
LINK M

GRAB 200
MARK DATA
SEEK -2
COPY X F
COPY T F
COPY F F
JUMP DATA
367/28/26
A low size solution. Quite straightforward - while the 'main' EXA is dialing, a payload EXA goes back to read the payload file to X and T. It then waits for a message from the dialing EXA, and LINKs to the radio host when it gets it. There it overwrites the playlist. COPY F F is a way to check if you're at the end of the file yet. If not, it takes the value at the F cursor and writes it to the next location. Doesn't matter since it gets overwritten anyway. I didn't know COPY F F was legal, since you can't do something like ADDI F F X. But it is, and it's necessary here because X and T are already occupied.


=== StreetSmarts GIS Database ===


That was surprisingly easy.
People are requesting the single, humming it to themselves, buying the album...
Just because they've heard it before.
Is that really all it takes?




Two votes for "more complex", but 3 for this one.

Mass media is a sham.

It's seeming that way.
Hmm.
Girl you need to get a cluuuue...
I just can't not get over yoooou!
Oops. I guess it is pretty catchy.


I didn't know AIs could get an earworm.





Next up, hacking a GIS database.

Theory: The inconsistency of ratings depends on context.
We made a hit by picking a generic pop song and artificially boosting its exposure.
But there are other domains where this isn't possible.
For example, you couldn't change people's behavior by giving a Last Stop store a five-star rating in a restaurant guide.
That would be ridiculous.




All votes but one for "You never know".

You never know...

This is why we need to experiment.



OST: Network Exploration

The assignment:
- Each host contains a list of restaurants and their ratings, from one to five stars (file 200). Locate the entry that corresponds to the Last Stop on Eddy Street and change its rating from one to five stars.
- The name of the target restaurant and its location within the GIS grid is available in file 300. The first coordinate is the number of times to move east, while the second coordinate is the number of times to move north (positive) or south (negative).
- For more information see "Network Exploration: Geographic Information Systems" in the second issue of the zine.


Let's see what the zine has to teach us.



We're dealing with a StreetSmarts system here. I'm just wondering what that would look like for any city that isn't grid based.

Also, since GIS is short for Geographic Information System, it's pronounced GIS, not GIS.



As you can see there's one or two restaurants in each block. There's also a compass needle to conveniently show us which way is which. East (the first value in file 300) is to the top right, while north is to the top left.

Let's start building.

I think it'd be convenient to have one EXA stay home to just transmit the coordinates:
code:
;XA
GRAB 300
COPY F X
COPY F M
COPY F M
COPY X M
East, then north/south, and finally the name of the restaurant to look up in the file.

The 'walking' EXA should first go the right "east" position (can I call it longitude?):

code:
;XB
LINK 800
COPY M T
FJMP NS

MARK EAST
LINK 801
SUBI T 1 T
TJMP EAST

MARK NS
If the east value starts at 0, XB shouldn't move at all from the starting grid space, so it skips the loop. Otherwise it LINKs until the number of steps becomes zero.

The north-south (latitude) code has to deal with negative values, so it's more complicated:

code:
MARK NS
COPY M X
TEST X < 0
TJMP GOSOUTH

COPY X T
FJMP FOUND

MARK NORTH
LINK 800
SUBI T 1 T
TJMP NORTH
JUMP FOUND

MARK GOSOUTH

COPY X T
MARK SOUTH
LINK 802
ADDI T 1 T
TJMP SOUTH

MARK FOUND
First I check if the value is negative, if so it jumps to GOSOUTH. If not, I first check if it's zero, in which case we're done. From there on I use the T register again for the countdown so I can use the TJMP without TEST when the EXA is in the right place.

Finally, grab the file, and find the right restaurant. Since any restaurant has at least 1 star, I can copy the first star and write that to the file four times.





This initial solution runs at 48/40/6. The top percentiles are 26, 25 and 6 respectively.

Activity is already optimized at 6. That makes sense, because 6 is how many steps it takes to get to the far corners of the grid, so that'll correspond to the highest-activity test case. Time to improve the other metrics.

First of all, we can speed up the search within the file. Since there's never more than 2 restaurants in a file, the following solution works:

code:
MARK FINDINFILE
TEST F = X
TJMP COPY
SEEK 6
MARK COPY
COPY F X
@REP 4
COPY X F
@END
Check if it's the first value. If not, it's the second value, so SEEK to the star just beyond it. This drops the cycle count to 37.

For the next improvement, I considered that specifically going for the correct grid space is a bit slow with all the tests if the EXA is there yet. Since the restaurant we're looking for exists in only one place, I just can have EXA REPLs check everywhere.

It's a bit fiddly to have the EXAs only go where they need to be and not visit nodes several times.

code:
;XA 

GRAB 300
COPY F M

;XB

LINK 800
COPY M X

REPL SOUTH
REPL NORTH
REPL EAST
JUMP GRABFILE

MARK SOUTH
LINK 802
REPL EAST
REPL GRABFILE
LINK 802
REPL EAST
JUMP GRABFILE

MARK NORTH
LINK 800
REPL EAST
REPL GRABFILE
LINK 800
REPL EAST
JUMP GRABFILE

MARK EAST
@REP 2
LINK 801
REPL GRABFILE
@END
LINK 801


MARK GRABFILE
GRAB 200
TEST F = X
TJMP COPY
SEEK 5
TEST F = X
DIVI T T X ;DIE
MARK COPY
COPY F X
@REP 4
COPY X F
@END
From the start, XB REPLs itself into south-, north- and eastbound copies. It also jumps to GRABFILE in case the restaurant is in the initial grid space.

The south- and north-bound EXAs each link in their directions twice, leaving eastbound and GRABFILE EXAs behind. This is all written out instead of using @REP so I have manual control over when to use REPL and when a JUMP suffices, to prevent creating extra EXAs.

The eastbound EXAs link in their directions three times, leaving GRABFILE instances behind so the entire grid is covered.

Finally, in the GRABFILE code, after SEEKing for the second restaurant entry, it has to test if that's the correct one. If there's only one entry, the TEST makes this EXA die, and if it's the wrong one, the DIVI by zero will do so.

27/41/20.

Notice that I always do the REPL to the moving EXAs first, and that I start with SOUTH and NORTH before EAST. Moving to the back of the grid takes the longest so it's important to optimize it as much as possible. I also tried making the eastbound EXA spawn columns of south/north-bound ones but that was slightly slower.

There's one more cycle to be saved here, though.

code:
MARK SOUTH
LINK 802
REPL EAST
LINK 802
REPL EAST
REPL GRABFILE
LINK 800
JUMP GRABFILE

MARK NORTH
LINK 800
REPL EAST
LINK 800
REPL EAST
REPL GRABFILE
LINK 802
JUMP GRABFILE
It's actually slightly faster to first spawn the eastbound EXA in the farthest south and north columns, and then go back to see if the skipped file isn't the right one. 26 cycles.

I tried more tweaking with the movement order but I couldn't get it better than this.


Finally, for size, the most straightforward trick is to just use loops instead of unrolls. Remove all speed optimizations in favour of simpler code:

code:
;XA
GRAB 300
COPY F M

;XB
LINK 800
COPY M X

REPL SOUTH
REPL NORTH
REPL EAST
JUMP GRABFILE

MARK SOUTH
LINK 802
REPL EAST
REPL GRABFILE
JUMP SOUTH

MARK NORTH
LINK 800
REPL EAST
REPL GRABFILE
JUMP NORTH

MARK EAST
LINK 801
REPL GRABFILE
JUMP EAST

MARK GRABFILE
GRAB 200
MARK FIND
TEST F = X
FJMP FIND

COPY F X
@REP 4
COPY X F
@END
Down to 49/32/20. The directional loops would go on forever, except those EXAs just die as soon as they can't link any further.

For the next improvement, we need to reuse lines. This 29-line solution does so:
code:
;XA
GRAB 300
COPY F M

;XB
LINK 800
COPY M X
JUMP START

MARK EAST
LINK 801
MARK START
REPL EAST
REPL NORTH
REPL GRABFILE

MARK SOUTH
LINK 802
REPL GRABFILE
JUMP SOUTH

MARK NORTH
LINK 800
REPL GRABFILE
JUMP NORTH

MARK GRABFILE
GRAB 200
MARK FIND
TEST F = X
FJMP FIND

COPY F X
@REP 4
COPY X F
@END
Basically, I rewrote the LINKing logic to the slower solution where the eastbound EXA splits off in north- and southbound ones. Then by rearranging the REPLs, I can use a fallthrough to turn the eastbound ones south. Also, the START mark means I don't need the initial set of REPLs anymore.

Finally, I can combine the southbound and northbound loops by putting the LINK ids in a register:

code:
COPY 800 T
REPL NORTHSOUTH
REPL GRABFILE

COPY 802 T

MARK NORTHSOUTH
LINK T
REPL GRABFILE
JUMP NORTHSOUTH
This clocks in at 47/27/20. I'll leave the further improvement to the top percentile size of 25 lines to the threads.

Oh.
Apparently, that Last Stop location is getting mobbed.
Processing.
People are choosing to believe the guide even when it's obviously wrong...
Why would they think Last Stop has actual good food?
And why did the guide change their behavior, but not the highway sign?




Here is the first vote.

Before I finish for today, do you remember when I posted that story from the first zine, way back in episode 7? It was a couple of pages long.

The second zine contains the last half of the story, here it is.

Click the images for higher resolution.





Next time, we'll have another hacker battle.

Time for the next opponent.
Are you ready?


Carbon dioxide fucked around with this message at 14:36 on Apr 18, 2022

berryjon
May 30, 2011

I have an invasion to go to.
The Signs were Vague
What, are you my coach now?


This looks like you're programming a search engine for a database, or a spread sheet, not just for a roughly digitized map of a neighborhood.

biosterous
Feb 23, 2013




berryjon posted:

The Signs were Vague
What, are you my coach now?



:hmmyes:

GuavaMoment
Aug 13, 2006

YouTube dude

Carbon dioxide posted:

This clocks in at 47/27/20. I'll leave the further improvement to the top percentile size of 25 lines to the threads.

25 lines? How about 18.

code:
GRAB 300
COPY F X
WIPE
COPY 800 T
MARK MAIN
LINK T
REPL MAIN
GRAB 200
ADDI T 1 T
REPL MAIN
MARK TEST
TEST F = X
FJMP TEST
COPY F X
COPY X F
COPY X F
COPY X F
COPY X F
Floods the entire map and checks every node. EXAs die when there isn't an 800 or 804 node to go to, or the file is held by a previous exa.

As for speed, 24/46/31:

code:
GRAB 300
COPY F X
LINK 800
MARK MAIN
REPL TOP3
REPL TOP2
REPL TOP1
REPL RIGHT2
REPL RIGHT1
REPL LEFT2
REPL LEFT1
WIPE
JUMP EDDY
MARK TOP3
LINK 801
MARK TOP2
LINK 801
MARK TOP1
LINK 801
REPL RIGHT2
REPL LEFT2
REPL RIGHT1
REPL LEFT1
JUMP EDDY
MARK RIGHT2
LINK 802
MARK RIGHT1
LINK 802
JUMP EDDY
MARK LEFT2
LINK 800
MARK LEFT1
LINK 800
MARK EDDY
GRAB 200
TEST F = X
TJMP STARS
SEEK 5
TEST F = X
FJMP EDDY ; this kills the exa when it's in the wrong node
MARK STARS
COPY F X
COPY X F
COPY X F
COPY X F
COPY X F
The farthest nodes need directed EXAs as soon as possible, so I create the farthest east EXA first, then furthest south, then north. All the outer nodes get checked first (cycles 11 and 12), and 10 central nodes all get checked on cycle 13. I know faster times are possible but I just cannot figure it out. I don't know if I can fill the grid faster, and I don't know actually using the coordinates of the correct Eddy's could help.

silentsnack
Mar 19, 2009

Donald John Trump (born June 14, 1946) is the 45th and current President of the United States. Before entering politics, he was a businessman and television personality.

GuavaMoment posted:

I'm still chasing down one cycle I know is possible, so maybe you all can help?

"depends on which cycle you mean" and/or "maybe you can figure the rest of this mess out" because 23 is feasible with a bit of effort and paying attention to order of operations, so i'm blaming you for this one:

code:
;XA
GRAB 300
COPY F M
SEEK -1
COPY F X
LINK 800
REPL NORTH;B20-B30
LINK 801
MARK NORTH;B21-B31
REPL SOUTH
LINK 800
REPL HERE
WIPE;CRASH

MARK SOUTH;B10,B11
REPL HERE
LINK 802
MARK HERE
GRAB 200
TEST F = X
TJMP YES
SEEK 5
TEST F = X
DIVI T T T
MARK YES
COPY F X
@REP 4
COPY X F
@END

;XB
LINK 800
LINK 801
COPY M X
REPL NORTH
LINK 801
REPL N1;B22-B32
LINK 801
MARK N1;B23-B33
REPL S1
REPL HERE
LINK 800
JUMP HERE

MARK S1;B12,B13
LINK 802
JUMP HERE

MARK NORTH;B41-B43
REPL SOUTH
LINK 800
LINK 800
REPL EAST
MARK WEST;B00,B40
REPL HERE
LINK 803
JUMP HERE

MARK SOUTH;B01-B03
LINK 802
LINK 802
REPL WEST
MARK EAST
LINK 801
REPL HERE
LINK 801

MARK HERE
GRAB 200
TEST F = X
TJMP YES
SEEK 5
TEST F = X
DIVI T T T
MARK YES
COPY F X
@REP 4
COPY X F
@END
23/73/25

and a 22 cycle solution is possible, but I haven't found a way to make it fit inside the solution size limit

code:
;XA
GRAB 300
COPY F X
REPL WEST_X
COPY X M
MARK SEND
COPY X M
COPY X M
HALT

MARK NORTHWEST;B30-B40
LINK 800
REPL HERE
LINK 800
JUMP HERE

MARK WEST_X;B20-B21
REPL SEND
LINK 800
REPL NORTHWEST
REPL SOUTHWEST

REPL HERE
LINK 801
JUMP HERE

MARK SOUTHWEST;B10-B00

LINK 802
REPL HERE
LINK 802

MARK HERE
GRAB 200
TEST F = X
TJMP YES
SEEK 5
TEST F = X
DIVI T T T
MARK YES
COPY F X
@REP 4
COPY X F
@END

;XB
REPL SOUTH
LINK 800
LINK 801
REPL MID_3
LINK 800
COPY M X
;B31-B41
REPL HERE
LINK 800
MARK HERE
GRAB 200
TEST F = X
TJMP YES
SEEK 5
TEST F = X
DIVI T T T
MARK YES
COPY F X
@REP 4
COPY X F
@END
HALT

MARK MID_3;B22
NOOP
NOOP
LINK 801
COPY M X
JUMP HERE

MARK SOUTH;B11-B01
LINK 800
LINK 801
LINK 802
COPY M X
REPL HERE
LINK 802
JUMP HERE

;XC
LINK 800
LINK 801
LINK 801
REPL NORTHEAST
LINK 801
COPY M X
REPL SOUTHEAST
;B33-B43
LINK 800
REPL HERE
LINK 800
GRAB 200
TEST F = X
TJMP YES
SEEK 5
TEST F = X
TJMP YES
HALT

MARK SOUTHEAST;B1X-B0X
LINK 802
REPL HERE
LINK 802
GRAB 200
TEST F = X
TJMP YES
SEEK 5
TEST F = X
TJMP YES
HALT

MARK EAST_X;B23
LINK 801
JUMP HERE

MARK NORTHEAST;B32-B42
COPY M X
REPL EAST_X
REPL SOUTHEAST
LINK 800
REPL HERE
LINK 800
MARK HERE
GRAB 200
TEST F = X
TJMP YES
SEEK 5
TEST F = X
DIVI T T T
MARK YES
COPY F X
@REP 4
COPY X F
@END
22 cycles, 125 lines (so it doesn't count for statistics)


GuavaMoment
Aug 13, 2006

YouTube dude

silentsnack posted:

"depends on which cycle you mean" and/or "maybe you can figure the rest of this mess out" because 23 is feasible with a bit of effort and paying attention to order of operations, so i'm blaming you for this one:

I'm not picky, it could have been any cycle. :) If one exa is filling the map it's the same speed to read and wipe the file, or travel first and have another exa transmit over M. But I see now if you have two exas receiving M data, one can fill the three eastern columns and one can then fill the first north column, and this is one cycle faster. There is an order of operation issue to make the three column exa get the M data first, but this just squeaks it out.

23/75/30
code:
;xb
LINK 800
LINK 801
COPY M X
REPL TOP2
REPL TOP1
REPL RIGHT2
REPL RIGHT1
REPL LEFT2
REPL LEFT1
JUMP EDDY
MARK TOP2
LINK 801
MARK TOP1
LINK 801
REPL RIGHT2
REPL LEFT2
REPL RIGHT1
REPL LEFT1
JUMP EDDY
MARK RIGHT2
LINK 802
MARK RIGHT1
LINK 802
JUMP EDDY
MARK LEFT2
LINK 800
MARK LEFT1
LINK 800
MARK EDDY
GRAB 200
TEST F = X
TJMP STARS
SEEK 5
TEST F = X
FJMP EDDY
MARK STARS
COPY F X
COPY X F
COPY X F
COPY X F
COPY X F

;xa
NOOP
LINK 800
COPY M X
REPL RIGHT2
REPL RIGHT1
REPL LEFT2
REPL LEFT1
JUMP EDDY
MARK RIGHT2
LINK 802
MARK RIGHT1
LINK 802
JUMP EDDY
MARK LEFT2
LINK 800
MARK LEFT1
LINK 800
MARK EDDY
GRAB 200
TEST F = X
TJMP STARS
SEEK 5
TEST F = X
FJMP EDDY
MARK STARS
COPY F X
COPY X F
COPY X F
COPY X F
COPY X F

;xc
GRAB 300
COPY F M
SEEK -1 
COPY F M
Right at the 75 line limit. I actually have a MARK MAIN line in my first solution I posted that was legacy code and isn't needed. If I had room for another NOOP then I wouldn't have to worry about timing issues, but eh, I got my cycle.

Beartaco
Apr 10, 2007

by sebmojo

quote:

COPY 11 T

MARK DIALER
COPY F #DIAL
SUBI T 1 T
TJMP DIALER

I've been playing through the game myself and I never once thought to do this. I'd been storing my index values on X and using repeated TESTs for all of my loops. Much appreciated!

Is this trick mentioned in the Zine anywhere?

silentsnack
Mar 19, 2009

Donald John Trump (born June 14, 1946) is the 45th and current President of the United States. Before entering politics, he was a businessman and television personality.

Beartaco posted:

I've been playing through the game myself and I never once thought to do this. I'd been storing my index values on X and using repeated TESTs for all of my loops. Much appreciated!

Is this trick mentioned in the Zine anywhere?

I think all the examples use X and they don't outright give you the minimalist loop structure since it's a puzzle game, but the first zine drops a few hints that "TEST operations overwrite whatever value is in the T register ...but it also has the same features as the X register, so you can also read/modify it however you want, and TJMP/FJMP only check whether or not T=0"

Carbon dioxide
Oct 9, 2012

Yes. The zine gives you enough to at least solve all the puzzles, but doesn't go out of its way to help you find high scores.

Beartaco
Apr 10, 2007

by sebmojo
Yeah I'm well near the end of the game at this point, knowing that I can store values in X while at the same time keeping indexes in T is massive. That's not just saving a few lines of code, that's doubling my storage capacity in all sorts of situations without the need to mess around with files which is always a huge pain.

I knew that I could keep T as a general register, obviously, but using it specifically for decrementing down to 0 or 1 never once occurred to me.

Beartaco fucked around with this message at 06:34 on Apr 21, 2022

Carbon dioxide
Oct 9, 2012

Part 23 - Valhalla Hacker Battle

=== Trash World Inbox ===

GuavaMoment posted:

25 lines? How about 18.

code:
GRAB 300
COPY F X
WIPE
COPY 800 T
MARK MAIN
LINK T
REPL MAIN
GRAB 200
ADDI T 1 T
REPL MAIN
MARK TEST
TEST F = X
FJMP TEST
COPY F X
COPY X F
COPY X F
COPY X F
COPY X F
Ah, I was wondering if something like this was possible but didn't quite figure it out. The trick is to start LINKing from 800 and then use a combination of REPL and increments of the LINK id to go in every direction. But if you get that wrong the EXAs will keep looping forever.

GuavaMoment also shared this 24 cycle solution:

GuavaMoment posted:

code:
GRAB 300
COPY F X
LINK 800
MARK MAIN
REPL TOP3
REPL TOP2
REPL TOP1
REPL RIGHT2
REPL RIGHT1
REPL LEFT2
REPL LEFT1
WIPE
JUMP EDDY
MARK TOP3
LINK 801
MARK TOP2
LINK 801
MARK TOP1
LINK 801
REPL RIGHT2
REPL LEFT2
REPL RIGHT1
REPL LEFT1
JUMP EDDY
MARK RIGHT2
LINK 802
MARK RIGHT1
LINK 802
JUMP EDDY
MARK LEFT2
LINK 800
MARK LEFT1
LINK 800
MARK EDDY
GRAB 200
TEST F = X
TJMP STARS
SEEK 5
TEST F = X
FJMP EDDY ; this kills the exa when it's in the wrong node
MARK STARS
COPY F X
COPY X F
COPY X F
COPY X F
COPY X F
The farthest nodes need directed EXAs as soon as possible, so I create the farthest east EXA first, then furthest south, then north. All the outer nodes get checked first (cycles 11 and 12), and 10 central nodes all get checked on cycle 13. I know faster times are possible but I just cannot figure it out. I don't know if I can fill the grid faster, and I don't know actually using the coordinates of the correct Eddy's could help.
Those RIGHT2 and RIGHT1 jumps where you end up further down the code if you need to do fewer LINKs are a quite neat solution.

Next, both silentsnack and GuavaMoment posted 23-cycle solutions. They are similar in the sense that they each use two EXAs, one to handle the back rows and one to handle the front rows. That's apparently very slightly faster than using a single EXA.

For the sake of brevity I'll only post silentsnack's solution here but I want to mention that GuavaMoment's solution has an EXA priority quirk, where depending on what EXA's code you paste in first, it runs at either 23 or 26 cycles.

silentsnack posted:

code:
;XA
GRAB 300
COPY F M
SEEK -1
COPY F X
LINK 800
REPL NORTH;B20-B30
LINK 801
MARK NORTH;B21-B31
REPL SOUTH
LINK 800
REPL HERE
WIPE;CRASH

MARK SOUTH;B10,B11
REPL HERE
LINK 802
MARK HERE
GRAB 200
TEST F = X
TJMP YES
SEEK 5
TEST F = X
DIVI T T T
MARK YES
COPY F X
@REP 4
COPY X F
@END

;XB
LINK 800
LINK 801
COPY M X
REPL NORTH
LINK 801
REPL N1;B22-B32
LINK 801
MARK N1;B23-B33
REPL S1
REPL HERE
LINK 800
JUMP HERE

MARK S1;B12,B13
LINK 802
JUMP HERE

MARK NORTH;B41-B43
REPL SOUTH
LINK 800
LINK 800
REPL EAST
MARK WEST;B00,B40
REPL HERE
LINK 803
JUMP HERE

MARK SOUTH;B01-B03
LINK 802
LINK 802
REPL WEST
MARK EAST
LINK 801
REPL HERE
LINK 801

MARK HERE
GRAB 200
TEST F = X
TJMP YES
SEEK 5
TEST F = X
DIVI T T T
MARK YES
COPY F X
@REP 4
COPY X F
@END
23/73/25
Very optimized, but also quite hard to read with the many REPLs.

Finally, silentsnack has a 22-cycle solution which sadly doesn't fit into the size limit.

silentsnack posted:

code:
;XA
GRAB 300
COPY F X
REPL WEST_X
COPY X M
MARK SEND
COPY X M
COPY X M
HALT

MARK NORTHWEST;B30-B40
LINK 800
REPL HERE
LINK 800
JUMP HERE

MARK WEST_X;B20-B21
REPL SEND
LINK 800
REPL NORTHWEST
REPL SOUTHWEST

REPL HERE
LINK 801
JUMP HERE

MARK SOUTHWEST;B10-B00

LINK 802
REPL HERE
LINK 802

MARK HERE
GRAB 200
TEST F = X
TJMP YES
SEEK 5
TEST F = X
DIVI T T T
MARK YES
COPY F X
@REP 4
COPY X F
@END

;XB
REPL SOUTH
LINK 800
LINK 801
REPL MID_3
LINK 800
COPY M X
;B31-B41
REPL HERE
LINK 800
MARK HERE
GRAB 200
TEST F = X
TJMP YES
SEEK 5
TEST F = X
DIVI T T T
MARK YES
COPY F X
@REP 4
COPY X F
@END
HALT

MARK MID_3;B22
NOOP
NOOP
LINK 801
COPY M X
JUMP HERE

MARK SOUTH;B11-B01
LINK 800
LINK 801
LINK 802
COPY M X
REPL HERE
LINK 802
JUMP HERE

;XC
LINK 800
LINK 801
LINK 801
REPL NORTHEAST
LINK 801
COPY M X
REPL SOUTHEAST
;B33-B43
LINK 800
REPL HERE
LINK 800
GRAB 200
TEST F = X
TJMP YES
SEEK 5
TEST F = X
TJMP YES
HALT

MARK SOUTHEAST;B1X-B0X
LINK 802
REPL HERE
LINK 802
GRAB 200
TEST F = X
TJMP YES
SEEK 5
TEST F = X
TJMP YES
HALT

MARK EAST_X;B23
LINK 801
JUMP HERE

MARK NORTHEAST;B32-B42
COPY M X
REPL EAST_X
REPL SOUTHEAST
LINK 800
REPL HERE
LINK 800
MARK HERE
GRAB 200
TEST F = X
TJMP YES
SEEK 5
TEST F = X
DIVI T T T
MARK YES
COPY F X
@REP 4
COPY X F
@END
22 cycles, 125 lines (so it doesn't count for statistics)
Without going into the nitty gritty, the easiest way to understand this is by running it and seeing which EXA grabs which file.



As you can see labour is now divided among 3 EXAs.

I didn't really try but I can imagine getting this under the 75 size limit is impossible. It's easy to make the code (a bit) smaller, but not without having it be slower as well.


=== Valhalla ===

Oh.
Apparently, that Last Stop location is getting mobbed.
Processing.
People are choosing to believe the guide even when it's obviously wrong...
Why would they think Last Stop has actual good food?
And why did the guide change their behavior, but not the highway sign?




Everyone seems to be agreeing that the signs were vague. Yeah, that's always the problem with astrology, isn't it?

The signs were vague.

Hmm...
I guess it's easier to care about food than an abstract problem.


Nothing more to say about that, Ember? Well, ok.





Next up, a hacker battle against =plastered.

Time for the next opponent.
Are you ready?




These unanimous votes make it easy for me to keep count.

What, you're my coach now?

Would that be a bad thing?
That extreme baseball book you found me was full of interesting information.
Go on, champ, get out there and win.


I think I just threw up into my mouth a little bit.


OST: Getting Started

It's much the same as before. I first have to beat =plastered before I can play against other people.

The assignment reads:
To win this battle you must control a majority of the hosts for as long as possible.
To take control of a host, write any value to its #CTRL register. Reading from a #CTRL register will tell if you (1) or your opponent (-1) controls the host.
- Gain one point every cycle you control more hosts than your opponent.
- Lose one point every time one of your EXAs executes a KILL instruction.
For more information see "Hacker Battle Domination" in the second issue of the zine.


There's a 10 EXA limit, a 100 size limit, and each battle runs for 100 cycles.



Take note of the layout of the grid. It's basically linear, but both me and the opponent connect into the one-but-last position on our sides.

If I just let it run without doing anything, =plastered sends a single EXA in that first goes to the right (the end of the line), activates that node, and then goes down the path, activating each node in turn. Once it reaches my end it turns back and repeats its pattern.

As usual, hacker battles are kinda trivial to win.

I can actually just replicate =plastered's code one to one, like so:

code:
LINK 800
LINK -1

MARK START
@REP 8
COPY 1 #CTRL
LINK 800
@END

@REP 8
COPY 1 #CTRL
LINK -1
@END
JUMP START
The odds seem to be on my side because doing this, I win 52 out of 100 battles, which counts as an overall win. It's a C, though. I'm sure I can do at least a bit better.

Since =plastered doesn't bother REPLicating anything, I can just take the single-point loss of executing a well-timed KILL and win every battle with about 90 points.

code:
;XA

NOOP
LINK 800
LINK -1

MARK START
@REP 8
COPY 1 #CTRL
LINK 800
@END

@REP 8
COPY 1 #CTRL
LINK -1
@END
JUMP START

;XB

@REP 6
LINK 800
@END
KILL




Since the enemy EXA is gone after XB has done its thing, I don't even need the loop anymore. XA could set every #CTRL register once and die, and the rest of the cycles I just rack up points for free.

If you don't want to use a KILL, another solution is to just REPL an EXA into every host and have them set #CTRL in a small loop. Because the enemy can only set a single host at once and I overwrite it the next cycle, it'll never hold a majority of the hosts.

code:
LINK 800

REPL SOUTH
MARK NEXT
REPL SET

LINK 800
JUMP NEXT

MARK SOUTH
LINK -1

MARK SET
COPY 1 #CTRL
JUMP SET
Either way, this gives me an easy S+.

Do you like it? Winning?



And that brings us to our first vote already.




To be fair, any chump could've beaten you, =plastered.




Anyway, there's someone at the door. Sounds like my neighbor, Isadora.

To anyone keeping track, the game's opening cut scene took place on Saturday, October 4th, 1997. It's now Tuesday, November 4th, so exactly one month has passed in-game. The previous cut scene with Isadora was on October 8th.



Hey...
Sorry I haven't been in touch.
Things are a little crazy at work right now.
They promoted me to a new position, and... well there's just a lot going on.


I didn't notice this before but Isadora is actually wearing somewhat more formal clothes than in her previous cut scene. A nice touch.

Isadora offers me a plastic bag with something inside of it.
It's moderately heavy.
Maybe a couple books or something?

You like puzzle games, don't you?
I remember you being a fan.
I used to play games with my sister sometimes, but she moved to Japan a few years ago.
She sent me this game, but I guess I can't play it because of the region lock.
Looks fun, though.
I thought maybe you could get it working.
You always were good at that kind of thing.


Isadora sighs.

I have to go.
So much work to do... really hope this job doesn't eat me up.
Okay, bye for now.


Speaking of puzzles, the last page of the second zine has some nonograms, also known as Picross or paint-by-numbers puzzles. Here's the instructions and the first puzzle.



Since there's not much for the thread to do with these hacker battles, why not do one of these? If you want to share your result please use spoiler tags so other people get a chance to solve it for themselves too.

We'll check out Isadora's video game later. First things first - I can barely hold a controller right now since the Phage seems to be acting up in my left hand.

First it was your arm... now it's your hand.



And that brings us to our second vote.

berryjon
May 30, 2011

I have an invasion to go to.
Sure
It's getting bad.


I'll have a look at that fill-in-the-blanks later though.

cardinale
Jul 11, 2016

Sure
What? I'm fine

Nth Doctor
Sep 7, 2010

Darkrai used Dream Eater!
It's super effective!


berryjon posted:

Sure
It's getting bad.

biosterous
Feb 23, 2013




berryjon posted:

Sure
It's getting bad.


I'll have a look at that fill-in-the-blanks later though.

nonogram:

Beartaco
Apr 10, 2007

by sebmojo
Cryptic!

Carbon dioxide
Oct 9, 2012

Part 24 - Mitsuzen HDI-10 - Left hand

=== Trash World Inbox ===

Thanks cardinale and biosterous for the nonogram submissions.

biosterous posted:


I'm not entirely sure what it depicts. It kinda looks like a disk in a cartridge, but it doesn't have the same shape as the Redshift disks. It might be for something we have yet to see.


=== Mitsuzen HDI-10 - Left hand ===


Do you like it? Winning?



All votes went to "Sure".

Sure.

Of course.
That's how human brains are designed, aren't they?
To like winning. So that you will always try to win.
It's a very simple design.
Any time I start to discredit myself for being too simple, I think about human brains and feel a little better.


Oof.



I mean, I don't know about clones, but the main problem with most conspiracy theories is that they assume a level of government competence we've never seen in real life, so I'll have to give hydro credit for that, at least.



Anyway, I need to take a break for a moment and first do something about my Phage infection.

First it was your arm... now it's your hand.



Three votes for "It's getting bad".

Yeah, it's getting bad.

I can see that.
Fortunately, it looks like you can easily access the nodes connected to your median nerve.
You'll just need to make a small incision in your ventral forearm.
Better watch out for that artery, though.




This is one of those choices where all options lead to the same dialogue.

Ugh.

Sounds like you're getting used to this.
That's good. It's nothing to be squeamish about.



OST: EXA Power

All right, here's what I need to do.

- There are three nerve signals that need to be relayed: muscle control (M), which runs from your central nervous system (CNS) to your hand (HND) and heat (H) and pressure (P), which run the other direction.
- For each signal, read a value from the input nerve and relay it to the output nerve. Repeat
ad infinitum.
- It is not necessary to leave no trace. Your EXAs should be written to operate indefinitely.
- For more information see "Debugging the Phage" in the first issue of the zine.


Hmm. Looks like the main challenge is one of 'bandwidth'. Using the M register is usually fast, but you can only have one global signal per cycle. Having EXAs running back and forth is slower, but you can have multiple, with the limit being that you can only have one EXA traverse any specific LINK at one time.

I think I'll start with the M solution and try to start optimizing for low activity since that seems easy, if not very fast.

Now, sending messages from all three nerves in parallel is hard. Getting that synced up so the right EXA gets the right message.
So, what if we make it simpler and just... don't?

For the low activity we need to start with one EXA and REPL from there to have the minimum amount of LINKs.

code:
LINK 800

REPL RIGHT
; LEFT
COPY -3 X
LINK -3
LINK -3

MARK RIGHT
COPY 3 X
LINK X
LINK X
This gets the original EXA (LEFT) to M-CNS, and the RIGHT one to M-HND. You'll see in a bit why I am using X for this.

Next, the LEFT EXA starts sending and the RIGHT one starts receiving, exactly 14 signals.

code:
LINK 800

REPL RIGHT
; LEFT
COPY -3 X
LINK -3
LINK -3

MARK SEND
COPY 14 T

MARK SENDLP
COPY #NERV M
SUBI T 1 T
TJMP SENDLP

MARK RIGHT
COPY 3 X
LINK X
LINK X

MARK RECEIVE
COPY 14 T

MARK RECEIVELP
COPY M #NERV
SUBI T 1 T
TJMP RECEIVELP
Just a couple countdown loops like we've seen before. Why 14? Well, that's the ugly hack I'm using here. The assignment's tests mark a program as OK when for each nerve 14 signals have been relayed. It doesn't care about the fact that my hand will fall off or something, and losing my hand is certainly worth it when aiming for some meaningless high score.

After "completing" the M nerve, it's time to LINK to the next nerves. Importantly, the RIGHT EXA needs to switch to sending and the LEFT one to receiving. When 14 signals have been sent in that round, they need to move on once more, but then RIGHT needs to keep sending. So I need a contextual swap of some sort.

Here is the complete working program.



This is where the X register comes in use. Once either the SENDLP or RECEIVELP loops are done, the EXA LINK to the next host in its direction (as stored in X), and then uses the value of X to determine whether it should be sending or receiving. So, in summary:
- In the first iteration, LEFT starts out sending and RIGHT starts out receiving.
- In the second iteration, the above test is first run, which sets RIGHT to sending and LEFT to receiving.
- In the third iteration, the test is run again, keeping RIGHT to sending and LEFT to receiving.
- After that, if the test didn't cut off the program after getting all expected signals, the EXA would try to link to a non-existent host and die.



This leads to a strange solution where the nerve signals are handled nerve by nerve.



Results: 181/29/9. The top percentile scores stand at 37, 24, and 9 respectively.

I can make a small size improvement by moving some LINK instructions to inside the SEND and RECEIVE marks.

code:
LINK 800

REPL RIGHT
; LEFT
COPY -3 X
LINK X

MARK SEND
LINK X
COPY 14 T

MARK SENDLP
COPY #NERV M
SUBI T 1 T
TJMP SENDLP

TEST X = 3
TJMP SEND

MARK RECEIVE
LINK X
COPY 14 T

MARK RECEIVELP
COPY M #NERV
SUBI T 1 T
TJMP RECEIVELP

TEST X = -3
TJMP RECEIVE

JUMP SEND


MARK RIGHT
COPY 3 X
LINK X
JUMP RECEIVE
181/27/9. I feel like this might be the right approach to get to the smallest size. There's actually some duplicate code in there. But I can't quite figure out how to get rid of it.

Let's look at cycle count instead.

My first idea involved files. I'm still using the "we only need 14 signals" hack, but this time, three EXAs read 14 signals each into a file, take that to the recipient nerve and write from the files to there. I unrolled as many loops as I could, although the fact that the different EXAs need to move in different ways makes it hard to keep track of their state.

code:
LINK 800
REPL LEFT

LINK 3
LINK 3
LINK 3
REPL H

LINK 3

MARK READ
MAKE
@REP 14
COPY #NERV F
@END

TJMP SKIP
LINK -3
LINK -3

MARK SKIP
@REP 6
LINK -3
@END

MARK WRITE
SEEK -9999
@REP 14
COPY F #NERV
@END

MARK H
COPY 1 T
JUMP READ


MARK LEFT
LINK -3
LINK -3
MAKE

COPY 2 T

MARK READ2
@REP 7
COPY #NERV F
@END
SUBI T 1 T
TJMP READ2

@REP 4
LINK 3
@END

JUMP WRITE
The top half of this code handles the right-going EXAs (for H and P). H is REPL'd and sets a flag in T, while P LINKs to its node. They then read the 14 entries to a file, and, making use of the flag that was set in T, they make their way to their receiving nodes, after which they just write the data from the file. LEFT uses a copy of the file code so that afterwards it can LINK the right way without any additional logic.

After the EXAs are done they fall through into some other code that tries to do things, but it doesn't matter, by then the tests have finished.

Runs at 47/72/24, which is still 10 whole cycles away from the top percentile. Most of it wasted on walking back and forth. I think I can't get any better without involving the M register.

At this point I realized that while syncing the M register is hard with three pairs of EXAs, it's surprisingly easy with two. Since an M communication step always takes two cycles (for the first EXA to publish it and then for the second to read it), using two pairs you can send one message each cycle, as long as you make sure to alternate every cycle.

So, what if we change two of the nerves to make use of M, while keeping the 'file transfer protocol' EXA for the third one? Because walking takes so much time, it's probably best to use the file EXA for the M nerve, since that one's closest.

I'll show you the end result because my intermediates were very confusing, dirty code.



XA is the file EXA. It's now much simpler after I removed all the logic. LINK to M-CNS, read 14 values, LINK to M-HND and write them.

XB handles the two other nerves. The rightbound (top half) part simply goes to the nerves and starts reading from them. Notice that the furthest EXA is exactly one cycle off from the other one (through the LINK 3 just after the REPL, so the H nerve starts sending first, causing the P one to wait a cycle, and then send, and since there's no loops or anything, just 14 repetitions of the COPY to M, they will keep alternating.

For the left side, the two EXAs also are one cycle out of sync, but there it's required to use an actual two-cycle loop. If they read from M every single cycle, which EXA reads what becomes completely unpredictable.

This solution started off as a one-EXA one too, but I noticed that after I'd cleaned up the code, the file transfer was the bottleneck by just a few cycles. Making it into a dedicated EXA solved this by removing the need for it to REPL several times. I still had to make sure to send it ahead of XB.

Anyway, this runs at a nice score of 37/70/19.



By the way, from this solution it isn't too hard to make something that actually keeps running forever, although it'll be slightly slower.

code:
;XA

LINK 800

MARK START

LINK -3
LINK -3

MAKE
MARK READ
@REP 7
COPY #NERV F
@END

@REP 4
LINK 3
@END

SEEK -9999
@REP 7
COPY F #NERV
@END

LINK -3
LINK -3
WIPE
JUMP START

;XB

NOOP
LINK 800
REPL LEFT

LINK 3
LINK 3
LINK 3

REPL MREADLOOP
LINK 3
MARK MREADLOOP
@REP 9
COPY #NERV M
@END
JUMP MREADLOOP


MARK LEFT
LINK -3
LINK -3
LINK -3
REPL MWRITELOOP
LINK -3

MARK MWRITELOOP
@REP 9
COPY M #NERV
NOOP
@END
JUMP MWRITELOOP
All I did was put a big loop around XA that resets it, and also make XB's MREADLOOP an actual loop. This means every so often MREADLOOP takes an additional cycle, so I had to unroll the MWRITELOOP to the same amount, and add a NOOP so the 2-cycle read keeps working. The REP amounts don't really matter as long as the read/write REPs within each EXA are the same. The above code runs at 49/74/24 in case you're interested.


I have the top percentile score in cycles and activity, but didn't quite get it in size. As always it'll be interesting to see what you come up with.

Do you ever feel like it's a losing battle?
This constant effort to maintain your physical body.




The first vote.

Next time, we'll finally get to take a look at this video game Isadora got us from Japan, a game for the Sawayama WonderDisc console. Let's see what Ember has to say.

WonderDisc games are restricted by region locks.
Why?




And that's the second vote.

biosterous
Feb 23, 2013




stay in the moment / business reasons

silentsnack
Mar 19, 2009

Donald John Trump (born June 14, 1946) is the 45th and current President of the United States. Before entering politics, he was a businessman and television personality.

Entropy always wins eventually, and I guess "business reasons" supposed to be a euphemism for money?

Carbon dioxide posted:

I feel like this might be the right approach to get to the smallest size. There's actually some duplicate code in there. But I can't quite figure out how to get rid of it.
There's a trick we can employ here where we blind-fire a bunch of clones that either crash or accomplish their goal (which requires the solution also has to be slow so it doesn't clog the network) and exploit the known distances between nodes. This lets us use a single script to do everything:
code:
LINK 800
COPY -3 X

MARK INPUT
LINK X
LINK X
COPY #NERV T
MULI X -1 X
LINK X
LINK X
MARK OUTPUT
LINK X
REPL INPUT
LINK X
REPL OUTPUT
COPY T #NERV
JUMP INPUT
274/16/548. Each input/output pair is separated by 4, 6, or 8 jumps (sending output at 2 doesn't work because the P-HND signal also hits M-HND) and to make the cycle hit all 3 inputs without saturating we have to rely on the 5 jumps between M-CNS and H-HND, then it can also go one further to P-HND

Carbon dioxide posted:

Runs at 47/72/24, which is still 10 whole cycles away from the top percentile. Most of it wasted on walking back and forth. I think I can't get any better without involving the M register.

Here we can do some shenanigans that rely on something from the zine: "nerve voltages oscillate around -70mV but can spike up to 50 or down to -120" but here if we look at the testdata M shows all the characteristics but I think this is the first time we've seen sensory nerves like H and P that always stay near -70. Why is that useful? It means they're all 2-digit numbers and always have the same sign, but EXAs can handle 4-digit variables, at which point you can probably guess where this is going...
code:
;XA
LINK 800
LINK -3
LINK -3

MARK M_LOOP
REPL NERV
JUMP M_LOOP

MARK NERV
COPY #NERV X
COPY #NERV T

@REP 4
LINK 3
@END
COPY X #NERV
COPY T #NERV

;XB
;NOOP
LINK 800
LINK 3
LINK 3
LINK 3
REPL HND_LOOP
LINK 3

MARK HND_LOOP
REPL NERV
JUMP HND_LOOP

MARK NERV
MULI #NERV 100 X
ADDI X #NERV M

;XC
;NOOP
;NOOP
LINK 800
LINK -3
LINK -3
LINK -3
REPL CNS_LOOP
LINK -3

MARK CNS_LOOP
NOOP
REPL CNS_LOOP

COPY M X
SWIZ X 43 #NERV;DIV  100
SWIZ X 21 #NERV;MOD -100
25/39/47 if we comment out the NOOPs and just assume the EXAs start moving in order of XA,XB,XC

GuavaMoment
Aug 13, 2006

YouTube dude

Carbon dioxide posted:



Anyway, this runs at a nice score of 37/70/19.

Very easy to tweak this to save two cycles - have XA do a file copy of 7 length instead of 14, replicate an exa to do it again, and transfer 7 digits over at a time. It's a little faster because now you have two exas who can read and copy values at the same time instead of one doing everything. 35/56/21

I have a 24 line solution that has two exas cycling between the nodes on the left and right, transmitting (or receiving) one value before moving to the next node. 155/24/115

silentsnack continues to otherwise kick my rear end.

silentsnack
Mar 19, 2009

Donald John Trump (born June 14, 1946) is the 45th and current President of the United States. Before entering politics, he was a businessman and television personality.

GuavaMoment posted:

silentsnack continues to otherwise kick my rear end.

TBF quite a few times you've posted solutions better optimized than mine, in one stat or another, and it might not have been obvious but in going back through the game I've used some tricks derived from your posts, which I probably never would have thought up on my own. :v:


edit: ...or in some cases we've independently come up with the same technique, like this one

GuavaMoment posted:

Very easy to tweak this to save two cycles - have XA do a file copy of 7 length instead of 14, replicate an exa to do it again, and transfer 7 digits over at a time. It's a little faster because now you have two exas who can read and copy values at the same time instead of one doing everything. 35/56/21

silentsnack fucked around with this message at 01:52 on May 1, 2022

GuavaMoment
Aug 13, 2006

YouTube dude

silentsnack posted:

TBF quite a few times you've posted solutions better optimized than mine, in one stat or another, and it might not have been obvious but in going back through the game I've used some tricks derived from your posts, which I probably never would have thought up on my own. :v:

I completely understand. When I did the Spacechem LP, often times rather average middle of the pack solutions had a really clever idea inside it, just not perfectly optimized. It was always fun to find those and show them off.

This level was one I knew there were way better solutions, I just couldn't get there. I'm feeling pretty good about my solutions for the next level, even before I go off one more time to see if I can improve (first I have to figure out what the hell I did since I never annotate anything).

Nth Doctor
Sep 7, 2010

Darkrai used Dream Eater!
It's super effective!


Everyone eventually loses / Big corporations always want control...

Anaxite
Jan 16, 2009

What? What'd you say? Stop channeling? I didn't he-
Everyone eventually loses / Big corporations always want control

Carbon dioxide
Oct 9, 2012

Part 25 - Sawayama WonderDisc

=== Trash World Inbox ===

silentsnack posted:

code:
LINK 800
COPY -3 X

MARK INPUT
LINK X
LINK X
COPY #NERV T
MULI X -1 X
LINK X
LINK X
MARK OUTPUT
LINK X
REPL INPUT
LINK X
REPL OUTPUT
COPY T #NERV
JUMP INPUT
274/16/548. Each input/output pair is separated by 4, 6, or 8 jumps (sending output at 2 doesn't work because the P-HND signal also hits M-HND) and to make the cycle hit all 3 inputs without saturating we have to rely on the 5 jumps between M-CNS and H-HND, then it can also go one further to P-HND
Wow. That's very clever but also hard to follow code. I don't even know how to simply explain it in my own words. Basically, the same EXAs are doing double duty and the different REPLs make sure at least one ends up in the right place in the right time. The wrong ones happen to be harmless.

As for speed:

silentsnack posted:

Here we can do some shenanigans that rely on something from the zine: "nerve voltages oscillate around -70mV but can spike up to 50 or down to -120" but here if we look at the testdata M shows all the characteristics but I think this is the first time we've seen sensory nerves like H and P that always stay near -70. Why is that useful? It means they're all 2-digit numbers and always have the same sign, but EXAs can handle 4-digit variables, at which point you can probably guess where this is going...
code:
;XA
LINK 800
LINK -3
LINK -3

MARK M_LOOP
REPL NERV
JUMP M_LOOP

MARK NERV
COPY #NERV X
COPY #NERV T

@REP 4
LINK 3
@END
COPY X #NERV
COPY T #NERV

;XB
;NOOP
LINK 800
LINK 3
LINK 3
LINK 3
REPL HND_LOOP
LINK 3

MARK HND_LOOP
REPL NERV
JUMP HND_LOOP

MARK NERV
MULI #NERV 100 X
ADDI X #NERV M

;XC
;NOOP
;NOOP
LINK 800
LINK -3
LINK -3
LINK -3
REPL CNS_LOOP
LINK -3

MARK CNS_LOOP
NOOP
REPL CNS_LOOP

COPY M X
SWIZ X 43 #NERV;DIV  100
SWIZ X 21 #NERV;MOD -100
25/39/47 if we comment out the NOOPs and just assume the EXAs start moving in order of XA,XB,XC
This looks quite similar to my fastest solution. There's two differences: the first is that XA (the one moving M-CNS data) has REPLs running back and forth instead of my file solution. By storing signals in both X and T and using REPLs this is much faster, and puts the bottleneck on the M solution. The second, as silentsnack hinted, is by compressing two nerve signals into one M signal. Since the compression/decompression arithmetic takes slightly longer, it uses REPLs to make sure a signal goes through every cycle, doubling the signal speed.

About my 37 cycle solution:

GuavaMoment posted:

Very easy to tweak this to save two cycles - have XA do a file copy of 7 length instead of 14, replicate an exa to do it again, and transfer 7 digits over at a time. It's a little faster because now you have two exas who can read and copy values at the same time instead of one doing everything. 35/56/21
I noticed when I tried a hybrid of my solution and silentsnack's, that once you hit 35 the bottleneck shifts from the M-CNS to the other EXAs. So, your simple change basically optimizes XA as much as possible in my solution.


There was also an interesting discussion in the thread about learning from each other's solutions. Yes, I've been doing that during this LP as well, many of your ideas went into later puzzle solutions. I don't remember all your ideas nor do I know how to apply some of them in specific situations, but it has helped me come up with better solutions overall.


=== Sawayama WonderDisc - Drive Controller ===

Last time, I fixed my hand.

Do you ever feel like it's a losing battle?
This constant effort to maintain your physical body.




One vote for "stay in the moment", and if I interpreted the votes correctly, three for "everyone eventually loses".

Everyone eventually loses.

I wonder if I'm the same way.
Only time will tell.




Ah, yes, definitely the music industry. I had nothing to do with this.



So, to play that game Isadora got me, I'll need to disable the region lock on the Sawayama.

WonderDisc games are restricted by region locks.
Why?




Two votes for "business reasons" and also two for "big corporations". Time to get out the two-sided die again.

Business reasons, I guess.

Artificial scarcity?
You wouldn't want gamers importing titles too easily.
The less effort it takes, the less special it is.
Hmm.



OST: Getting Started

Let's see what I have to do.
- Modify your WonderDisc, which normally only plays SSEA region games, to play games from any region.
- The SSEA region code is available in file 300.
- It is not necessary to leave no trace. Your EXAs should be written to operate indefinitely.
- For more information see "Hardware Hacks: Sawayama WonderDisc" in the second issue of the zine.




Okay, so make a copy of whatever it needs from the disc but overwrite its region code. But first I need to unlock the system using that key in the zine.

Let's start with that then, so I can see what I'm dealing with.

code:
LINK 800
COPY 8 #AUTH
COPY 0 #AUTH
COPY 3 #AUTH
COPY 2 #AUTH
COPY 7 #AUTH
COPY 1 #AUTH
COPY 0 #AUTH
COPY 4 #AUTH
COPY 9 #AUTH
COPY 5 #AUTH
COPY 1 #AUTH
COPY 2 #AUTH
COPY 5 #AUTH
COPY 2 #AUTH
COPY 6 #AUTH
This is going to be the fastest way to unlock it. No intermediate files or anything, just hardcode the key.

The key gets filled in on that display in the DISC host, and... I'm in.



A whole lot of track files. Remember, the little lock icon after the file id means you can't move or change them (which makes sense for read-only game discs). The files contain four-digit numbers, with the region code interspersed. I have to find the right track, make a copy in the buffer host with the updated region code, and repeat.

I am going to need the M register no matter what, because copying a file with a single EXA would require dropping it and picking up the copy repeatedly. So let's just get the data to the BUFFER host directly.

Replacing the region code is a bit tricky because it requires fiddling with the limited set of EXA registers. I'll first get the file copy code itself working. After unlocking the disc:

code:
MARK NEXT
REPL WRITER

COPY #TRAK X
LINK 801
GRAB X
MARK RDLOOP
COPY F M
JUMP RDLOOP

MARK WRITER
LINK 800
MAKE
MARK WRLOOP
COPY M F
NOOP
TEST MRD
TJMP WRLOOP
MARK END
DROP
LINK -1
JUMP NEXT
Send a writer to the BUFFER. Then the main EXA reads the track number, goes to the disc, and starts copying. It'll die when it reaches EOF. The writer needs to know when it's done (otherwise it'll get stuck waiting for an M signal that never comes), and uses TEST MRD for that. Since it takes a cycle between M signals an extra NOOP is required, making that loop a bit slow, but it works. When it's done, it drops the file, goes back to the central debug host, and starts over again.





As soon as a file is dropped in the BUFFER, this unusual black EXA comes out of the Reality Processor, grabs the file, and takes it in. The processor notices the file has the wrong region and it'll throw an error.

But... that makes me wonder, can I mess with that black EXA and just take over entirely?



Turns out you can kill it, but this fails the assignment.
Doing so nets us the DISC_READ_ERROR steam achievement, with description "It was just doing its job...". Now I'm feeling bad.

Anyway, the final thing I need to do is overwrite the region code. Now, I considered doing that while copying the file. But that's hard. You can't check directly against M because that will "use up" M. Using X as an intermediate won't work either, because I need a place to store the new region code. And I can't use T because I need to test if a value needs replacing. Let's instead go through the file a second time to change the code.



Ignore that useless HOST command, I just wanted to know what that host was called.

To save a cycle, XB reads the region code into M and XA stores that into X once the disc is unlocked. Once the writer is done, it will REPL a new reader/writer, while it holds on to the file and overwrites the region code with the new one in X. Note that TEST F > -9999 can be used to test if something is text. This test will be true for any valid number (except -9999 but that doesn't occur in these files), but comparisons between text and numbers always return false.

Let's run it.



Hm. Looks like when a small file follows a big file, the small file is sometimes processed before the big one, and the Sawayama doesn't like getting tracks out of order.

An easy fix would be to only handle one file at one but I don't want to slow the code down that much. You know, I'm basically using F as an intermediate register now, can't I inline the region update anyway?

code:
;XA

LINK 800
COPY 8 #AUTH
COPY 0 #AUTH
COPY 3 #AUTH
COPY 2 #AUTH
COPY 7 #AUTH
COPY 1 #AUTH
COPY 0 #AUTH
COPY 4 #AUTH
COPY 9 #AUTH
COPY 5 #AUTH
COPY 1 #AUTH
COPY 2 #AUTH
COPY 5 #AUTH
COPY 2 #AUTH
COPY 6 #AUTH
COPY M X

LINK 800

MARK NEXT
LINK -1
REPL WRITER

COPY #TRAK X
LINK 801
GRAB X
MARK RDLOOP
COPY F M
JUMP RDLOOP

MARK WRITER
LINK 800
MAKE

MARK WRLOOP
COPY M F
SEEK -1
TEST F > -9999
FJMP OVERWRITE
TEST MRD
TJMP WRLOOP
DROP
JUMP NEXT

MARK OVERWRITE
SEEK -1
COPY X F
TEST MRD
TJMP WRLOOP
DROP
JUMP NEXT

;XB

GRAB 300
COPY F M
This is my first working solution. After every write to F, it jumps back one in the file and tests if it's the region code. If so, it'll overwrite it. Either way, it tests if there's more data waiting, if so it goes back to the loop, otherwise it drops the file and starts processing the next.



At 6487/48/94 the solution is rather slow. The top percentiles are 3293, 44 and 3. What's interesting is how far the tenth percentiles are from those numbers: 5584 for cycles and 63 for activity. This shows less people got an actual top score, so optimizing is getting much more difficult.

Anyway, I'm not that far from the low size top score.

To get to 45 I can replace the duplicate TEST MRD code with a jump, and then move the OVERWRITE elsewhere so the EXA dies by reaching the end of the code. If I do that, I can replace the DROP/JUMP with a REPL.

code:
;XA 
LINK 800
; AUTH CODE

COPY M X

LINK 800

MARK NEXT
LINK -1
REPL WRITER

COPY #TRAK X
LINK 801
GRAB X
MARK RDLOOP
COPY F M
JUMP RDLOOP

MARK OVERWRITE
SEEK -1
COPY X F
JUMP BACK

MARK WRITER
LINK 800
MAKE

MARK WRLOOP
COPY M F
SEEK -1
TEST F > -9999
FJMP OVERWRITE
MARK BACK
TEST MRD
TJMP WRLOOP
REPL NEXT
To save that last line, I had to stop thinking from the middle host and start thinking from the buffer. Move the LINK -1 from after the MARK NEXT to below the REPL WRITER. By doing so, the LINK 800 after MARK WRITER can be deleted. 6584/44/64

Wait a second, now that the OVERWRITE is a jump and then a jump back, can't I inline that too and just skip if no overwrite is necessary?

code:
MARK WRLOOP
COPY M F
SEEK -1
TEST F > -9999
TJMP SKIPOVERWRITE
SEEK -1
COPY X F

MARK SKIPOVERWRITE
TEST MRD
TJMP WRLOOP
REPL NEXT
6459/42/64, not only under the top percentile for size but also the lowest cycle count I got so far.

I don't think I can lower the size much more, so let's focus on the cycle count. Unrolls!

There's no point unrolling the reader by itself because the writer needs to do all the checks and is slower anyway. The files seem to be between 6 and 36 entries in size, always a multiple of 6. I can use that but unrolls in combination with jumps (for the overwrite) are always complex.



This solution uses the advanced REP syntax. The @{0,1} means "fill in zero for the first repetition, then 1 for the next, and keep incrementing by one." So I have a MARK SKIPOVERWRITE0, MARK SKIPOVERWRITE1 and so on in the unrolled result. This way, with the jumps it doesn't lose its place in the unroll, so no matter what, it checks for MRD every 6 repetitions. 4799/77/64.

For my next improvement I have a completely different idea. Can I parallellize the file copying? That requires the M register which is quite occupied... except we also have LOCAL mode.

You might think that won't fit in the DISC host but it does. One EXA in global mode can grab a file. Then a second EXA in local mode can grab a second file, and then a third one can use the one empty spot in the DISC to make a new file. I had some code that seemed like it would work but it got stuck when the Sawayama requested the same track twice in a row and the slowest EXA couldn't find it because the fastest was holding it.

I went through several complete rewrites before ending up with something that actually works.

It still isn't close to the top percentile but honestly, after being at it for several hours I consider this Good Enough. I'll start with XB, which has two purposes. The top half:

code:
;XB LOCAL

GRAB 300
COPY F X
DROP
LINK 800

REPL WRITER

MAKE
COPY #TRAK F

MARK ROUND
COPY #TRAK F

SEEK -2
TEST F = F

SEEK -2
COPY F M

TJMP SKIPLOCAL
COPY F M
COPY X M
COPY #TRAK F

JUMP ROUND

MARK SKIPLOCAL
COPY 0 M
SEEK 1
JUMP ROUND
First it writes the region code to X, then it goes to the DEBUG (center) host and starts reading the #TRAK register two values at a time. If they are not equal, it sends both to local M, followed by a reminder of the region code. If they are equal it sends only one, followed by a zero. In that case it does a SEEK to get to the end of the file and only reads ONE value from #TRAK. You'll see how the other EXA deals with this. First, the second part of XB:

code:
;XB cont'd

MARK WRITER
MODE
LINK 800

MARK WRITEFILE
MAKE

MARK WRLOOP

COPY M F
SEEK -1
TEST F > -9999
TJMP SKIPOVERWRITE
SEEK -1
COPY X F
MARK SKIPOVERWRITE

TEST MRD
TJMP WRLOOP
DROP
MODE
VOID M
MODE
JUMP WRITEFILE
Thw WRITER REPL works the same as before. This EXA creates it because it has time to spare while the disc is being unlocked. It listens to M in GLOBAL mode, and once it's done it waits for a LOCAL M message before starting the next file.

code:
;XA LOCAL

LINK 800
COPY 8 #AUTH
COPY 0 #AUTH
COPY 3 #AUTH
COPY 2 #AUTH
COPY 7 #AUTH
COPY 1 #AUTH
COPY 0 #AUTH
COPY 4 #AUTH
COPY 9 #AUTH
COPY 5 #AUTH
COPY 1 #AUTH
COPY 2 #AUTH
COPY 5 #AUTH
COPY 2 #AUTH
COPY 6 #AUTH

MARK ROUND
COPY M X
REPL GLOBALREADER
COPY M T
TJMP LOCALRW
LINK 800
COPY 0 M
LINK -1
JUMP ROUND
The first part of XA handles the unlock, as before. Then it reads two values from LOCAL M. The first is used by the GLOBALREADER which I'll show in a bit. The second causes a jump to LOCALRW but only if it's not zero. If it is zero (XB detected a duplicate request), instead if skips that step, and goes to the buffer to send the local message to the WRITER. This is just to sync them up again. It won't do anything until the first half of the duplicate request is completed and WRITER waits for new input.

code:
;XA cont'd

MARK GLOBALREADER
MODE
LINK 801
GRAB X
MARK RDLOOP
COPY F M
JUMP RDLOOP
The GLOBALREADER is nothing new. It switches to GLOBAL mode, grabs its file, sends the data to the WRITER and dies automatically at the EOF.

code:
;XA cont'd 

MARK LOCALRW
COPY M X
LINK 801
GRAB T
REPL LOCALWRI
JUMP RDLOOP

MARK LOCALWRI
MAKE

MARK LOCALWRLOOP
COPY M F
SEEK -1
TEST F > -9999
TJMP SKIPOVERWRITE
SEEK -1
COPY X F
MARK SKIPOVERWRITE

TEST MRD
TJMP LOCALWRLOOP
LOCALRW stays in local mode. It first gets the region code again from M (which is why XB sends it again), because the earlier stuff overwrote it. It then jumps to the DISC (importantly, after the GLOBAL one did and grabbed its file, otherwise there wouldn't be enough space), grabs its file, opening up a single space for the LOCALWRIter which is created. It then jumps into the standard read loop. The local writer works the same as the global writer, except it runs in the DISC host. Once its file is written, it runs the last bit of code:

code:
;XA cont'd

LINK -1
LINK 800
COPY 0 M
DROP
LINK -1
JUMP ROUND
Walk the file to the buffer, wait for the GLOBAL one to be done (so the tracks are delivered in the correct order), DROP its file, LINK back to the DEBUG host and start the next round of files.

So, to summarize:
- XB checks if two files can be handled at once (different IDs). If so, XA puts them both to work. Once one of them is done, it has to wait for the other so that everything stays in sync.
- If the Sawayama wants the same track twice, only the GLOBAL reader runs, slowing down the process but making sure it stays in sync.

The result is 3830/98/81 and I'm just glad I got a sub-4000 cycle count. There's no space left for unrolls since the max allowed size is 100.


Finally, the 3-activity solution is tricky, but doable.

The issue is that since you can't move EXAs around, the M register has to do a lot of duties at the same time. So I have to be smart about it.

I wrote a solution but didn't bother it optimizing for anything but activity so forgive me for my ugly code.
code:
GRAB 300
COPY F X
DROP

LINK 800

REPL WRITER

COPY 8 #AUTH
COPY 0 #AUTH
COPY 3 #AUTH
COPY 2 #AUTH
COPY 7 #AUTH
COPY 1 #AUTH
COPY 0 #AUTH
COPY 4 #AUTH
COPY 9 #AUTH
COPY 5 #AUTH
COPY 1 #AUTH
COPY 2 #AUTH
COPY 5 #AUTH
COPY 2 #AUTH
COPY 6 #AUTH

REPL READER

MARK TRAK
COPY #TRAK M
COPY 190 T
MARK WAIT
SUBI T 1 T
TJMP WAIT
JUMP TRAK


MARK READER
LINK 801

MARK READNEXT
GRAB M


MARK RDLOOP
COPY F M
TEST EOF
FJMP RDLOOP
DROP
JUMP READNEXT


MARK WRITER
LINK 800

REPL MCONTROLLER

MODE
MARK WRITEFILE
MAKE

MARK WRLOOP


COPY M F
SEEK -1
TEST F = 0
TJMP DONE
SEEK -1

TEST F > -9999
TJMP SKIPOVERWRITE
SEEK -1
COPY X F
MARK SKIPOVERWRITE
JUMP WRLOOP

MARK DONE
SEEK -1
VOID F
DROP
JUMP WRITEFILE


MARK MCONTROLLER
COPY M X
TEST X < 300
TJMP GLOBAL
MODE
COPY X M
MODE
TEST MRD
FJMP NEXTFILE
JUMP MCONTROLLER

MARK GLOBAL
COPY X M
TEST MRD
FJMP NEXTFILE
JUMP MCONTROLLER

MARK NEXTFILE
MODE
COPY 0 M
MODE
JUMP MCONTROLLER
It runs at 11542/81/3.

It starts with unlocking the disc like normal, and REPLing a single writer and reader. The reader is still quite simple: grab the file id which is received through M, then send all data through M, but specifically check for EOF and read the next file when it's done.

The tricky part is in the WRITER. It runs in LOCAL mode. There's an M-CONTROLLER EXA that receives all GLOBAL M messages. If it's a number under 300 (a file ID), it sends it on global M again because it was actually intended for the reader but the controller happened to intercept it. If it's anything else, the WRITER needs it, so the MCONTROLLER forwards it in LOCAL mode. Finally, if nobody is sending, the controller sends a 0 to the WRITER to let it know the file is done.

So, how do you tell the EXA reading from #TRAK that it should send a new value? That's the neat part, you don't. If you try it with M, all EXAs will intercept messages from each other and you'll end up in unpredictable inescapable loops. Instead, that EXA just has a very long countdown (190 two-cycle iterations) so it waits long enough for even the biggest file to be done.

The countdown and all M messages having to go through the controller make this solution slow.

That was a lot of work just to play one game.
Think it will be worth it?




And that brings us to our first vote.

Once again, we unlocked a special minigame. This time it isn't Solitaire. It is called HACK*MATCH.

Think the console version will live up to the arcade classic?



Here's the second vote. We'll check out the minigame next time.

Carbon dioxide fucked around with this message at 17:43 on Apr 23, 2023

Quackles
Aug 11, 2018

Pixels of Light.


It's an arcade game?

I can't really chip in here for this one. My solution is hilariously slow and large, but if it works...

GuavaMoment
Aug 13, 2006

YouTube dude
Major speed tips - the files are always multiples of 12, so unroll files into 12 long loops. I transmit the files, then go back through and replace the SSEA code. There's a third timing exa IN LOCAL MODE that exas in the buffer must communicate with first so that long files get done before short files.

code:
XA
LINK 800
COPY 8 #AUTH
COPY 0 #AUTH
COPY 3 #AUTH
COPY 2 #AUTH
COPY 7 #AUTH
COPY 1 #AUTH
COPY 0 #AUTH
COPY 4 #AUTH
COPY 9 #AUTH
COPY 5 #AUTH
COPY 1 #AUTH
COPY 2 #AUTH
COPY 5 #AUTH
COPY 2 #AUTH
COPY 6 #AUTH
LINK 801
MARK BEGIN
GRAB M
MARK LOOP
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
TEST EOF
COPY T M
ADDI X 11 X
FJMP LOOP
COPY X M
DROP
COPY 0 X
JUMP BEGIN

XB
GRAB 300
COPY F X
LINK 800
DROP
MARK NEWONE
MAKE
COPY #TRAK M
MARK LOOP
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M T
FJMP LOOP
SEEK -999
REPL NEWONE
COPY M T
LINK 800
MODE
COPY T M
MARK LOOP2
TEST F > 0
TJMP LOOP2
SEEK -1
COPY X F
JUMP LOOP2

XC
NOOP
LINK 800
LINK 800
MARK SIGNAL
COPY M T
MARK LOOP
SUBI T 1 T
TJMP LOOP
JUMP SIGNAL
2669/83/37

Your low line was better than mine, I never tried going back through a file as I'm writing it to check for the region code.

silentsnack
Mar 19, 2009

Donald John Trump (born June 14, 1946) is the 45th and current President of the United States. Before entering politics, he was a businessman and television personality.

Hacking is obviously its own reward if we're already bothering to play a goofy hacking puzzle game :v: / arcade game?

There are a couple of minor tweaks to get the solution smaller the first being to compress the auth sequence so long as the rest of the code to unpack it isn't longer than 12 more lines and/or you can have some parts perform multiple functions.

Also for making the SSEubstitution, there's an order-of-operations rearrangement that lets you can minimize read/seek operations by using internal registers edit: the second one was in fact a file I/O error because i apparently can't count all the way to loving 3 :v:

code:
;XA
LINK 800
COPY 8032 X
MARK AUTH
SWIZ X 4 #AUTH
SWIZ X 3 #AUTH
SWIZ X 2 #AUTH
SWIZ X 1 #AUTH
COPY M X
TEST MRD
TJMP AUTH

MARK READER
REPL WRITER
LINK 801
GRAB M
MARK READ
COPY F M
JUMP READ


MARK WRITER
COPY #TRAK M
MAKE
MARK WRITE_LOOP
COPY M T
COPY T F
TEST T > 0
TJMP SKIP
SEEK -1
COPY X F
MARK SKIP
TEST MRD
TJMP WRITE_LOOP

REPL READER
LINK 800

;XB
GRAB 300
COPY 7104 M
COPY 9512 M
COPY 5260 M
COPY F M
6412/37/62

GuavaMoment posted:

Major speed tips - the files are always multiples of 12, so unroll files into 12 long loops. I transmit the files, then go back through and replace the SSEA code. There's a third timing exa IN LOCAL MODE that exas in the buffer must communicate with first so that long files get done before short files.

Also the longest files are 36 entries, so you only really need at most two EOF checks. And since the file sizes are somewhat predictable, IF we use one way or another to measure how big a file is, we can add a variable delay to make short files wait a bit to make sure they don't get dropped before a previous big file... which at some point requires experimentally finding values that work

code:
;XA
LINK 800
COPY 8 #AUTH
COPY 0 #AUTH
COPY 3 #AUTH
COPY 2 #AUTH
COPY 7 #AUTH
COPY 1 #AUTH
COPY 0 #AUTH
COPY 4 #AUTH
COPY 9 #AUTH
COPY 5 #AUTH
COPY 1 #AUTH
COPY 2 #AUTH
COPY 5 #AUTH
COPY 2 #AUTH
COPY 6 #AUTH

;XB
COPY 6 T
MARK WAIT_AUTH
SUBI T 1 T
TJMP WAIT_AUTH

LINK 800
REPL READER

MARK WRITER;[MAIN LOOP]
MAKE
COPY 24 X     ;(?)
COPY M F;COPY #1/12

MARK W_LOOP
@REP 8
COPY M F;COPY #2~9/12
@END

SUBI X 8 X    ;(??)
COPY M F
TEST X = 0    ;(???)
COPY M F
TJMP SKIP_MRD
COPY M F;COPY #12/12

TEST MRD
FJMP WROTE

COPY M F;#1 OF NEXT LOOP
JUMP W_LOOP; "FREE" JUMP

MARK SKIP_MRD
COPY M F

MARK WROTE
REPL READER
REPL WRITER;[/MAIN LOOP]

LINK 800
MODE
SEEK -999
COPY X T      ;(SOMEHOW)

FJMP DATA
MARK SYNC
SUBI T 1 T
TJMP SYNC     ;(MAGIC?)

MARK DATA
@REP 2
TEST F > 0
TJMP DATA
SEEK -1
COPY M F
@END
JUMP DATA


MARK READER
COPY #TRAK T
LINK 801
GRAB T
MARK READ
@REP 18
COPY F M
@END
JUMP READ

;XC LOW-EFFORT SSEA HACK
GRAB 300
LINK 800
LINK 800
COPY F X
MARK PATCH
COPY X M
JUMP PATCH
2304/99/69 is the fastest I've managed to get without going over size limits, but if we disregard the fact it adds a bunch more lines of code there's another way around the delay, we need to employ some meta knowledge here.

My absolute fastest solution clocks in at 2265/123/1562 and is mostly the same as the 2304 version except for adding this to the end of XA, make XB/READER do @REP 36 x COPY F M and also instead of XB/WRITER and XC doing the patch substitution in the "buffer" node and simply dropping the output file directly where it's needed, they use our home machine for its extra storage space
code:
;XA
LINK 800
COPY 8 #AUTH
[...ETC...]

LINK 800
COPY 400 X
JUMP MOVEIT
MARK NEXT
ADDI M 1 X

MARK MOVEIT
TEST MRD
TJMP NEXT
REPL MOVEIT
LINK -1
LINK -1
GRAB X
LINK 800
LINK 800
COPY X M
Thanks to the fact that the first file you MAKE always has the filename "400" and the next is "401" and so on, dropping and grabbing files can be used as a control variable.

What this version does differently is that it makes the writer patch files as fast as possible and EOF-crash to drop them someplace they won't cause traffic jams and also won't get picked up at the wrong time by the output bot (which is also involved in one of the achievements). The new XA now enters a loop of spamming clones that start in buffer, run back to home to try to grab whatever the next file is supposed to be, and if they're successful they report the success so no matter which order files get finished, XA only picks up the correct one because we know which filename is supposed to come next.

silentsnack fucked around with this message at 23:56 on May 11, 2022

Carbon dioxide
Oct 9, 2012

Part 26 - HACK*MATCH

Today's update is a bit of a break from the normal puzzles. But before we go there, let's see what ideas you had for the region lock puzzle.

=== Trash World Inbox ===

GuavaMoment posted:

Major speed tips - the files are always multiples of 12, so unroll files into 12 long loops. I transmit the files, then go back through and replace the SSEA code. There's a third timing exa IN LOCAL MODE that exas in the buffer must communicate with first so that long files get done before short files.
code:
XA
LINK 800
COPY 8 #AUTH
COPY 0 #AUTH
COPY 3 #AUTH
COPY 2 #AUTH
COPY 7 #AUTH
COPY 1 #AUTH
COPY 0 #AUTH
COPY 4 #AUTH
COPY 9 #AUTH
COPY 5 #AUTH
COPY 1 #AUTH
COPY 2 #AUTH
COPY 5 #AUTH
COPY 2 #AUTH
COPY 6 #AUTH
LINK 801
MARK BEGIN
GRAB M
MARK LOOP
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
COPY F M
TEST EOF
COPY T M
ADDI X 11 X
FJMP LOOP
COPY X M
DROP
COPY 0 X
JUMP BEGIN

XB
GRAB 300
COPY F X
LINK 800
DROP
MARK NEWONE
MAKE
COPY #TRAK M
MARK LOOP
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M F
COPY M T
FJMP LOOP
SEEK -999
REPL NEWONE
COPY M T
LINK 800
MODE
COPY T M
MARK LOOP2
TEST F > 0
TJMP LOOP2
SEEK -1
COPY X F
JUMP LOOP2

XC (local)
NOOP
LINK 800
LINK 800
MARK SIGNAL
COPY M T
MARK LOOP
SUBI T 1 T
TJMP LOOP
JUMP SIGNAL
2669/83/37
Some very neat tricks in this one. You actually send the result of the TEST EOF to another EXA so two EXAs can both conditionally jump based on a single test. I don't think we've seen that before. Also, XA keeping count of the file length and getting that value through XB to XC so that XC knows how long it needs to count down for.

silentsnack improved upon this idea:

silentsnack posted:

Also the longest files are 36 entries, so you only really need at most two EOF checks. And since the file sizes are somewhat predictable, IF we use one way or another to measure how big a file is, we can add a variable delay to make short files wait a bit to make sure they don't get dropped before a previous big file... which at some point requires experimentally finding values that work
code:
;XA
LINK 800
COPY 8 #AUTH
COPY 0 #AUTH
COPY 3 #AUTH
COPY 2 #AUTH
COPY 7 #AUTH
COPY 1 #AUTH
COPY 0 #AUTH
COPY 4 #AUTH
COPY 9 #AUTH
COPY 5 #AUTH
COPY 1 #AUTH
COPY 2 #AUTH
COPY 5 #AUTH
COPY 2 #AUTH
COPY 6 #AUTH

;XB
COPY 6 T
MARK WAIT_AUTH
SUBI T 1 T
TJMP WAIT_AUTH

LINK 800
REPL READER

MARK WRITER;[MAIN LOOP]
MAKE
COPY 24 X     ;(?)
COPY M F;COPY #1/12

MARK W_LOOP
@REP 8
COPY M F;COPY #2~9/12
@END

SUBI X 8 X    ;(??)
COPY M F
TEST X = 0    ;(???)
COPY M F
TJMP SKIP_MRD
COPY M F;COPY #12/12

TEST MRD
FJMP WROTE

COPY M F;#1 OF NEXT LOOP
JUMP W_LOOP; "FREE" JUMP

MARK SKIP_MRD
COPY M F

MARK WROTE
REPL READER
REPL WRITER;[/MAIN LOOP]

LINK 800
MODE
SEEK -999
COPY X T      ;(SOMEHOW)

FJMP DATA
MARK SYNC
SUBI T 1 T
TJMP SYNC     ;(MAGIC?)

MARK DATA
@REP 2
TEST F > 0
TJMP DATA
SEEK -1
COPY M F
@END
JUMP DATA


MARK READER
COPY #TRAK T
LINK 801
GRAB T
MARK READ
@REP 18
COPY F M
@END
JUMP READ

;XC LOW-EFFORT SSEA HACK (local)
GRAB 300
LINK 800
LINK 800
COPY F X
MARK PATCH
COPY X M
JUMP PATCH
2304/99/69
Yeah, so it looks like a delay of 8 cycles per 12-entry "file chunk" makes things line up with the least time loss.

Finally, silentsnack suggested the following size improvement:

silentsnack posted:

code:
;XA
LINK 800
COPY 8032 X
MARK AUTH
SWIZ X 4 #AUTH
SWIZ X 3 #AUTH
SWIZ X 2 #AUTH
SWIZ X 1 #AUTH
COPY M X
TEST MRD
TJMP AUTH

MARK READER
REPL WRITER
LINK 801
GRAB M
MARK READ
COPY F M
JUMP READ


MARK WRITER
COPY #TRAK M
MAKE
MARK WRITE_LOOP
COPY M T
COPY T F
TEST T > 0
TJMP SKIP
SEEK -1
COPY X F
MARK SKIP
TEST MRD
TJMP WRITE_LOOP

REPL READER
LINK 800

;XB
GRAB 300
COPY 7104 M
COPY 9512 M
COPY 5260 M
COPY F M
6412/37/62
The main improvement is of course the compressed auth. I was thinking there was no way to speed up the auth which is why I got tricked into believing no optimizations in that code were possible at all. Of course a size optimization was right for the taking.


=== HACK*MATCH ===

That was a lot of work just to play one game.
Think it will be worth it?




Only got a single vote for this one.

The hacking is its own reward.

Sure. Especially when you get something tangible out of it.
Time to play!


Yes. But before I do, have I showed you my apartment recently?


OST: Apartment

The WonderDisc is running, my Redshift is set all set up, I like it.



[=plastered] yep
[=plastered] thats how it goes




My, um, assignment is to score 10000 points in this game.

Think the console version will live up to the arcade classic?



Two votes for asking for details.

It's an arcade game?

It is in Japan.
You haven't seen the cool cabinets they have?
I knew ingesting that corpus of gaming magazines would come in handy.


Alright, let's see what this game is all about.



This only pops up for a second before the game boots.

... full extent of the jam? I'm sure it'll be fine.



Since this is an arcade game, I'm presenting it to you in video format.

https://www.youtube.com/watch?v=nZ_wbxaE-Cc

After you've watched the video, here's some background information.







The music for HACK*MATCH is OST: Let'sハッキング, which translates to "Let's hack" which, honestly would've been a good title for this thread.

According to an old post I found online, the instructions page translates to:

On the left: to download the file, assemble 4 or more files of the same type by connecting them
On the right half: if you line up two of the pressure explosive, you can download all the files of the same type at the same time.

There are also three Steam achievements tied to HACK*MATCH:

- ゲーマー , for getting 10000 points
- 熟練ゲーマー , for getting 50000 points
- 究極のゲーマー , for getting 100000 points.

Anyway, let's see what Ember has to say about us getting a decent score.

Hmm.
This game isn't about hacking at all, is it?
They took a lot of dramatic license.




That's the first vote for today.




I was so caught up in that little game I almost didn't notice the knock on the door.




Got bad news.
The pharm was raided.
The cops hauled off the equipment, the sheep and the pigs, the whole thing.
It's a real shame.
It was a lot of work to genetically modify those animals.
They'll probably get culled, too.
Sad...

So is that it, then?
If there's no more medication, I can't slow the spread of the phage...
I'll be finished soon.

This might not be the end of the story, though.
The people I work with, they're looking to get their hands on the real deal now.
There's a shipment going out soon, and let's just say a lot of people with better resources than you or me want these meds.
There's going to be fireworks.

Nivas pauses for a moment to study my face.

So. Here's the offer.
If you help us grab that shipment, we'll let you buy some of it. Market price.
I know it's a lot higher than before, but it's your only choice if you still want it.
Your part should be easy too.
That is if I understand what you do correctly.
Just cut some power. Snip snip. We'll take care of the rest.
I'll send you the details. You can decide then.
Seeya.


drat. Well, I guess I have no choice but to help them.

This is something like a heist, isn't it.



And with that, we've reached the second vote.

Nth Doctor
Sep 7, 2010

Darkrai used Dream Eater!
It's super effective!


I don't know how you'd make a game about real hacking

It is a heist

Quackles
Aug 11, 2018

Pixels of Light.


Nth Doctor posted:

I don't know how you'd make a game about real hacking

It is a heist

Yes, this exactly.

HACK*MATCH tip: You can swap while holding a block to change the order of blocks up to three deep in total. It can help making some buried 4's.

berryjon
May 30, 2011

I have an invasion to go to.

Nth Doctor posted:

I don't know how you'd make a game about real hacking

It is a heist

This is not an emptyquote, it's my vote!

Carbon dioxide
Oct 9, 2012

Quackles posted:

HACK*MATCH tip: You can swap while holding a block to change the order of blocks up to three deep in total. It can help making some buried 4's.

Yes, I'm aware of that. I guess I forgot to show it off.

Anaxite
Jan 16, 2009

What? What'd you say? Stop channeling? I didn't he-

Nth Doctor posted:

I don't know how you'd make a game about real hacking

It is a heist

Same vote as well!

GuavaMoment
Aug 13, 2006

YouTube dude
The only way I found to get 100000 hackmatch points in a reasonable timeframe was to download a lua file (I think) that played for you and ran it overnight. Essentially hacking the hacking game to win a different hacking game. I found it appropriate.

Carbon dioxide
Oct 9, 2012

Part 27 - Alliance Power and Light

=== Trash World Inbox ===

Quackles posted:

HACK*MATCH tip: You can swap while holding a block to change the order of blocks up to three deep in total. It can help making some buried 4's.
Yep, good tip. I guess I forgot to show that off.

GuavaMoment posted:

The only way I found to get 100000 hackmatch points in a reasonable timeframe was to download a lua file (I think) that played for you and ran it overnight. Essentially hacking the hacking game to win a different hacking game. I found it appropriate.
I like that. Perhaps I should hack the Phage EXAs in my hand to get better at controlling the game.


=== Alliance Power and Light - Streetsmarts GIS Database ===

Hmm.
This game isn't about hacking at all, is it?
They took a lot of dramatic license.




Well, all the votes were the same this time, that makes for easy counting.

I don't know how you'd make a game about real hacking.

Hacking is inherently about manipulating systems in ways the designers didn't intend...
Whereas a game is usually a set of possibilities within accepted bounds.
It seems difficult to reconcile.


Well, this got very meta, didn't it? Let's stop for a moment and think about how Zachtronics handles this. Basically, they created a programming language and they made a set of puzzles around it. It is a purposefully constrained language, which makes otherwise easy problems surprisingly difficult. As a professional software developer, it forces me to look at seemingly familiar things in a completely different light.

I'm sure Zach had no idea of some of the solutions we came up with either. Of course, for a game like this, you need to make some concessions, such as the test cases often not being completely realistic, or us being able to game them... but I have a feeling Zach is completely fine with the latter.

I think a sandbox made out of some basic rules, together with some cleverly designed puzzles that allow multiple solutions within the constraints of the sandbox rules, makes for very good and interesting puzzle game design. This game does it well. And Breath of the Wild's shrines were designed with a similar approach. It just works. As a counter example, I'm thinking Scribblenauts, which barely constrains the puzzle solutions. This allows most levels to be solved in a way that feels too cheap. At that point it might be better to drop the puzzle elements entirely and turn it into a building game such as Minecraft.

...Anyway, that's enough of me rambling about game design.



[Ghast] you never know what a guy who thinks he can make a buck will do.



We need to help Nivas out so we can get a new shipment of the Phage medicine.

This is something like a heist, isn't it.



Another clear vote.

It is a heist.

I didn't imagine such a major operation.
Not including you, there are three separate teams.
Whoever put this together has some serious resources.
I guess that's why it costs so much.
Don't worry, I'm working on the money part.
You just do your thing.


Sure.


OST: Leave No Trace

The assignment:
- Locate the two hosts with the specified hostnames (file 300), which correspond to the target power grid substations. When you've found them, cut the power by writing a value of 0 to #POWR.
- For more information see "Network Exploration: Geographic Information Systems" in the second issue of the zine.


This is the same GIS system we dealt with before, for the restaurant review assignment (Part 22). LINK 800 for north (top left), 801 for east, 802 for south and 803 for west.

However, this time I'll have to use the HOST command to find out the name of each host. It's not possible to test against a host name directly, you first need to load the value into some register with e.g. HOST X. Another complication is that we need to find two hosts. That'll mean some more register juggling.

That said, since the grid looks exactly the same, perhaps I can reuse some code from before. It was strongly optimized for that particular case and might not work as well here, but it's a start.

code:
LINK 800

REPL SOUTH
REPL NORTH
REPL EAST
JUMP POWERSWITCH

MARK SOUTH
LINK 802
REPL EAST
LINK 802
REPL EAST
REPL POWERSWITCH
LINK 800
JUMP POWERSWITCH

MARK NORTH
LINK 800
REPL EAST
LINK 800
REPL EAST
REPL POWERSWITCH
LINK 802
JUMP POWERSWITCH

MARK EAST
@REP 2
LINK 801
REPL POWERSWITCH
@END
LINK 801


MARK POWERSWITCH
NOOP
This is the low-cycle code I wrote for the restaurant review assignment, with all the file-parsing stuff stripped out. It gets an EXA to every grid space which then jumps to the POWERSWITCH mark.

People sent in some faster solutions but I prefer to start with this one because, since I wrote it myself, I understand exactly how it works.

Next I'll need to include some new code to switch off the right substations.

But... why stop there? Can't I just switch off everything? That should be enough of a distraction to pull off the heist, right?



I just replaced that NOOP at the bottom with a COPY 0 #POWR. It seems to be working, but there's a bit of an unforeseen side effect: cutting the power to a substation also takes the EXA host offline, making it untraversable and killing any EXAs that are chilling there.



It doesn't turn out to be a problem for us, since this optimized code from the previous assignment was written such that EXAs prioritize getting everywhere before they start messing around.

But "turn off everything" doesn't work - it fails the "Leave no trace" criterion.
However, it does net us the Steam achievement "BLACKOUT", description "Trigger an excessive service outage."

For testing if an EXA is in the right host, a sensible solution is to have a value from the file in T, then do HOST X and then TEST X T. As long as we don't need to test the same value twice that should work.

I can think of two ways to handle the second value. The first is by sending another full set of EXAs round, carrying the other value. That sounds complicated though, especially with hosts potentially turning off. The other way is an EXA staying home and sending the second value on M constantly. Let's try that.



XB grabs the file, sends the first value to M once, where XA can read it before it starts replicating. It then starts sending the second value. In POWERSWITCH, XA reads the HOST to X, compares it against the T value, and if it doesn't match, it compares against M. If it still doesn't match it can just die by divide by zero.

This code does turn off the right substations. But the problem is XB hangs forever, which means test cases never finish. Apparently I can't just disconnect my home computer when it's done.

Let's think about this one for a bit. How can we solve it?
- Because I put the X=T test first, only one of the EXAs doesn't test against M. With 20 grid tiles to check, that means XB will be asked for M 19 times. I could just build a countdown. The problem is that I can't store the countdown value in T because I have to test against it, and I can't put it in X because that's where I'm sending the value from (or I'd have to SEEK in the file which is slow). I guess I could use a second EXA for the countdown that just kills this one.

- Alternatively, I could have the EXA that reaches its tile last send a message back, and have XB listen to that with MRD or something.

But what if I do neither?

I have plenty of space left to just unroll the XB loop 19 times:
code:
;XA 

LINK 800
COPY M T

REPL SOUTH
REPL NORTH
REPL EAST
JUMP POWERSWITCH

MARK SOUTH
LINK 802
REPL EAST
LINK 802
REPL EAST
REPL POWERSWITCH
LINK 800
JUMP POWERSWITCH

MARK NORTH
LINK 800
REPL EAST
LINK 800
REPL EAST
REPL POWERSWITCH
LINK 802
JUMP POWERSWITCH

MARK EAST
@REP 2
LINK 801
REPL POWERSWITCH
@END
LINK 801


MARK POWERSWITCH
HOST X
TEST X = T
TJMP OFF
TEST X = M
DIVI 0 T T 
MARK OFF
COPY 0 #POWR

;XB

GRAB 300
COPY F M
COPY F X
@REP 19
COPY X M
@END
And that works.





Not a terrible first score of 50/58/22, but the top percentiles are 20, 22 and 20, so I certainly can do better.

Let's start with activity since that one is actually already solved.

Because my solution didn't require any KILL commands it's already quite good. But if you look at the gif, you'll see this code was originally optimized to reach the farthest grid squares first. In the SOUTHbound and NORTHbound chunks of codes it first travels to the end before jumping back to check the squares right next to the starting one. All I have to do is remove that old optimization.

code:
MARK SOUTH
LINK 802
REPL EAST
REPL POWERSWITCH
LINK 802
REPL EAST
JUMP POWERSWITCH

MARK NORTH
LINK 800
REPL EAST
REPL POWERSWITCH
LINK 800
REPL EAST
JUMP POWERSWITCH
That drops us to 49/56/20. Activity's done. The only way to get it lower is if we don't need to travel to every square, but since this is the top percentile I think the test cases cover all of them.

But wait... undoing an optimization made the cycle count lower? Ha.

That just goes to show that EXA optimizations are highly context specific. Premature optimization can lead you into a trap where the optimization doesn't fit the context anymore and it's too late to notice.

Anyway, let's look at the cycles some more. I feel the main slowdown comes from the fact that XB can only send a message on M every other cycle. There's a simple way to solve that: add another EXA.

code:
;XB

GRAB 300
COPY F M
COPY F X
REPL DOUBLETHEFUN
MARK DOUBLETHEFUN
@REP 10
COPY X M
@END
KILL
31/50/21. Since one of the EXAs sends an M message once too many, I just have the other one KILL it at that point.

What about the other method of sending two EXAs everywhere, each one holding a value from the file?

After some fiddling I came up with this code.
code:
;XA

LINK 800
REPL OTHER
MARK OTHER
COPY M X

REPL SOUTH
REPL NORTH
REPL EAST
JUMP POWERSWITCH

MARK SOUTH
LINK 802
REPL EAST
REPL POWERSWITCH
LINK 802
REPL EAST
JUMP POWERSWITCH

MARK NORTH
LINK 800
REPL EAST
REPL POWERSWITCH
LINK 800
REPL EAST
JUMP POWERSWITCH

MARK EAST
@REP 2
LINK 801
REPL POWERSWITCH
@END
LINK 801


MARK POWERSWITCH
HOST T
TEST X = T
DIVI 0 T T 
NOOP
NOOP
COPY 0 #POWR

;XB
GRAB 300
COPY F M
COPY F M
27/38/39.

Having a dedicated EXA to read the file is still slightly faster than having XA do that. The two NOOPs are unfortunate, but without that there are cases when the second EXA can't make it past a switched-off host in time.

I actually don't need those NOOPs for the EXAs that go second, so the next step is to selectively remove them.
The fastest way I found was duplicating almost all the code into XB.



25/67/40.

One thing that might speed up things more if to have both EXAs traverse the grid in different orders, so they block each other less. I tried some small things but nothing seemed to work so far, so if it's possible it's more subtle than what I did. It's also quite possible that the optimizations from the threads for the restaurant review assignment work here as well, but I'll leave that for you all to figure out.


Finally, for cycle count, the first thing to do is apply my low-cycle solution from the previous assignment, starting from the 38 solution above.
code:
;XA

LINK 800
REPL OTHER
MARK OTHER
COPY M X

JUMP START

MARK EAST
LINK 801
MARK START
REPL EAST
COPY 800 T
REPL NORTHSOUTH
REPL POWERSWITCH

COPY 802 T

MARK NORTHSOUTH
LINK T
REPL POWERSWITCH
JUMP NORTHSOUTH

MARK POWERSWITCH
HOST T
TEST X = T
DIVI 0 T T 
NOOP
NOOP
NOOP
NOOP
NOOP
COPY 0 #POWR

;XB

GRAB 300
COPY F M
COPY F M
The timing changed, requiring a bunch more NOOPs. 36/30/39, not as much improvement as I would've liked.

I can save a couple lines by loading something useful in T with the DIVI and then use a countdown loop.
code:
MARK POWERSWITCH
HOST T
TEST X = T
DIVI 3 T T 
MARK WAIT
SUBI T 1 T
TJMP WAIT
COPY 0 #POWR
37/28/39

Combining the EXAs won't help. Combining COPY F M and COPY M X means you still need two COPY to X commands total (one before and one after the REPL, because files aren't copied when you replicate an EXA). And you need an additional WIPE so the file doesn't end up in the grid.

The next obvious improvement would be to implement GuavaMoment's low cycle solution for Part 22. It won't quite work as-is, though. It depended on EXAs trying to grab files and them dying if the file was already taken. Without that, they fill up some hosts entirely and get stuck in a REPL command. I tried 'fixing' that by putting some KILL commands at the end but that just causes them to kill valid EXAs holding the other substation value. Putting it in the solution where XB just sends the second value over M many times doesn't work either, because the amount of times M is requested becomes variable.

So, I will stop here and wait to see how you got a better cycle count than 25 and a smaller size than 28.

Looks like the heist went flawlessly.
Congratulations, now a criminal cartel will sell the medication you helped steal back to you for not much less than the market price.
Oh well. At least they'll let you buy it from them.
Now that this is over with, I have a question.
Is theft morally acceptable in situations like this?




The first vote.

Next time, another hacker battle, this time against deadlock.

Onto the third of the tournament battles...
Is each match against a better programmer than the last?




Is it?

berryjon
May 30, 2011

I have an invasion to go to.
It's complicated
Better is Subjective


And why does a pharmaceutical company not have emergency backup power for the inevitable refrigeration units and the like?

Adbot
ADBOT LOVES YOU

GuavaMoment
Aug 13, 2006

YouTube dude

Carbon dioxide posted:

So, I will stop here and wait to see how you got a better cycle count than 25 and a smaller size than 28.

18 cycles!

code:
GRAB 300
COPY F X
COPY F T
LINK 800
REPL TOP3
REPL TOP2
REPL TOP1
REPL RIGHT2
REPL LEFT2
REPL RIGHT
REPL LEFT
WIPE
REPL TESTT
HOST T
TEST T = X
FJMP DIE
COPY 0 #POWR
MARK TOP3
LINK 801
MARK TOP2
LINK 801
MARK TOP1
LINK 801
REPL RIGHT2
REPL LEFT2
REPL RIGHT
REPL LEFT
REPL TESTT
HOST T
TEST T = X
FJMP DIE
COPY 0 #POWR
MARK RIGHT2
LINK 802
MARK RIGHT
LINK 802 
REPL TESTT
HOST T
TEST T = X
FJMP DIE
COPY 0 #POWR
MARK LEFT2
LINK 800
MARK LEFT
LINK 800
REPL TESTT
HOST T
TEST T = X
FJMP DIE
COPY 0 #POWR
MARK TESTT
HOST X
TEST T = X
FJMP DIE
COPY 0 #POWR
MARK DIE
Put the two hosts in X and T, fill the east column, then fill every square north and south with TWO exas - one will put the HOST in X, the other in T, before testing. I know 17 cycles is possible though.

My lowest size is 25, and I know 21 is possible.

code:
GRAB 300
COPY F X
LINK 800
LINK 802
LINK 802
REPL TEST1
COPY F X
WIPE
MARK TEST1
REPL TOP
MARK TEST
REPL LEFT
HOST T
TEST T = X
FJMP DIE
NOOP
NOOP
COPY 0 #POWR
MARK TOP
LINK 801
JUMP TEST1
MARK LEFT
LINK 800
JUMP TEST
MARK DIE
I head to the most southwest node. Fill north and east, and repeat. Noops are needed for some edge cases to prevent a node from turning off before the next exa moves on.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply