I would like to copy one list to another:
list1=
[[0,0,1,0,0],
[0,1,0,0,0],
[0,1,0,0,0],
[0,1,0,0,0],
[0,1,0,0,0]]
list2=
[[2,2],
[2,0],
[2,0]]
If you look at it, list two looks like a tetris "L". My objective is to copy this "L" part to list one in way that the part would change list one by writing 2's in the part place. So the list1 after copying would look like:
list1=
[[2,2,1,0,0],
[2,1,0,0,0],
[2,1,0,0,0],
[0,1,0,0,0],
[0,1,0,0,0]]
OR
list1=
[[0,0,1,0,0],
[0,1,0,0,0],
[0,1,2,2,0],
[0,1,2,0,0],
[0,1,2,0,0]]
ETC.
As I need to place more parts (only one solution, as puzzle), I was thinking about using recursive function.
list1= [[0,0,0,0],
[0,0,0,0],
[0,0,1,0]],
list2= [[2,2],
[2,0]],
list3= [[3,3],
[3,0],
[3,0]]
list4= [[4,4],
[0,4],
[0,4]]
List 1 should look like:
list1= [[3,3,4,4],
[3,2,2,4],
[3,2,1,4]]
IT NEEDS TO WORK AUTOMATICALLY. Any ideas?