diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-09-05 22:51:14 -0400 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-09-05 22:51:14 -0400 |
commit | da6582f328c17e1842a4632d88e06d851e7c4b5f (patch) | |
tree | e4ff8760fc586499a22bcc6fee9f4417fccc4c4e | |
parent | e7383cc38bf2182e5ab95f30d639fe4a0317fd51 (diff) |
Update README
-rw-r--r-- | README.md | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -84,6 +84,8 @@ The parser recognizes the following grammar: | Die ' / ' Die | Die '+' Die | Die '-' Die + | Die '*' Die + | Die '/' Die | '-' Die | Die 'E' Die | Die 'e' Die @@ -116,6 +118,10 @@ Semantics are defined in terms of the `pool` function. * `D+E` is the additive bonus operation. For each die in `D`'s pool, the die is rolled and `roll(E)` is added to its result. * `D-E` is equivalent to `D+(-E)`. +* `D*E` is like `D+E` but multiplies each die in `D`'s pool the result of + rolling `E`. +* `D/E` is like `D+E` but performs integer division on each die in `D`'s pool + by the result of rolling `E`. * `DEF` (here `E` is the literal symbol `E`, `D` and `F` are dice expressions) is an "exploding die." First `D` is rolled. Now each die in the dice pool generated by `F` is rolled repeatedly until it rolls something less than the @@ -153,8 +159,9 @@ Additionally: associative. * The binary arithmetic operations bind as expected (multiplication and division bind stronger than addition and subtraction). -* The bonus operations (`+`, `-`) are left associative. They bind stronger than - arithmetic operations. +* The bonus operations (`+`, `-`, `*`, `/`) are left associative. They bind + stronger than arithmetic operations. `/` and `*` bind stronger than `+` and + `-`. * The die operations (`d`, `E`, `K`, etc.) are right associative (`1d2d3` is equivalent to `1d(2d3)`, use explicit parentheses if you need `(1d2)d3`). * Die operations bind stronger than the binary arithmetic operations |