This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Coding Brain Activated's profile picture

Crash due to Function?

Started by Coding Brain Activated, 06 December 2013 - 01:46 PM
Coding Brain Activated #1
Posted 06 December 2013 - 02:46 PM
Hello, I'm not a new programmer, I sorta know the basics and some of the advanced things.
There seems to be a problem with the in-development GiantMath API.

Pastebin http://www.pastebin.com/pJG7xzCR

The functions involved are align and add.
If you run the API, a tiny test is run.
Two tables, num and num2, are called. Their values are "4, 3, 2, 1" and "2, 3, 9, 6"
Then a variable, num3, is equal to add(num, num2), then the problem sets in.

Before ANYTHING EVER HAPPENS, the add function suddenly malfunctions, causing a few seconds delay before the computer finally crashes.

If it works fine, I apologize, since I created this program on the already-dead CCDesk (Computercraft Emulator) project application.
Otherwise, help would be appreciated.
Bomb Bloke #2
Posted 06 December 2013 - 05:39 PM
One line 50 you redeclare "i" as local to the "while" loop. This means it keeps getting reset and the loop never ends (so ComputerCraft eventually decides your script has stalled and crashes it for you). Remove "local" from that line.