user interface - Given a grid, subdivide into n pieces of different shapes and sizes algorithm -


there's game ios, unblock me, takes given grid/board , subdivides grid blocks of different sizes , shapes.

could give me push algorithm accomplish such task like? given grid, subdivide grid smaller pieces, blocks in unblock me include squares rectangles. still want figure out myself i'm having trouble getting started.

edit:

also ideally solution leave no empty space within original grid, have been subdivided in such way spots being used given # of subdivisions.

you can have few standard block sizes , defined grid size. instance, going unblock me example: grid_size can 4*4, block_size1 can 3*1, block_size2 can 2*1 etc. can define, or alternatively take input, number of blocks want in grid. use dynamic programming or recursive backtracking fill in grid these many blocks.


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -