# You can't really run nix code like this. What I've been doing is pasting it into the REPL, after I've already imported nixpkgs using `:l <nixpkgs>`.
let calcScore = roundFunction: lib.lists.foldr builtins.add 0 (builtins.map (x: let O = (lib.strings.charToInt (builtins.elemAt x 0)) - 65; M = (lib.strings.charToInt (builtins.elemAt x 1)) - 88; in roundFunction O M ) (lib.lists.init ( (builtins.map (x: (lib.splitString " " x)) (lib.splitString "\n" (builtins.readFile ./input.txt)))))); v1 = (O: M: 1+M+(lib.mod (4+(M - O)) 3)*3); v2 = (O: M: 1 + (lib.mod (3 + O + M - 1) 3) + M * 3); in [(calcScore v1) (calcScore v2)]
