Time for action – putting it all together

Follow the given steps:

  1. Create a Windows application. Call it TilO.
  2. Add nine button controls. Also add one label control and one pictureBox control, as shown in the following screenshot. Add large borders to buttons ("10"), make them flat, and name them as follows:
    Time for action – putting it all together
  3. Add the following variables in the Form1.cs:
    bool mute = false;
    int totalMoves = 0;
                    
    List<Tuple<int, int, int>> board = new List<Tuple<int, int, int>>();
    Dictionary<int, Button> buttons = new Dictionary<int, Button>();
  4. Add the following methods to draw the board properly. You can customize the colors:
    private void DrawBoard() { int emptyIsAt = board.First(t ...

Get .NET 4.0 Generics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.