local min, max, huge = math.min, math.max, math.huge machine.counters = { ["hailstone"] = 1, ["x:27"] = 1, } function match(counters) if counters["x:6"] > 0 then acc = counters["x:6"] counters["x:6"] = max(counters["x:6"] - acc, 0) counters["x"] = counters["x"] + acc * 6 return true end if counters["x:3"] > 0 then acc = counters["x:3"] counters["x:3"] = max(counters["x:3"] - acc, 0) counters["x"] = counters["x"] + acc * 3 return true end if counters["move"] > 0 and counters["2"] > 0 then local acc = huge acc = min(acc, counters["2"]) acc = min(acc, counters["move"]) counters["move"] = max(counters["move"] - acc, 0) counters["2"] = max(counters["2"] - acc, 0) counters["x"] = counters["x"] + acc * 1 counters["move"] = counters["move"] + acc * 1 return true end if counters["move"] > 0 and counters["1"] > 0 then local acc = huge acc = min(acc, counters["1"]) acc = min(acc, counters["move"]) counters["move"] = max(counters["move"] - acc, 0) counters["1"] = max(counters["1"] - acc, 0) counters["x"] = counters["x"] + acc * 1 return true end if counters["move"] > 0 then acc = counters["move"] counters["move"] = max(counters["move"] - acc, 0) counters["hailstone"] = counters["hailstone"] + acc * 1 return true end if counters["odd"] > 0 and counters["2"] > 0 then local acc = huge acc = min(acc, counters["2"]) acc = min(acc, counters["odd"]) counters["odd"] = max(counters["odd"] - acc, 0) counters["2"] = max(counters["2"] - acc, 0) counters["x:6"] = counters["x:6"] + acc * 1 counters["odd"] = counters["odd"] + acc * 1 return true end if counters["odd"] > 0 then acc = counters["odd"] counters["odd"] = max(counters["odd"] - acc, 0) counters["hailstone"] = counters["hailstone"] + acc * 1 counters["x"] = counters["x"] + acc * 1 return true end if counters["eval"] > 0 and counters["x"] > 0 and counters["1"] > 0 then local acc = huge acc = min(acc, counters["1"]) acc = min(acc, counters["eval"]) acc = min(acc, counters["x"]) counters["eval"] = max(counters["eval"] - acc, 0) counters["x"] = max(counters["x"] - acc, 0) counters["1"] = max(counters["1"] - acc, 0) counters["2"] = counters["2"] + acc * 1 counters["eval"] = counters["eval"] + acc * 1 return true end if counters["eval"] > 0 and counters["x"] > 0 then local acc = huge acc = min(acc, counters["x"]) acc = min(acc, counters["eval"]) counters["eval"] = max(counters["eval"] - acc, 0) counters["x"] = max(counters["x"] - acc, 0) counters["1"] = counters["1"] + acc * 1 counters["eval"] = counters["eval"] + acc * 1 return true end if counters["eval"] > 0 and counters["2"] > 0 and counters["1"] > 0 then local acc = huge acc = min(acc, counters["1"]) acc = min(acc, counters["2"]) acc = min(acc, counters["eval"]) counters["eval"] = max(counters["eval"] - acc, 0) counters["2"] = max(counters["2"] - acc, 0) counters["1"] = max(counters["1"] - acc, 0) counters["x:3"] = counters["x:3"] + acc * 1 counters["2"] = counters["2"] + acc * 1 counters["odd"] = counters["odd"] + acc * 1 return true end if counters["eval"] > 0 then acc = counters["eval"] counters["eval"] = max(counters["eval"] - acc, 0) counters["move"] = counters["move"] + acc * 1 return true end if counters["hailstone"] > 0 then acc = counters["hailstone"] counters["hailstone"] = max(counters["hailstone"] - acc, 0) counters["eval"] = counters["eval"] + acc * 1 counters["@show counters"] = counters["@show counters"] + acc * 1 return true end return false end return machine