Basic CTCG engine in Python (experimenting)