Art, design & a little curiosity
Creative coding ↗

Algorithmic art with a simple drawing instruction

Translate a written instruction into a reproducible drawing system and explore how a small exception changes the character of the entire image.

An original studio notebook study exploring algorithmic art ideas.
Studio notebook / Original digital study

An instruction with an exception

An algorithm can begin as an instruction you could hand to another person: draw a short line, turn slightly, repeat until reaching a border. Coding makes the instruction fast and repeatable, but the artistic question already exists in the rule and its permitted exceptions.

Write the ordinary rule before its exception

Write a five-line recipe before opening an editor. Define the starting point, movement distance, turning rule, stopping rule, and exception. Implement the ordinary case first. Add the exception only after you can explain the unmodified drawing from the recipe.

Keep a visible note of turn angle while assembling the first version. Work from a rough thumbnail or a small physical mockup. Mark the feature that must remain stable and the feature that is allowed to change. Those marks provide a reference when several plausible variations begin competing for attention. A useful acceptance check is whether the visible structure can be explained from the written rule. Judge that at the intended viewing size or working distance, where tiny construction mistakes and exaggerated effects can have very different consequences.

Number the first ten segments

Unexpected complexity often comes from rules affecting one another. A changed turn angle also changes when the line reaches an edge. Log a few coordinates or number the first ten segments so you can distinguish an intended interaction from an arithmetic mistake.

Check one local instance of turn angle before assuming that the whole composition needs a different approach. Temporarily show construction points and intermediate values. Reduce repeated elements to a handful and pause anything that changes over time.

Interpret the instruction by hand

Give the written recipe to someone else, or perform it manually yourself without viewing the coded result. Compare the interpretations. Ambiguous words such as near or occasionally reveal decisions that your program will require you to define.

Test a compact set of alternatives: 15, 30, and 60 degrees. Give each trial the same amount of finishing work so polish does not bias the comparison. Review them once as complete pieces and once while concentrating on the changing feature. If your preference reverses, note which artistic goal each version serves more effectively.

Make the stopping rule visible

Draw the permitted drawing area as a pale rectangle and mark the point where the next step would leave it. Decide whether the path stops before that step, clips at the boundary, or turns away. Those choices produce different edge behavior. Keep the policy in the written recipe. Otherwise a visually prominent border pattern can arise from an undocumented implementation detail rather than from the intended instruction. In the staircase example, mark the first boundary encounter to check whether the exception changes that decision.

A worked example

A wandering staircase

Create a wandering staircase that turns right after every fourth segment and reverses that turn near the canvas center. Use a strict distance threshold for near. A single localized exception can create a focal event without adding a new visual vocabulary.

References & further reading

Examples and exercises in this guide are original teaching scenarios.

Keep following the thread.

More creative coding ↗