Open steven-pereira opened 2 years ago
I think it's going forever since you have the || case in the for loop so once uniqueTileSet is set to true the loop will be infinite.
I think you meant to use break instead of continue.
Yeah it goes forever if it never finds an open spot for sure, I actually just added a isGameBoardFull check prior to trying to adding new random random tiles.
The continue looks like leftover from a previous refactor. It's not meant as a break cause i do want to keep trying to find an empty spot.
This implementation in general was a quick one at the time. I'll clean it up :)
Love this by the way! :)
There's an edge case that's causing the random tile generator to fail.