just realized there are no lists, only arrays :(
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
include("ImmutableOrientedShape.jl")
|
||||
|
||||
function main(i::Int8)
|
||||
S = Stack{Int}();
|
||||
function main(i::Int64)
|
||||
D = Dict{ImmutableOrientedShape}()
|
||||
S = Stack{Int64}();
|
||||
end
|
||||
|
||||
main(Int8(4))
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
|
||||
struct ImmutableOrientedShape
|
||||
cubes::List{Tuple{Int8, Int8, Int8}}
|
||||
cubes::Vector{Tuple{Int8, Int8, Int8}}
|
||||
hash::UInt
|
||||
end
|
||||
|
||||
Base.hash(S::ImmutableOrientedShape) = S.hash
|
||||
Base.hash(S::ImmutableOrientedShape, h::UInt) = S.hash ⊻ h
|
||||
|
||||
function Base.==(X::ImmutableOrientedShape, Y::ImmutableOrientedShape)
|
||||
if hash != hash
|
||||
return false
|
||||
elseif X.cubes == Y.cubes
|
||||
return false
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
module Powerset
|
||||
|
||||
global _calculatedPowerSets = Matrix{Int64}(undef, 1, 0)
|
||||
|
||||
@@ -3,7 +3,7 @@ include("SortingModifiers.jl")
|
||||
struct Shape
|
||||
cubes::Set{Tuple{Int8, Int8, Int8}}
|
||||
recentCubes::Set{Tuple{Int8, Int8, Int8}}
|
||||
orderedLists::Array{List{Tuple{Int8, Int8, Int8}}}
|
||||
orderedLists::Vector{Vector{Tuple{Int8, Int8, Int8}}}
|
||||
end
|
||||
|
||||
function trypush!(S::Shape, t::Tuple{Int8, Int8, Int8})
|
||||
@@ -21,36 +21,32 @@ end
|
||||
|
||||
function getCube()
|
||||
return Shape(
|
||||
{
|
||||
(0, 0, 0)
|
||||
},
|
||||
{
|
||||
(0, 0, 0)
|
||||
},
|
||||
{(0, 0, 0)},
|
||||
{(0, 0, 0)},
|
||||
[
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0),
|
||||
(0, 0, 0)
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
[(0, 0, 0)],
|
||||
])
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user