CSC121S2021Lab13

From BU Computer Science
Jump to navigation Jump to search

Lab 13 for CSC 121

Overview

You are to write a program to create random art. Your program is to allow the user to create a picture using a number of predefined shapes. The shapes are to be drawn at random locations. The user is allowed to control a number of options.

Details

  • You are to have at least two different shapes (triangle and square). Before adding any additional shapes, all other required features must be implemented.
  • When clicking on the associated shape button, that shape is to be drawn in a random location
  • Allow at least two of the following features
    1. Allow the user to specify if the shape is to be fill or not with radio buttons
    2. Allow the user to specify the number of shapes to be drawn with a click (by a text field, slider, or other option)
    3. Allow the user to specify the color to be used will filling the shape (text field is sufficient)
    4. Allow the user to specify the size of the shape by inputting a scaling factor)


Aids

  • Consider using a separate method for each feature. This is best done by creating a class for the work. I recommend getting a button to draw a single shape done first (without a class) before working on this.
  • You should (must) create the appearance of your window before you create any code. It may change as your write your code but it should have all features and where they will be before you start drawing your code.
  • For each feature, think about what needs to be done to accomplished. Write that down in English. Then find a way to code it.

Resource

https://www.geeksforgeeks.org/introduction-to-tkinter/