diff --git a/.gitignore b/.gitignore index 9491a2f..11ae725 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ ## ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore +# Project-specific files +results.bin + # User-specific files *.rsuser *.suo diff --git a/julia/PolycubeCounting.jl b/julia/PolycubeCounting.jl index 0d9ab0f..a42bdb1 100644 --- a/julia/PolycubeCounting.jl +++ b/julia/PolycubeCounting.jl @@ -4,6 +4,7 @@ include("plot.jl") using XXhash using Serialization using Combinatorics +using WAV function options() println("scanForPolycubes(MaxSize::Int64): scans for Polycubes of size <=MaxSize") @@ -12,13 +13,20 @@ function options() println("plotPolycubes(nCubes::Int64, index::Int64=-1): plots Polycubes of size v[1], or just v[2] from the list") end -function scanForPolycubes(MaxSize::Int64) - D = Dict{UInt, ImmutableOrientedPolycube}() - singletonCube = getCube() - immutableCube = getImmutableOrientedPolycube(singletonCube) - D[immutableCube.hash] = immutableCube - evaluatePolycube(singletonCube, D, MaxSize) - serialize("julia/results.bin", sanitize(D, MaxSize)) +function scanForPolycubes(MaxSize::Int64, debug::Bool=false) + T = deserialize("julia/results.bin") + n = T[1] + if (~debug && MaxSize <= n) return; end + @time begin + D = Dict{UInt, ImmutableOrientedPolycube}() + singletonCube = getCube() + immutableCube = getImmutableOrientedPolycube(singletonCube) + D[immutableCube.hash] = immutableCube + evaluatePolycube(singletonCube, D, MaxSize) + end + if (~debug) serialize("julia/results.bin", sanitize(D, MaxSize)) end + y, fs = wavread("julia/background-error.wav") + wavplay(y, fs) end function evaluatePolycube(polycube::Polycube, D::Dict{UInt, ImmutableOrientedPolycube}, MaxSize::Int64) diff --git a/julia/background-error.wav b/julia/background-error.wav new file mode 100644 index 0000000..26672f1 Binary files /dev/null and b/julia/background-error.wav differ