Skip to content

Instantly share code, notes, and snippets.

@mt-caret
Created June 28, 2019 05:50
Show Gist options
  • Save mt-caret/707702863bfebf36a0a9eaa1174efb0b to your computer and use it in GitHub Desktop.
Save mt-caret/707702863bfebf36a0a9eaa1174efb0b to your computer and use it in GitHub Desktop.
import "u256"
let popcount (n: u32): i32 =
loop ret = 0 for i in 0..<32 do
ret + u32.get_bit i n
let main: []u256.t =
map (\x ->
map (\y -> popcount (x ^ y) >= 4) (0..<2**10)
|> u256.pack
) (0..<2**10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment