# This file generates random drawings by generating SVG elements.
# Note that the system doesn't have to know anything about SVG, or even random numbers.
# Numbers are generated by combining multiple digits (note that we skip zero).
# We generate lots of elements by using nested elements (100objects contains 10 "10objects" which contain 10 "objects").
#
# Save this as a HTML file and open the result in your browser.
#
#   python choicewords.py examples/svg.txt > drawing.html

root:
- <svg width="500" height="500" style="border: 1px solid DarkSlateGrey">{{ 100objects }}</svg>

100objects:
- {{ 10objects }}{{ 10objects }}{{ 10objects }}{{ 10objects }}{{ 10objects }}{{ 10objects }}{{ 10objects }}{{ 10objects }}{{ 10objects }}{{ 10objects }}

10objects:
- {{ object }}{{ object }}{{ object }}{{ object }}{{ object }}{{ object }}{{ object }}{{ object }}{{ object }}{{ object }}

object:
-  <rect x="{{ pos }}" y="{{ pos }}" width="{{ size }}" height="{{ size }}" stroke="{{ stroke }}" stroke-width="{{ size }}" fill="none"/>
-  <circle cx="{{ pos }}" cy="{{ pos }}" r="{{ size }}" stroke="{{ stroke }}" stroke-width="{{ size }}" fill="none"/>

# Positions can range from 11 to 499.
pos:
- {{ digit }}{{ digit }}
- 1{{ digit }}{{ digit }}
- 2{{ digit }}{{ digit }}
- 3{{ digit }}{{ digit }}
- 4{{ digit }}{{ digit }}

# Sizes can range from 11 to 99.
size:
- {{ digit }}
- {{ digit }}{{ digit }}

# Use HTML color names. We could replace this with hex colors if we want.
stroke:
- CornflowerBlue
- Cornsilk 
- Crimson 
- FireBrick
- DarkSlateGrey

digit:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
Add an example that generates SVG drawings.
Add an example that generates SVG drawings.
