Describing a Dragon Curve with Prolog

Опубликовано: 28 Февраль 2026
на канале: The Power of Prolog
2,685
105

The Heighway Dragon Curve can be constructed iteratively as a sequence of folds. Prolog is ideally suited for reasoning about strings, and we can use its built-in grammar mechanism (DCGs) to conveniently describe sequences of characters that represent these folds, obtaining a short and general executable definition of this famous fractal.