101010.pl is one of the many independent Mastodon servers you can use to participate in the fediverse.
101010.pl czyli najstarszy polski serwer Mastodon. Posiadamy wpisy do 2048 znaków.

Server stats:

481
active users

#dice

2 posts2 participants0 posts today

What?! No, the author, Dr. Marcus Du Sautoy, is a math PhD and should know better! Dominoes have only one representative of unequal values, but with dice there are two ways of getting that result.

For example, scoring a 9 on 2D6 has probability 4/36. But the 6-3 and 5-4 are just 2/21 of the (non-blank) dominoes! This is a terrible way to simulate a d5!

From "Around the World in Eighty Games" which wasn't great on its history but now I gotta question its math too?

After some refactoring, learning about `hatch`, moving more files around, and generally abusing `test.pypi.org`: I've uploaded `diceparse` to PyPI. Still need to update the web documentation, but it now feels like a proper project at this point.

I still need to add a CLI part so you can just roll dice after installing the package, but I'll handle that later. Also need to tweak the README.md a bit as well...

Work continues on the Dice Parser. Added a ton of features:

- Raw rolls
- Dice rerolls
- Keeping the nth lowest/highest dice

You can literally now do some craziness like "roll 10d10, reroll all rolls 3 or less, keep the two highest as fire damage, then roll 3d4, keep the lowest two values, keep those as piercing damage"

```python
dice.roll("10d10 reroll 3 keep 2[fire] + 3d4 keep -2[piercing]")
dice.roll("10d10!3k2[fire]+3d4k-2[piercing]")
```

```json
[
{
"_roll": "10d10 reroll 3 keep 2[fire] + 3d4 keep -2[piercing]",
"_total": 24,
"fire": 20,
"piercing": 4
}
]
```

Yes, this is officially a dice parsing language and even more overkill than the last version. codeberg.org/JamesTheBard/dice

Codeberg.orgdice-rollerA Python dice rolling program with a surprising number of features.
#python#ttrpg#dice

Okay, I think I'm done with the `dice-roller` code for the time being. It now supports two different "methods" for weighting dice, and I even documented all of the methods. Lot of fun to write, and it should make it into the `pathfinder2e-tui` program over the next week.

Also, very certain this is technically a dice rolling language at this point.

codeberg.org/JamesTheBard/dice

Codeberg.orgdice-rollerA Python dice rolling program with a surprising number of features.
#python#lark#dice

Okay, _now_ I'm done. Fixed a few parser errors and implemented a skew option (the `^` value) that will push the average value towards either 1 or the maximum of the dice. I like that once you get the parser up and running that it's easy to add stuff to it. I now am the official owner of a completely overkill dice running program.

For the example below, the skew is `2.0`. The random value is raised to the `1/skew` power before being multiplied by the number of sides of the die. If skew goes up, so do the results. If skew goes down, well, so do the results.

```
$ python main.py "^2 (2d6+2d8+12)[fire]+1d8[piercing]" | jq .
{
"results": {
"fire": 37,
"piercing": 7
}
}
```

You arrive to the dragons lair: In front of you stands the mighty red bearded dragon Tiamat.

To your surprise, before you can do anything, she rolls d20 intimidation check on you. Instead of cowering in fear, you check your backpack: You feel obligated to feed her blueberries.

She nods sagely at you. A wise decision.