Skip to content

Commit

Permalink
readme and example
Browse files Browse the repository at this point in the history
  • Loading branch information
comigor committed Sep 17, 2018
1 parent da86de4 commit a506eb4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Expand Up @@ -37,6 +37,21 @@ void main() {
```

One can also get (probably) useful information of roll results:
```dart
import 'package:d20/d20.dart';
import 'package:d20/roll_statistics.dart';
void main() {
final D20 d20 = D20();
final RollStatistics stats = d20.rollWithStatistics('2d8+5+5d6');
print(stats.results[0].faces);
print(stats.results[1].results);
}
```


## Supported notation
The [standard dice notation](https://en.wikipedia.org/wiki/Dice_notation) will be parsed, such as 2d8+4.

Expand Down
9 changes: 9 additions & 0 deletions example/main_statistics.dart
@@ -0,0 +1,9 @@
import 'package:d20/d20.dart';
import 'package:d20/roll_statistics.dart';

void main() {
final D20 d20 = D20();
final RollStatistics stats = d20.rollWithStatistics('2d8+5+5d6');
print(stats.results[0].faces);
print(stats.results[1].results);
}

0 comments on commit a506eb4

Please sign in to comment.