In the previous exercise you have made variables that can be filled with an X or an O. We will update the application in this exercise with a variable to be able to adjust the window size.
Let’s introduce a size
variable which indicates the size of a single grid space. We can use this variable to calculate the new dimensions of our board. Initialize this variable with a size of 50
and draw the board similar to the previous exercise.
Steps:
size
variable so that the resulting window has the same size as it has now. Check if the program is still working correctly. You can use the resize(..)
method for this.size
into something rather big (e.g. 100-200). If the program works OK, the window and the board will be bigger, but the nought and crosses didn’t move with it. In the next exercise we will repair this.