still trying to fix

This commit is contained in:
Maxime Vorwerk
2023-11-03 09:59:34 +01:00
parent 3cc7b5d102
commit 1db6a38ed6
3 changed files with 18 additions and 7 deletions

3
.gitignore vendored
View File

@@ -3,6 +3,9 @@
## ##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# Project-specific files
results.bin
# User-specific files # User-specific files
*.rsuser *.rsuser
*.suo *.suo

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")
@@ -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") println("plotPolycubes(nCubes::Int64, index::Int64=-1): plots Polycubes of size v[1], or just v[2] from the list")
end end
function scanForPolycubes(MaxSize::Int64) 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}() 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)
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.