Skip to content
An introduction to programming with a fireworks display.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
__init__.py
all.py
boom.aif
fireworks.py
main.py
main_example.py
simple.py
skyline.png

README.md

Setup

This project depends on pygame.

# using pip
python -m pip install -U pygame --user

# for windows, may need to “cd C:\Python27” or something similar first
python.exe -m pip install -U pygame --user

# using pip command
pip install pygame

# using apt
sudo apt-get install python-pygame

Lecture Notes

Intro, what is programming

First program, hello world, demo

expressions (arithmetic)

variables (substitution)

import

Function as a blackbox

functions, greeting (print name), math.fabs/sin, degToRad

Fireworks, demo

Blackbox, diagram

Polar

(if there is time)

loops, print numbers from 1 to 10, from 1 to a, factorial (with function)

lists

  1. Black box

    Everyday examples: phone, car, ticket machines, math functions

    Example: fireworks program, give it a function that defines the shape and that defines the color

  2. Functions

    Example: just like math functions, show how to define some different shapes

  3. Control

    Example: computer makes choices (logic), show how to define color function

Lab Work

Go through one firework example together (simple.py)

Let students create their own firework shapes and colors

main_example.py has a wide variety of shapes and colors

You can’t perform that action at this time.