❔ Getting multiple output of my count in this code:https://pastebin.com/c7RsL47e
When i try to solve my puzzle with size 2 and i manage to solve it in 3 steps it prints out like this in console : "It took 3 steps to solve the puzzle
It took 0 steps to solve the puzzle
It took 0 steps to solve the puzzle"
why?
5 Replies
because you're calling
StartGame
recursively but not actually returning where necessary
will prevent it going any further in the methodo.o thank you very much man, appreciate it!
one of the dangers of recursion is that it's dangerous
hahaha trueee, gotta be careful what you're coding 🙂
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.