Blog

A blog of Python-related topics and code.

Making a maze

The Depth-first search algorithm is a simple approach to generating a maze. It is well described and illustrated in lots of places on the internet, so only an outline is given here.

DOI to BibTeX

The Digital Object Identifier (DOI) resolution service at doi.org exposes an API for retrieving the BibTeX markup for a reference given its DOI. The following Python 3 script takes a DOI on the command line and returns the BibTeX. For example,

Making word wheels

Just a small script to generate word wheel puzzles: run from the command line by giving the any number of letters (central letter first) and redirecting its output to a file. Output is as an SVG file.

The Brachistochrone problem

The Brachistochrone problem asks the question "what is the shape of the curve down which a bead sliding from rest and accelerated by gravity will slip, without friction, from one fixed point, $P_1$ to another $P_2$ in the least time?"

Solving word wheels

The Guardian is one of several newspapers which publish a daily "word wheel" puzzle: eight letters are arranged in a circle around a central letter and the goal is to make as many words as possible including the central letter and using each letter once. The words should be more than 4 letters in length.