corrected debug mode + end sound

This commit is contained in:
Theon-1
2023-09-25 13:55:57 +02:00
parent be2e3fc320
commit 6f65edb144
2 changed files with 11 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ include("plot.jl")
using XXhash using XXhash
using Serialization using Serialization
using Combinatorics using Combinatorics
using WAV
function options() function options()
println("scanForPolycubes(MaxSize::Int64): scans for Polycubes of size <=MaxSize") println("scanForPolycubes(MaxSize::Int64): scans for Polycubes of size <=MaxSize")
@@ -15,13 +16,17 @@ end
function scanForPolycubes(MaxSize::Int64, debug::Bool=false) function scanForPolycubes(MaxSize::Int64, debug::Bool=false)
T = deserialize("julia/results.bin") T = deserialize("julia/results.bin")
n = T[1] n = T[1]
if (~debug & MaxSize <= n) return end if (~debug && MaxSize <= n) return; end
@time begin
D = Dict{UInt, ImmutableOrientedPolycube}() D = Dict{UInt, ImmutableOrientedPolycube}()
singletonCube = getCube() singletonCube = getCube()
immutableCube = getImmutableOrientedPolycube(singletonCube) immutableCube = getImmutableOrientedPolycube(singletonCube)
D[immutableCube.hash] = immutableCube D[immutableCube.hash] = immutableCube
evaluatePolycube(singletonCube, D, MaxSize) evaluatePolycube(singletonCube, D, MaxSize)
end
if (~debug) serialize("julia/results.bin", sanitize(D, MaxSize)) end if (~debug) serialize("julia/results.bin", sanitize(D, MaxSize)) end
y, fs = wavread("julia/background-error.wav")
wavplay(y, fs)
end end
function evaluatePolycube(polycube::Polycube, D::Dict{UInt, ImmutableOrientedPolycube}, MaxSize::Int64) function evaluatePolycube(polycube::Polycube, D::Dict{UInt, ImmutableOrientedPolycube}, MaxSize::Int64)

BIN
julia/background-error.wav Normal file

Binary file not shown.