Blog

Viewing posts by christian

Computer-generated Mondrian art #2

This is the second post on generating images which resemble Mondrian paintings. The first post described a procedural algorithm; here I'll introduce an object-oriented approach.

Computer-generated Mondrian art #1

Inspired by Michael Fogleman's blog post from 2011, here is a Python implementation of his algorithm for generating images which resemble the paintings of Dutch painter Piet Mondrian (1872 - 1944). A slightly different, object-oriented approach will be presented in a subsequent post.

Parenthesis matching in Python

Great language though it is, Python code can lead to statements with many, deeply-nested parentheses. Here's a little program with two functions to check that the parentheses in a string match and to find the locations of the matching parentheses.