generation and search of a maze with a flexible scale