EXAPUNKS

EXAPUNKS

View Stats:
Bug with Swizzle command?
I'm at a loss here -- I'm stuck on the Redshift hack. I run the following code:

LINK 800
MARK FINDPASS
SWIZ X 0300 #PASS
SWIZ X 0020 #PASS
SWIZ X 0001 #PASS
ADDI X 1 X
REPL FINDPASS
LINK 800
MARK LOOP
JUMP LOOP

But once x hits 10, the line "SWIZ X 0020 #PASS" starts having no effect at all -- nothing even gets copied into #PASS. Is this broken, or is the description of this command in the manual wrong?
< >
Showing 1-6 of 6 comments
Your code is wrong, I used:
SWIZ X 3 #PASS
SWIZ X 2 #PASS
SWIZ X 1 #PASS
Task description says 1 digit at a time, so 0020 and 0300 masks not working is intended.
Previous posters are spot on.

By just running this code in an EXA, you can see in action what is happening with the output.

MAKE
MARK LOOP
SWIZ X 0300 F
SWIZ X 0020 F
SWIZ X 0001 F
ADDI X 1 X
JUMP LOOP

Basically, if you have the value 146, for example, you're splitting this into '100', '40' and '6'.

And that's against the accepted values of the lock, as Parker Square points out. Kalle's code will properly split it out as '1', '4' and '6'.
The thing to get around in your thinking is that the example in the zine is dumb (no offence to Ghast, but you don't make ALL your examples the same length if you want people to learn).
You don't need four digits in the output. You just put the PLACE OF THE DIGIT YOU NEED however many you need.

1133466 when parsed through SWIZ 5 will spit out a 4, because that's the fifth digit.
SWIZ 74 will spit out 63, etc.
The zeroes are used for padding purposes, as I understand it.
You count from right, 1 is the lowest digit, so SWIZ 5 will output 3, SWIZ 74 will output 13. You need trailing zeros for placing digit, SWIZ 7400 will output 1300.
I fully agree that the examples are terrible, or more precisely, the explanation is terrible. It basically just says "look at the table, and figure out for yourself what it is that swizzle does, based on these examples"

My attempt at a better decriotion would be:
Swizzle takes the relative position of a digit from the original value (counting from the right) and outputs it in the absolute position of the digit value of the mask.

A zero will return a zero.

E.g. SWIZ 6789 104 will result in in 906
swiz 6798 11 will return 88.
< >
Showing 1-6 of 6 comments
Per page: 1530 50