Dominoes: Difference between revisions

Content added Content deleted
m (add another layout)
m (specify a type for vector)
Line 104: Line 104:
patterns = [(zero(tab) .- 1, Tuple{Int, Int}[], Int[])]
patterns = [(zero(tab) .- 1, Tuple{Int, Int}[], Int[])]
while true
while true
newpat = []
newpat = empty(patterns)
for (ut, ud, up) in patterns
for (ut, ud, up) in patterns
pos = findfirst(x -> x == -1, ut)
pos = findfirst(x -> x == -1, ut)
Line 182: Line 182:
6 4+5 1+5 4 1+4
6 4+5 1+5 4 1+4


0.003087 seconds (26.93 k allocations: 2.326 MiB)
0.000507 seconds (6.06 k allocations: 1.715 MiB)


0.062496 seconds (395.91 k allocations: 44.811 MiB, 11.69% gc time)
0.023503 seconds (92.66 k allocations: 35.817 MiB)
6 4 2 2 0 6+5 0
6 4 2 2 0 6+5 0
+ + + + + +
+ + + + + +
Line 198: Line 198:
+ + + +
+ + + +
6+6 5+2 5 3 3 4
6+6 5+2 5 3 3 4

2025 layouts found.
2025 layouts found.
</pre>
</pre>