-
-
Save masak/e54c64fc2d51cdd1a0b7 to your computer and use it in GitHub Desktop.
Doing with ints what I used to do with Strs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my int $s = 0b111111111; | |
say $s.fmt("%024b"); | |
repeat until $s == 0b111111111000000000000000 { | |
my int $t = $s; | |
my int $u = 0; | |
for ^23 -> int $i { | |
if $t % 0x4 == 0x1 { | |
$s = (($t +& 0xFFFFFC +| 0x2) +< $i) +| $u; | |
last; | |
} | |
elsif $t +& 1 { | |
$u = ($u +< 1) +| 1; | |
} | |
$t +>= 1; | |
} | |
say $s.fmt("%024b"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment