Skip to main content
1 of 5
jsh
  • 919
  • 7
  • 22

Tiling by substitution

Consider the following substitutions, where the substituted rhomb(us) is scaled up and shown in red:

A rhomb

rhomb a ... becomes ... rhomb a substitution 1

B rhomb

rhomb b ... becomes ... rhomb b substitution 1

Each substitution is made up of some combination of A rhombs and B rhombs, on which the same substitutions can be performed.

A tiling can be created by repeating the substitutions n times.

After n=2 substitutions of A rhomb:

rhomb a substitution 2

In the fewest bytes of code (given input n>=0) draw the tiling after n substitutions, where n=0 is A rhomb


Notes:

  • Substitutions are tiled without leaving gaps or overlapping.
  • The red lines shouldn't be included, they only illustrate the substitution.
  • In each substitution the tiling is scaled up so the rhombs have a constant size.
  • Any rotation is optional.
  • Graphical choices (colour, dimensions, cropping etc.) are optional if not exploited for loopholes.
jsh
  • 919
  • 7
  • 22