move prune onto same line, just fiddling now...
This commit is contained in:
parent
237014dec8
commit
217e04c12b
1 changed files with 3 additions and 6 deletions
|
@ -8,12 +8,9 @@ defmodule Day22 do
|
||||||
|
|
||||||
def next(secret) do
|
def next(secret) do
|
||||||
secret
|
secret
|
||||||
|> then(fn secret -> (secret * 64) |> mix(secret) end)
|
|> then(fn secret -> (secret * 64) |> mix(secret) |> prune() end)
|
||||||
|> prune()
|
|> then(fn secret -> div(secret, 32) |> mix(secret) |> prune() end)
|
||||||
|> then(fn secret -> div(secret, 32) |> mix(secret) end)
|
|> then(fn secret -> (secret * 2048) |> mix(secret) |> prune() end)
|
||||||
|> prune()
|
|
||||||
|> then(fn secret -> (secret * 2048) |> mix(secret) end)
|
|
||||||
|> prune()
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def mix(num, secret), do: Bitwise.bxor(secret, num)
|
def mix(num, secret), do: Bitwise.bxor(secret, num)
|
||||||
|
|
Loading…
Reference in a new issue