C
C#7mo ago
luness

Npuzzle

Hi! im pretty new to programming so im wondering if someone could help me out! I got this comment from my teacher regarding my code " The StartGame() method in Board is buggy. I suggest to replace it with a constructor for the class Board which takes the parameter Size as input. The in the Main function you can just create an instance of a given size without asking to the player.", ive tried to fix it by creating the construction and changing the program.cs file however the program seems not to work as it should everytime.
1 Reply
TheBoxyBear
TheBoxyBear7mo ago
What do you mean by it not working? What happens and what is expected? Otherwise, FillTiles seems a bit odd creating the instance ahead of time. It could be created within the loop, even storing it in a variable declared in the loop. With the current approach, an extra instance is created and discarded every time.
Want results from more Discord servers?
Add your server