Tsjech
Recursive method and memory problems
I am implementing the DFS algorithm and I am keeping track of what routes have been passed and their value, the core of the algorithm looks like this:
the problem is, if the network is searching down a path and ends in a dead at the function returns at the place of my comment, but the
length
variable has been forgotten by the program (atleast what i think) because this method has been called multiple times already and is now returning to an older instance of itself. So is there any way to surpass this issue?
Nodes are planets and Edges are Routes.24 replies
❔ Need help adding a label from a child class to the screen that exists in the parent class
So im coding a board game and the board is its own class, now when the game ends I would like to show that by adding a label with some text to the screen, yet this label exists in the parent class because it takes up more of the screen than just the gameboard (which isnt the entire screen). Is there any way I can show this label only when the game ends (which is checked in the board class)? (please ask me more questions if needed this explaination is far from good :) )
242 replies