Skip to content

Instantly share code, notes, and snippets.

@jballanc jballanc/crash.jl
Created Jun 25, 2016

Embed
What would you like to do?
function f(x)
if x > 0
unshift!(f(x-1), 1)
else
[1]
end
end
function crash(low, i, high)
try
println("Trying $i")
f(i)
crash(i, i + ((high-i)÷2), high)
catch StackOverflow
if i == high
println("No crash")
else
crash(low, low + ((i-low)÷2), i)
end
end
end
crash(i) = crash(0, i/2, i)
crash(10000000)
#crash(0,108812,1000000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.