EXAPUNKS

EXAPUNKS

View Stats:
A Hint on Equity First Bank?
I can't stress this enough: If I wanted to be handed the solution, I would have clicked one of the dozens of Google results that link to someone else's code. I want to solve this puzzle; I just need a hint.

I could see someone considering this a spoiler, so I'll black it out as such.

I can't figure out how to get under the 50-line limit. My initial solution was to send five EXA's with 11 lines of code (doing it with 9 now, since I realized I can just TEST #CASH = 0 instead of SUBI X 1 X; TEST X = 0) to each of the five ATM hosts. The first test of course went fine, but after that the rooms change. So it seems like the solution is to have seven EXA's, sending one to each possible room, and any that try to go to a room that doesn't exist will just self-terminate when they try an invalid LINK.

That works, but it's 72 lines of code. I suspect the solution lies somewhere between the ideas presented in Unknown Network 1 (branching REPL's) and UC Berkeley (walking around in a circle until you find the matching file). But this is just different enough from both of those that I don't see how to put them together.

This is my first playthrough and I haven't unlocked the second 'zine yet.

If there's something in the seemingly-unrelated files that indicates which ATM hosts have spawned in each test case , I'm fine with that being spoiled. I thought of that, looked for it, and don't see it. So if I'm just not seeing what's right there in front of me, please just put me out of my misery.
< >
Showing 1-6 of 6 comments
Okay, I figured out a solution that keeps me under 50 (3009 cycles, 35 lines of code).

In case anybody else was looking for a hint, here are some.

First: I did use some REPL's.
Second: spoiler] I started with just one EXA, and it never executed most of the code I gave it (though all of it was necessary).

Third: If you really just want me to spell it out for you (my solution, anyway), read on.

I made six little code sections that look a bit like this:
I started by LINKing my EXA to the long hallway connected to all the ATM's. Then I REPL'd six more EXA's like this:
REPL 800
REPL 801
REPL 802
etc.

Each of those REPL's has its own MARK, which look like this:

MARK 804
LINK 804
JUMP DISP

the DISP section looks like this, and is the end of the file:

MARK DISP
SWIZ 20 21 #DISP
TEST #CASH = 0
FJMP DISP
HALT

At first this seemed messy to me. But I guess it's no less messy than writing nearly-identical code for seven EXA's. I still wish there was a command other than SWIZ to do "write 20 to #DISP." Though to be fair, the SWIZ command serves the purpose, so having a discreet command that works like SET X = 15 would just be redundant, I guess. Having said that, it's even more redundant to have both ADDI and SUBI. But I digress.


If you were also having trouble with this puzzle, I hope this was helpful. If there's a better way to do what I'm doing here, suggestions are welcome. I don't really care about optimizing my code to increase my score on a puzzle I've already solved, but I do care about optimizing the code I haven't written yet (meaning I'm interested in refining my methods without re-solving puzzles I've already completed, not that I want hints for the next puzzle per se).
An important thing about REPL is that they also inherit whatever values are set for registers
X and T (and MODE, but that's not relevant here).

For example, this snippet code would start copying the numbers from 0 and up to #TRGT. Each new REPL would generate an EXA whose X register had a value one higher than the previous one.

COPY 0 X
MARK LOOP
REPL EXA
ADDI X 1 X
JUMP LOOP

MARK EXA
COPY X #TRGT
HALT

Hopefully, thats enough to help you in the direction how you can use REPL a little bit more dynamically.

p.s. edited to say:
SWIZ 20 21 #DISP is a very fancy way of writing
COPY 20 #DISP

:D :D :D

p.s.2. I wrote HALT in my example code too. Do mind that in actual code, I almost *never* write HALT. I almost always just make my EXA's crash and I typically see a HALT statement as a failure to optimize.

p.s.3 To make the REPL remark totally spoilerific:
As per the manual, it's LINK R/N, not just LINK N
Originally posted by thewifiwhisperer:
SWIZ 20 21 #DISP is a very fancy way of writing
COPY 20 #DISP
Good tip! Never occurred to me to try it that way because the COPY command is presented as duplicating one value onto another, while using it this way is strictly speaking creating a value out of nothing. I just figured the SWIZ command was implemented specifically to introduce the ability to create a value that doesn't necessarily already exist somewhere on the network.

That being said, if COPY can be used this way, I'm not certain what value SWIZ actually has (don't tell me; I'm sure I'll bump into it).

Originally posted by thewifiwhisperer:
p.s.2. I wrote HALT in my example code too. Do mind that in actual code, I almost *never* write HALT. I almost always just make my EXA's crash and I typically see a HALT statement as a failure to optimize.

Hmm. I can see that perspective. Personally, I want everything to end itself cleanly because it had instructions to terminate after finishing its task, not because it received an invalid instruction, didn't know what to do, and committed suicide in a panic of uncertainty. So I almost always put a "HALT" at the bottom of my program, and if necessary I'll add a MARK DONE just above it.

Also, most missions have the explicit objective "leave no trace," which I thought meant all EXA's need to terminate. When I have to bring a file home, I suppose I could then issue a command I know will be invalid so the EXA will kill itself, but to me that feels sloppy when there's a command for "kill yourself."

But I can totally see the value in a loop that will cause an invalid command once it has outlived its usefulness. I do a lot of "if x = 0, die." To me it feels messy for that to necessarily take four lines of code (SUBI X 1 X; TEST X = 0; FJMP LOOP; HALT), so I'm going to adapt my workflow to include this idea.
Originally posted by thewifiwhisperer:
As per the manual, it's LINK R/N, not just LINK N
It seems to me that's only useful if there's a command to read the name of a link, like how the HOST command works. Then I could tell the EXA to copy that value to X, then

MARK NEW
ADDI X 1 X
REPL NEW
LINK X

Of course I'm intentionally ignoring the fact that links always seem to start at 800 and increase by one from there. If I can assume that, then I can start X at 800 and this idea will work just fine.

I suppose in theory I could start X at 0, but that would make a lot of wasteful cycles until the first REPL after X is high enough to be the name of an actual link. I care WAY more about size than cycles, but still.
This is "hacking", so although I also do try to avoid too much cheese, in this case I think knowing the range of the links to the ATMs is fine.

Also, you might want to consider going back on puzzles. Optimizing can be a lot of fun (if time consuming). For example, I thought I had hit the absolutely minimum of this puzzle with 14 lines of code.

Turns out, 13 lines of code also works! And in decent time too (3015 cycles). So, thx! Making me write down that basic example about REPL really helped me to think up a way making my loop a little bit more efficient.
Originally posted by thewifiwhisperer:
So, thx! Making me write down that basic example about REPL really helped me to think up a way making my loop a little bit more efficient.
Here for you, bro. ;)

Originally posted by thewifiwhisperer:
This is "hacking", so although I also do try to avoid too much cheese, in this case I think knowing the range of the links to the ATMs is fine.

Your absolutely right; I just don't like doing things that way. Specificity is the nemesis of good rule-making. A rule that only applies to a very specific situation is typically not a good rule, or is in fact an interpretation of a rule that actually has a much broader scope.
< >
Showing 1-6 of 6 comments
Per page: 1530 50