Guess my number?

Number guessing game

1st October 2015

The number guessing game incorporates several simple but important elements of elementary programming and is a good candidate for an introductory programming example. If you’ve seen any programming course, you’ve probably seen the “Hello World” program. In Python it’s: print (“Hello World”)This is done to get the student(s) quickly to the point of having successfully installed […]

Rainbow Flag

Rainbow Flag in Pygame

29th June 2015

This little Pygame program paints the Rainbow Flag, as used by the LGBT movement. It illustrates: Importing the Pygame library RGB colours in hexadecimal Python’s for loop using the enumerate() function Filling a rectangular area in Pygame Updating display with flip() Saving the image

A Quick Introduction to Python 3 Programming

23rd June 2015

This Quick Introduction to Python 3 aims to teach you just enough Python, so that you can get started in computer programming, and try out some of the example codes on this site! First, you’ll want to install Python 3 or you can use the in-browser Trinket near the bottom of the page – just edit […]

Square Spiral

18th April 2015

This is a very simple introduction to Turtle graphics. The turtle starts in the middle of the window, moves forward a small distance, turns right, moves forward a slightly longer distance, right again, even further this time… until the distance equals or exceeds a given limit. Turtle graphics is a popular way for introducing programming […]

Naive Mandelbrot Set

17th April 2015

This is your basic Mandelbrot Set plotter. Very little effort made to speed it up, except for plotting top & bottom pixels together as they’re mirrored across the x-axis. Later I’ll show you some much faster programs! The heart of this program is the iteration of z2+c where c is a point in the complex […]