Question: Using graphics.py in python NOT TURTLE or TKINTER draw a game board for playing chess or checkers. Its a simple grid of 8x8 squares, in

Using graphics.py in python NOT TURTLE or TKINTER draw a game board for playing chess or checkers. Its a simple grid of 8x8 squares, in which the squares alternate between two colors and the starting color in each row alternates as well, so that you end up with a checkerboard pattern.

  1. import the graphics module
  2. define the main function
  3. Use GraphWin method to create a chessboard which could be whatever the size you wish it to be. (refer to the method description in graphics.py)
  4. Use a nested while loop to draw 8 by 8 rectangles and use if else and setFill methods to set the color of the rectangles.
  5. You can use getMouse method to receive a response from mouse with close method to close the window.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!