auto generation of puzzle with simple logic