Showing posts with label Uva - Simulation Problem. Show all posts
Showing posts with label Uva - Simulation Problem. Show all posts

Uva 101 - The Blocks Problem

Oct 1, 2015

Problem: 101 - The Blocks Problem

Explain: Let we have a box (in any time)
0: 0
1: 1
2: 2
3: 3 4 5
4:
5:
[1] move a onto b : puts block a onto block b after returning any blocks that are stacked on top of blocks a and b to their initial positions.

move 1 onto 2
0: 0
1:
2: 2 1
3: 3 4 5
4:
5:
(Note: puts block a onto block b)
move 4 onto 2
0: 0
1: 1 (return their initial position)
2: 2 4
3: 3
4:
5: 5 (return their initial position)
(note: .....  after returning any blocks that are stacked on top of blocks a and b to their initial positions)