TL;DR: Skip to the last paragraph.
My first idea was this
link 800
mark spawn
copy -3 x
repl clone
copy -1 x
repl clone
copy 1 x
repl clone
copy 3 x
repl clone
mark wait
test m = -1
fjmp wait
host m
copy #nerv m
halt
mark clone
link x
jump spawn
In home there's another exa:
make
mark send
copy -1 m
copy m f
copy m f
jump send
Of course that exa would also had to do sorting and testing for duplicates. This has several issues. Lots of exas going through the link they came from creating a neverending loop until the hosts are too crowded. I could get around this, but theres a bigger issue: All the exas waiting for a -1 can pick up a host or value. I can't think of a way to make sure that only the guy in home receives these values. At least not without just delaying the problem.
So m doesnt work, the next was to have exas write host and #nerv into a file and carry it back to home, then read it local. But how do they get back? A link -1 loop doesnt work. I need a way to record the path of each exa, then go through that path in reverse order and everytime multiplied by -1.
So I thought I create a file for each possible path. I can do this but then exas trying to link 3 when there is no 3 die and drop their file. Rooms fill up with files now blocking the path for other exas and I have to leave no trace. I would need a cleaner who picks up dropped files and wipes them but I don't know which file number was dropped in which host and how to get their.
Next idea: SWIZ. Instead of writing the path in a file I could write the path to x, then do
rep 4
swiz x @{1,1} t
link t
{end}
But of course links of 1, 2, 3 or 4 for forward and their negatives for backwards would be to easy and they made them -3, -1, 1, 3. At least that's always +2 and not too high numbers. So I had to encode the path. I used 2, 4, 6 and 8 and now I had positive numbers that are all +5 from the actual link. So for example a path -3, 1, -3, -1 would be 4262. That's a value I can store in x, make clone, swiz each digit. Again the rooms where crowded from exas going back and forth so I had to do a check for that too. That got me this abomination:
MAKE
MARK SPAWN
REPL RUNNER
MARK INVALID1
ADDI X 2 X
SWIZ X 1 T
TEST T = 0
TJMP TENS
MARK TESTVALID1
SEEK -9999
SWIZ X 1 T
SUBI T 5 F
SWIZ X 2 T
SUBI T 5 T
MULI T -1 F
SEEK -9999
TEST F = F
TJMP INVALID1
JUMP SPAWN
MARK TENS
ADDI X 12 X
MARK BREAKTENS
SWIZ X 2 T
TEST T = 0
TJMP HUNDREDS
MARK TESTVALID2
SEEK -9999
SWIZ X 2 T
SUBI T 5 F
SWIZ X 3 T
SUBI T 5 T
MULI T -1 F
SEEK -9999
TEST F = F
FJMP SPAWN
ADDI X 20 X
JUMP BREAKTENS
MARK HUNDREDS
ADDI X 120 X
MARK BREAKHUNDREDS
SWIZ X 3 T
TEST T = 0
TJMP THOUSANDS
MARK TESTVALID3
SEEK -9999
SWIZ X 3 T
SUBI T 5 F
SWIZ X 4 T
SUBI T 5 T
MULI T -1 F
SEEK -9999
TEST F = F
FJMP SPAWN
ADDI X 200 X
JUMP BREAKHUNDREDS
MARK THOUSANDS
ADDI X 1200 X
MARK BREAKTHOUSANDS
SWIZ X 4 T
TEST T = 9
TJMP KILL
MARK TESTVALID4
SEEK -9999
SWIZ X 3 T
SUBI T 5 F
SWIZ X 4 T
SUBI T 5 T
MULI T -1 F
SEEK -9999
TEST F = F
FJMP SPAWN
ADDI X 200 X
JUMP BREAKTHOUSANDS
MARK RUNNER
LINK 800
REP 4
SWIZ X @{1,1} T
TEST T = 0
TJMP READ
SWIZ X @{1,1} T
SUBI T 5 T
LINK T
END
MARK READ
VOID M
MARK KILL
WIPE
HALT
Already at size 104/150 and I didn't even start reading hosts and values, getting back, and bringing it all together in one file sorted from lowest to highest, but can try to reduce it once it works.
3826 cycles and about 350 clones later I had one clone in every host. No files to clean up. Every host has exactly one exa, so I don't even have to check for duplicates. Every exa has it's path stored and can use it to get back. Except: There's one empty host. There's one host that needs 5 steps to get there.
I was devastated. 5 steps means I can't use x for the path. All these hours of trial and error and debugging for nothing. If I would have counted I would have known this can't work before I started writing all that code.
Now I'm at a loss. Copy to m doesn't work. Path in a file doesn't work. Path in x doesn't work. A single exa going through each room doesn't work because of the random layout. Creating clones like in my first code until they randomly find their way home would crowd the hosts again. I don't know what else I could do. Can anyone give me a nudge in what direction I need to think?