aboutsummaryrefslogtreecommitdiff
path: root/src/randomart-3.bnf
diff options
context:
space:
mode:
Diffstat (limited to 'src/randomart-3.bnf')
-rw-r--r--src/randomart-3.bnf10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/randomart-3.bnf b/src/randomart-3.bnf
new file mode 100644
index 0000000..a8c075f
--- /dev/null
+++ b/src/randomart-3.bnf
@@ -0,0 +1,10 @@
1# randomart.bnf -- syntax with semantics for generating random art -*- BNF -*-
2 <expr> ::= 1 <value> | 0 "(-" <expr> ")" | 10 <binop> | 3 <trig>
3<value> ::= 1 <coord> | 2 <mouse> | <time> | <const>
4<coord> ::= "(4*abs(c.x) + abs(c.y))/2"
5<mouse> ::= "sqrt((m.x - c.x)*(m.x - c.x) + (m.y - c.y)*(m.y - c.y))"
6 <time> ::= "sin(t)" | "cos(t)"
7<const> ::= "." <digit> <digit> <digit> <digit> <digit> <digit>
8<digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | 3 "9"
9<binop> ::= 1 "(" <expr> " + " <expr> ")" | 0 "(" <expr> " - " <expr> ")" | 1 <expr> "*" <expr> | 0 "(" <expr> "/" <expr> ")"
10 <trig> ::= "sin(" <expr> ")" | "cos(" <expr> ")"