Consider a collection of blocks and several tables. A block A can be in the box or on
one of the tables at a given time. While on a table, a block A can be on the surface of the table or
on top of another block B. The following actions are possible:
- put a block A on a table;
- put a block A on top of a block B.
Note that putting a block on a table is possible if the block is in the box or on top of another block
on the same table. As well, putting a block on top of another block requires the former block to be
on the same table as the latter. Finally, there is a limit to the number of blocks one can have on
the surface of a given table.
Your task is to write a Julia program that fulfils the following functionality:
- accepts a user input that defines the world (how many blocks and how many tables) and a
goal (final layout of blocks on the tables) and generates a plan1
to achieve the goal;
- accepts a user input that defines the world, a goal and the current configuration (the current
layout of blocks on the tables) and generates a plan to achieve the goal.