solutions = { [[return input:upper()]], [[return input:lower()]], } local left, right = input:match('^(.*)=(.*)$') if not left then return "Please enter a transformation example, e.g. abc=ABC" end input = left -- so the solutions get the right input for _, code in ipairs(solutions) do f = load(code) log("loaded code: "..tostring(f)) s = f() -- TODO: use pcall log("result: "..tostring(s)) if s == right then return "Solution found:\n\n"..code end end return "Sorry, no solution found..."