diff options
author | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-08-30 18:27:55 -0400 |
---|---|---|
committer | Marcin Chrzanowski <marcin.j.chrzanowski@gmail.com> | 2017-08-30 18:27:55 -0400 |
commit | 13e482fefb3090645a941a643c73eadcbf0a1a34 (patch) | |
tree | 33e6da05d96eff09c36fbede4af9ad002fa7c400 /README.md | |
parent | 5087cde4825d91112cad565c68d81296359cf4d8 (diff) |
Implement division
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -81,6 +81,7 @@ The parser recognizes the following grammar: | Die ' + ' Die | Die ' - ' Die | Die ' * ' Die + | Die ' / ' Die | Die '+' Die | Die '-' Die | '-' Die @@ -109,6 +110,8 @@ Semantics are defined in terms of the `pool` function. * `D - E` is equivalent to `D + (-E)`. * `D * E` generates a dicepool with a single value - the produc of `roll(D)` and `roll(E)`. +* `D / E` generates a dicepool with a single value - the result of integer + division of `roll(D)` and `roll(E)`. * `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)`. @@ -140,7 +143,10 @@ Semantics are defined in terms of the `pool` function. Additionally: -* The binary arithmetic operations (` + `, ` - `) are left associative. +* The binary arithmetic operations (` + `, ` - `, ` * `, ` / `) are left + 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 die operations (`d`, `E`, `K`, etc.) are right associative (`1d2d3` is |