From 217e04c12bde2b66d0fadac80c305c4250ad9a7b Mon Sep 17 00:00:00 2001 From: Adam Millerchip Date: Mon, 23 Dec 2024 08:08:49 +0900 Subject: [PATCH] move prune onto same line, just fiddling now... --- 2024/day22.exs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/2024/day22.exs b/2024/day22.exs index ca0c2da..e5a53f2 100755 --- a/2024/day22.exs +++ b/2024/day22.exs @@ -8,12 +8,9 @@ defmodule Day22 do def next(secret) do secret - |> then(fn secret -> (secret * 64) |> mix(secret) end) - |> prune() - |> then(fn secret -> div(secret, 32) |> mix(secret) end) - |> prune() - |> then(fn secret -> (secret * 2048) |> mix(secret) end) - |> prune() + |> then(fn secret -> (secret * 64) |> mix(secret) |> prune() end) + |> then(fn secret -> div(secret, 32) |> mix(secret) |> prune() end) + |> then(fn secret -> (secret * 2048) |> mix(secret) |> prune() end) end def mix(num, secret), do: Bitwise.bxor(secret, num)