The Let's Play Archive

EXAPUNKS

by Carbon dioxide

Part 33: The Wormhole

Part 33 - The Wormhole

=== Trash World Inbox ===

I finished Equity First Bank with 88, 40 and 2.

GuavaMoment posted:

code:
XA local
GRAB 301
COPY F M
COPY F T
LINK 800
LINK 800
COPY T M
WIPE

XC local
GRAB 300
COPY F X
SEEK 999
COPY M F
LINK 800
LINK 800
COPY M T
REPL CALLER
MODE
SEEK -1
COPY F X
SEEK -1
MARK BACK
COPY M F
COPY X F
COPY 1 F
COPY 0 F
JUMP BACK
DROP
KILL
KILL
GRAB 199
SEEK 999
COPY 300 F
MARK CALLER
GRAB 199
MARK CALLING
REPL FILEHOLD
COPY F M
NOOP
JUMP CALLING
MARK FILEHOLD
GRAB M
MODE
COPY F M
SEEK 999
COPY X F
COPY T F
COPY 1 F
COPY 0 F

XB
LINK 800
LINK 800
COPY 25 T
MARK WAIT
SUBI T 1 T
TJMP WAIT
NOOP
KILL
KILL
GRAB 199
SEEK 999
COPY 300 F
There's what looks like a clumsy write of CREDIT only to grab it again later, but that exa isn't the bottleneck. I try not to use conditionals since you need registers to store other information; this means I need a timing exa to kill things later.
60/59/8. Yeah, the lack of conditionals definitely speeds things up here. Some specific timing to get the parallellism right and you get a fast solution.

silentsnack posted:

As for low-cycle solution, sending the number from accounts making withdrawals can be parallelized but at some point the JUMP operation in the file300 write routine imposes a speed bottleneck, so it's possible to save a few cycles by partially unrolling that loop.
code:
;XA
LINK 800
LINK 800
GRAB 199
COPY M X;GET OUR ID#

MARK INDEX
COPY F T
REPL WITHDRAW
TEST EOF
FJMP INDEX

COPY 300 F
@REP 6
NOOP
@END
KILL
HALT

MARK PWN
MODE
COPY T M;SEND THEIR ID#
;THEN CRASH

MARK WITHDRAW
GRAB T
COPY F T
REPL PWN
SEEK 99
COPY X F
COPY M F;GET "DEBIT"
COPY 1 F
COPY 0 F

;XB
GRAB 300
LINK 800
LINK 800
COPY M X;GET "CREDIT"
COPY F M;SEND OUR ID#
MODE
SEEK 99
MARK DEPOSIT
@REP 4
COPY M F;GET THEIR ID#
COPY X F
COPY 1 F
COPY 0 F
@END
JUMP DEPOSIT

;XC
GRAB 301
COPY F M;SEND "CREDIT"

COPY F X
COPY 17 T
REPL TIMER

MARK WHAT
COPY X M;SEND "DEBIT"
JUMP WHAT

MARK TIMER
SUBI T 1 T
TJMP TIMER
KILL
47/67/6
Another important aspect of this solution is that sending their ID is done by a REPL'd EXA, which means that the 'withdraw' EXAs aren't ever blocked by the one holding Ember's file.

Cycle count all the way down to 47, but silentsnack also managed to save another line of code.

silentsnack posted:

It's tough to optimize size since it requires making tradeoffs, like if you write "300" before scanning the account list you don't need to TEST EOF which means you can use the T register for storage, but it requires SEEK
code:
;XA
GRAB 300
COPY F X

LINK 800
LINK 800
REPL DIRECTORY
COPY M X
SEEK 99
MODE
MARK DEPOSIT
COPY M F
COPY X F
COPY 1 F
COPY 0 F
TEST MRD
TJMP DEPOSIT
KILL

MARK WITHDRAW
GRAB M
MODE
COPY F M
SEEK 99
COPY X F
COPY T F
COPY 1 F
COPY 0 F

MARK DIRECTORY
GRAB 199
SEEK 99
COPY 300 F
SEEK -99
COPY M T
MARK INDEX
REPL WITHDRAW
COPY F M
NOOP
JUMP INDEX

;XB
GRAB 301
COPY F M
COPY F M
66/39/3
Yeah. In my 40-lines solution I went for a single EXA, because COPY F M followed by COPY M X in another EXA is two lines for what could be done in one. This solution offsets that by not needing a DROP, nor needing the COPY T X to get 'DEBIT' in a safe place after handling 'CREDIT'. It also helps that the DEPOSIT EXA, which doesn't really need T for anything else could do the TEST MRD to check if we're done, while another EXA actually reads from M.


=== The Wormhole ===

Defrauding the bank...
That's textbook crime, isn't it?
Not to worry, your secret's safe with me.




Everyone voted for the same answer.

Wait, you're part of this too.

Maybe, but they can't arrest me, can they?
Having a physical body is your liability.


That is a surprisingly good point.



[hydroponix]: yeah same
[Ghast] I bet we all have.


While I was talking with Nivas, Ember installed something on my PC.



Happy birthday! I bought a new piece of software for you.



I didn't put this one up for a vote since the dialog doesn't change anyway.

It's not my birthday?

This is a virtual network creation tool.
You can use it to design your own networks.
Maybe you could get someone to try to hack your designs too.
It's all installed and ready to go...
The only non-pirated program on your computer.


I'd just like to interject for a moment - what you're referring to as 'pirated' is in fact free/libre...

In other words, we have just unlocked the level editor. Let's take a quick look.



There are two tabs, the Personal Networks is where you can make your own creations, and the Remote Networks is where you can play other people's levels.




If you choose to edit a level, this actually takes you out of the game and opens a javascript file in your default text editor. It has a link to the documentation, which is written from an in-universe perspective, nice.

The language is quite straightforward, you set up hosts, links between them, files, registers and test cases. You write a description and set the winning goals and that's it. Honestly, just giving people access to the underlying level design language makes a lot of sense, it's a lot less work than making a visual editor and Zach could safely assume that people who made it to this point know how to program.

Anyway, once you finish a level, you can play it yourself in the game, and once you solve it you're allowed to upload it to the Steam Workshop. That's also where you download levels from.



The game even keeps histograms and top percentiles for custom levels.

A regular playthrough of this game is already time-consuming enough as it is, so I'm not planning to show off any custom levels in this LP. Time to return to the regular schedule.

The level editor "level" doesn't seem to have any outro text from Ember. Unusual, even the Redshift sandbox mode had that.




However, I have now filled out the shortcuts bar to the right. From top to bottom, the Russian solitaire game, the Redshift dev kit, HACK*MATCH, and the VirtualNetwork+ level editor.




Next up, a hacker battle against x10x10x

If you keep on winning, they'll eventually have to accept that you're back.



One vote for "It doesn't really matter", three for "I never really left".

I never really left...

But you kind of did.
Enough to make them wonder about you.
That's why you need to prove yourself again.
Time to win.



OST: Getting Started

The assignment:
To win this battle you must fill the network's hosts with as many of your EXAs as you can. Note that each pair of test runs has its own unique network layout, with bi-directional links between hosts that use the prime numbers between 2 and 13 as link IDs (2, 3, 5, 7, 11, and 13).
- Gain one point for every EXA you control in the network at the end of the battle.
- 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.


A rather different kind of hacker battle, you get points by having more EXAs at the end. The EXA limit is set to 100 which is way more than the number of spaces in the network.

They aren't kidding about the different layouts. The second test looks the same as the first but with my and x10x10x's hosts swapped. The third one looks completely different.



Letting x10x10x do their thing without any EXAs on my side, their strategy is very similar to what I had in mind as well. REPL a lot of EXAs, have them try each possible link ID to spread through the network, and also REPL and pause them indefinitely to fill up each host.
code:
LINK 800

MARK REPLICATE
REPL TWO
REPL THREE
REPL FIVE
REPL SEVEN
REPL ELEVEN
REPL THIRTEEN

MARK INFINITE
REPL INFINITE

MARK TWO
LINK 2
JUMP REPLICATE

MARK THREE
LINK 3
JUMP REPLICATE

MARK FIVE
LINK 5
JUMP REPLICATE

MARK SEVEN
LINK 7
JUMP REPLICATE

MARK ELEVEN
LINK 11
JUMP REPLICATE

MARK THIRTEEN
LINK 13
JUMP REPLICATE
The main EXA makes a REPL for each possible link ID. If it's invalid the REPL will die, otherwise it will start replicating from the new host. After that it will start infinitely replicating itself.




You can see in the 99th cycle that the fight is quite balanced, with x10x10x having just one EXA more than I do.




In the second test I win, apparently because my EXAs managed to fill up that one host before x10x10x could make one that could jump to 13 and that whole side area.




I don't know how my code differs from the opponent's but apparently this is good enough to win all but 4 tests.

But can I do better?

Well, I noticed a small problem with the infinite loop. Yes, each REPL created through it makes another one, but the original one falls through to MARK TWO and most likely dies as most hosts don't have a link 2. If I put a JUMP INFINITE directly under the REPL INFINITE, both EXAs will start replicating and I change linear growth into the much faster quadratic growth.

And that's enough to outrun x10x10x entirely, since the result is an S+ with 100 out of 100 wins.

You still aren't saying anything in the chat room.
Don't you think they might want to hear from you?




That brings us to the first vote.

I've collected a lot of data now, but my understanding remains incomplete.



And the vote for the intro of the upcoming level.

Since there's no further optimization possible for these hacker battles, time for the third nonogram.



As always, use spoiler tags when you post your solution so others can have a go too.




Now that I've posted all nonograms, here's the full page, together with the inside of the back cover. Don't mess with EXAs.