RE: RE: [TUTORIAL] MINESWEEPER GAME - VISUAL STUDIO 2010 C#
You are viewing a single comment's thread from:

RE: [TUTORIAL] MINESWEEPER GAME - VISUAL STUDIO 2010 C#

Words
62
Reading
1 min
Listen
Play
9y

Had a quick scan through the code and like you have a nice consistent style :)

Small games like this teach you a lot.

Not sure why this stood out but thought I would point out. You had this piece of code

if (firstPlay)
{
    StartGame();
    firstPlay = false;

    widthBox.Enabled = false;
    heightBox.Enabled = false;
}
else
    if (!firstPlay)
    {
        ResetGame(width, height);
        StartGame();
    }

The second 'if' is not required the else means it will always be !firstPlay if the first 'if' fails

if (firstPlay)
{
    StartGame();
    firstPlay = false;

    widthBox.Enabled = false;
    heightBox.Enabled = false;
}
else
{
    ResetGame(width, height);
    StartGame();
}

:)

@woz.software: Had a quick scan | Ecency