Spectral Harmonographs
This Python + Pygame program draws the trace of 4 decaying sine waves, 2 per axis, with rainbow colours. It… read more Spectral Harmonographs
Harmonograph in Pygame
You may have seen those devices at the Science Museum or Exploratorium or Techniquest… There’s a drawing surface and some… read more Harmonograph in Pygame
Number guessing game
The number guessing game incorporates several simple but important elements of elementary programming and is a good candidate for an… read more Number guessing game
Popular Sorting Algorithms
Sorting is probably the most common type of algorithm in programming. A sorting algorithm puts elements of a list in a certain… read more Popular Sorting Algorithms
Stars and Stripes
A variation on the Stars and Stripes American Flag for Independence Day. It’s an exercise in the use of transparency in… read more Stars and Stripes
Animated Tower of Hanoi
The Tower of Hanoi is a classic problem that lends itself well to a recursive solution. The story involves some… read more Animated Tower of Hanoi
Rainbow Flag in Pygame
This little Pygame program paints the Rainbow Flag, as used by the LGBT movement. It illustrates: Importing the Pygame library… read more Rainbow Flag in Pygame
A Quick Introduction to Python 3 Programming
This Quick Introduction to Python 3 aims to teach you just enough Python, so that you can get started in… read more A Quick Introduction to Python 3 Programming
Drawing Fractals with Lindenmayer Systems
Lindenmayer systems, or L-systems, provide a very powerful way to construct fractals. Lindenmayer used L-systems to describe the behaviour of… read more Drawing Fractals with Lindenmayer Systems
A Fake Circle made of Straight Lines
Inspired by this post on Reddit, I wrote this little script to do the same thing. The circle is an… read more A Fake Circle made of Straight Lines
Tweetable Python Code Golf
Code Golf is the amusement of writing as short as possible a program to perform a given task. So for… read more Tweetable Python Code Golf
Playing in Python with Pickover’s Premise per Pi
My favourite tweeter is Clifford A. Pickover. His tweets are delightful nuggets of math, physics & more. I have a copy… read more Playing in Python with Pickover’s Premise per Pi
A Graphical Dice Simulator
This PyGame program simulates the roll of a die (or dice if you prefer). It’s a fairly simple, straightforward thing… read more A Graphical Dice Simulator
Fast Mandelbrot Set by QuadTree
Most Mandelbrot Set programs proceed along the display area, pixel by pixel horizontally, row by row from top to bottom…. read more Fast Mandelbrot Set by QuadTree
A Python Dictionary
This is simply a dictionary of Python keywords, implemented as – of course – a Python dictionary! Dictionaries are key:value… read more A Python Dictionary
Extensible Harmonograph
Often seen in science museums, the harmonograph is a device that combines wave motions (e.g. from some pendulums) to move… read more Extensible Harmonograph
Editors & IDEs
A text editor is all very well for simple notes, but for programming the basic text editor will quickly become… read more Editors & IDEs
Make ‘Computer Music’ with a very small program!
This is a fun little program to generate ‘computer music’, specifically ‘bytebeats’ which sound like the chip music featured in the early… read more Make ‘Computer Music’ with a very small program!
Easy Graph Plotting with Pyplot
Graphs (also known as charts) are an indispensible visual aid for conveying a lot of data in an easy-to-digest form…. read more Easy Graph Plotting with Pyplot
Compute Average Heights
This is a simple program to compute average heights. In a loop, it prompts the user for heights, inputs a text… read more Compute Average Heights
Binary Search
Binary Search is one of the most fundamental computer algorithms. Given an ordered list of some data (names, numbers, …)… read more Binary Search
Random Walk
A colourful random walk. The basic idea is very simple: choose a random heading in the range 0:360 degrees. Step… read more Random Walk
Turtle Star
A very simple Turtle program. Turtle can draw intricate shapes using programs that repeat simple moves. Turtle graphics is a… read more Turtle Star
Sierpinski Triangle, drawn by a Turtle
This is a classic fractal drawn with a recursion algorithm and Turtle graphics. The Sierpinski Triangle’s sides are bisected and… read more Sierpinski Triangle, drawn by a Turtle
















