I'm working on a project where I need to find the distance between up to 2000 points in 3D space.
It takes a lot of time on the nSpire CX calculator, so I wanted to make a progress bar, showing how far it was in the process.
Here is the code for the loading:
- Code: Tout sélectionner
function getMaxDist()
maxDist = 0
for i = 1,molTable["nAtoms"] do
for j = 1,molTable["nAtoms"] do
local dist = math.sqrt((molTable[i]["x"] - molTable[j]["x"])^2 + (molTable[i]["y"] - molTable[j]["y"])^2 + (molTable[i]["z"] - molTable[j]["z"])^2)
if dist > maxDist then
maxDist = dist
end
end
end
end
It's not finished, but you get the idea.
But I'm not able to update the screen while I'm inside the loop.
It only updates once it has finished.
Is there any possible way to make a loading bar in LUA on the nSpire CX?
regards
Frederik