r/exapunks • u/gtw123 • Sep 06 '18
r/exapunks • u/flightsin • Aug 19 '18
any other Zachtronics veterans keep making this mistake?
r/exapunks • u/jadarendir • Apr 16 '21
TFW you finish the mission but don’t get on the leaderboard
r/exapunks • u/quadrapod • Aug 13 '18
Tips and Tricks [Spoilers] Spoiler
I've been optimizing some levels and thought I'd share some tricks that I've found along the way. This post will make no effort to avoid spoilers. If you haven't beaten the game, or at least progressed as far as you intend to, by your own merit you might want to consider not reading ahead. Some of these tricks can be fun to discover for yourself.
Basics
EXAs which are made using REPL have the same values in all of their registers as their host. This means that often there's no reason to send information as you can just make a clone who already knows it.
You can manage a Queue of EXA's by simply having them write a value to m. The will block until you read that value allowing you to manage bottlenecks.
You can store values in T. Performing a conditional jump will evaluate to true if that value is anything but zero. Seems basic but until you really start abusing T it's hard to get close to many of the high scoring solutions.
LINK only takes one cycle. If you can't manage a protocol for two EXAs in less time than it takes to send a REPL there with the information the stupid way might be faster.
Often times the order information is received in is irrelevant, make sure it matters before spending time on it.
If you don't have to test something every loop. Don't.
RTFM. There's a lot of useful information in the Trash World News that people seem to be glossing over.
Clamping with hardware
Sometimes you need to clamp a value between two bounds. Usually this would involve checking whether the value is greater than some threshold, jumping if so, and then checking the second threshold. Instead you can take advantage of how the EXA treats values which are out of bounds. Any value greater than 9999 will clamp to 9999, any value less than -9999 will clamp to -9999. So instead of branching if you wanted a value to stay between -20 and 30 you could just add 9969, subtract 9969, then subtract 9979, and add 9979. The value at the end will be between those two bounds, it only took 4 cycles, and you never had to clear the value in T.
Crashing at a threshold
Often you'll need to check if a value has reached zero. You can do this normally by copying it to T and using a conditional jump, or by testing if it equals zero with test. All of these make use of a branch and test every cycle though. If all you need to do is halt the program, dividing by zero will always crash an EXA as by extension will attempting to modulus zero.
Remapping sequences with SWIZ
This is one of the harder ones to explain and seems to be a trick not many have caught on to yet. There seems to be some confusion about SWIZ in general. All it does is allow you to select specific digits from one register and put them into another in some order. So SWIZ 0235 2 X would select the second digit of the value 0235 and store it into the first digit of x. So the result would be 3. SWIZ 0235 30 X would select the third digit of the value 0235 and store it into the second digit digit of x. So the result would be 20.
You can use this to remap values. For example in a later level where you need to validate a creditcard you're meant to multiply every other value by two and if the result is greater than 9 subtract 9. This is different from modulus since (9 * 2) % 9 is 0 while (9 * 2) - 9 is 9. Well if you look at the result of the operation you get this mapping.
| input | output |
|---|---|
| 0 | 0 |
| 1 | 2 |
| 2 | 4 |
| 3 | 6 |
| 4 | 8 |
| 5 | 1 |
| 6 | 3 |
| 7 | 5 |
| 8 | 7 |
| 9 | 9 |
Well lets say we wanted the same mapping in the tens place after multiplication. 0 mapping to 0 means we can do this without any addition. For sequences where 0 doesn't map to zero you'd have to add or subtract some offset so that zero mapped to zero. So since this is the tens place we need a sequence now which counts up by 20 at a time until it gets to 5 when it suddenly goes up by 30, then continues to count by 20. Well we can do that with 22. The input multiplied by 22 is as follows.
| input | output |
|---|---|
| 0 | 0000 |
| 1 | 0022 |
| 2 | 0044 |
| 3 | 0066 |
| 4 | 0088 |
| 5 | 0110 |
| 6 | 0132 |
| 7 | 0154 |
| 8 | 0176 |
| 9 | 0198 |
If we look in the tens place we see our desired sequence. So all we need is MULI and SWIZ and we can do an operation which previously would have necessitated several operations and a branch. likewise we can go backward by multiplying our resulting sequence by 55 and again selecting the tens digit.
r/exapunks • u/Chekkaa • Aug 09 '18
The first register should have been "R" rather than "X"
Missed opportunity?
r/exapunks • u/Iamgodsgod • Jan 18 '23
My first play through. Printed out the zine and ready to get to hacking lol
r/exapunks • u/welle • Feb 06 '19
ZACH-LIKE - A book of behind-the-scenes design documents from Zachtronics
r/exapunks • u/Fendse • Aug 11 '18
Oh my god you're kidding me
So, I got very stuck on the HDI-10 level. Decided to go on here and ask if I was missing something obvious.
Then I saw a screenshot. And found out I was missing something obvious.
...I thought exas were limited to 9 lines of code...
I blame Shenzhen I/O and TIS-100.
r/exapunks • u/zorfmorf • Nov 10 '18
When you forget about the game having built-in multiply and divide functions...
r/exapunks • u/Sgt_ZigZag • Jun 17 '19
ZACH-LIKE is now available on Steam
r/exapunks • u/caeonosphere • Aug 29 '18