I am relatively new to TI-84 BASIC, and as a first project I am trying to make a maze generator. I have programmed it to be able to map with depth-first search in four directions, though I have not programmed backtracking in yet. However, whenever the program continues for long enough without running itself into a dead end, it always eventually crashes with the message ERR:Memory. Is this error caused by overloading the RAM? If I select goto from the error screen it takes me to an if statement that checks for a variable (Y) to be equal to 20. Thanks!
Date: 05 Oct 2016 21:38
Number of posts: 4
RSS: New posts
What you've got there is a memory leak. If you use Goto commands to jump out of a Repeat or While loop or a If:Then, the End that the calculator is looking for when it enters said loop is never reached and never erased. If this happens enough, these dangling Ends can fill up your ram.
Memory leaks are caused by Gotos in loops. Try not to use Gotos whenever possible.
Oh, alright. Is there a way I can have it jump to another piece of code and still end the loop? If I had end statements immediately after the label but not connected to anything before that would it work? I'm unsure of how to execute this program without this.