fix bug on generate puzzle

Signed-off-by: rei <reiheart@gmail.com>