Bogo logic, completely rewritten in Lua with experimental ideas.