Skip to content

Instantly share code, notes, and snippets.

@MartinZikmund
Last active December 13, 2020 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MartinZikmund/bfd9f870c0982cb2d953f2357124c93a to your computer and use it in GitHub Desktop.
Save MartinZikmund/bfd9f870c0982cb2d953f2357124c93a to your computer and use it in GitHub Desktop.
private GameState _gameState;
private void StartNewGame()
{
var boardSize = (int)BoardSizeNumberBox.Value;
if (_gameState?.Size != boardSize)
{
_gameState = new GameState(boardSize);
PrepareGrid();
LayoutGameBoard();
}
_gameState.Randomize();
RedrawBoard();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment