Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- finds the number of pseudo-random vectors the LÖVE engine uses for its noise function
- -- (256 is the answer by the way, as expected)
- local results = { }
- local sequence_found = false
- local check
- check = function(results)
- local j = math.floor(#results / 2)
- for i = 1, j do
- j = j + 1
- print(results[i], results[j], results[i] == results[j])
- if results[i] ~= results[j] then
- return false
- end
- end
- return true
- end
- local i = 0.5
- table.insert(results, love.math.noise(i))
- i = i + 1
- while not sequence_found do
- table.insert(results, love.math.noise(i))
- sequence_found = check(results)
- i = i + 1
- end
- return print(#results/2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement