alleviate demo out of ui scope. its script is almost not about ui at all, and also fix a stupid omittion in puzzle_gen_interface