hex.swap (arity 2)ΒΆ
hex1, hex2 = hex2, hex1
both hex1,hex2 are hexes.
SignatureΒΆ
def swap hex1, hex2 @ end { ... }
Defined in hex/memory.fj β lines 103β109 (view on GitHub).
ComplexityΒΆ
Time:
3@+1Space:
3@+37
See the complexity glossary for what @, w, dw, dbit, n mean.
SourceΒΆ
Click to view the macro body
def swap hex1, hex2 @ end {
stl.comp_if1 hex1==hex2, end
.xor hex1, hex2
.xor hex2, hex1
.xor hex1, hex2
end:
}
Depends onΒΆ
β Previous: hex.set/3
Next: hex.swap/3 β