A grammar is defined that handles strings of symbols.

Axioms define the initial string of symbols. Here F -- F -- F will be the starting point.

Rules allow some symbols to be rewritten ( through substitution). Thus F may be rewritten as F + F -- F + F.

Some symbols have a predefined meaning to be used in the final stage.


A number of directions defines an angle value. Here 306/6 = 60.

  • Step 0- Start from the axioms : F -- F -- F
  • Step 1- Each symbol on the left-hand side of a rule (lhs) is rewritten to the string in the rule's right-hand side. A new string of symbols is obtained : F + F -- F + F -- F + F -- F + F -- F + F -- F + F
  • Step 2- To this result string, the very same rewriting rules are applied.
  • Step 3- and so on...
  • The result string of symbols is interpreted according to the predefined meanings. Thus  F means move forward one unit, + means rotate one angle unit to the right, - means rotate one angle unit to the left.