Update readme and fix flake build

main
mat ess 2023-08-13 18:05:42 -04:00
parent 774e97260a
commit 84def6f0b3
3 changed files with 46 additions and 29 deletions

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ __pycache__
.coverage
.hypothesis
.direnv
result

View File

@ -6,26 +6,38 @@ for initiative!
```bash
$ roll 2d20
1 ..... 15
2 ..... 9
total | 24
throwing 2d20:
1: ┆ 8
2: ┆ 6
total: ╰╶╶ 14
$ roll 5d4+2
1 ..... 2
2 ..... 2
3 ..... 4
4 ..... 1
5 ..... 3
mod .. +2
total | 14
throwing 5d4+2:
1: ┆ 3
2: ┆ 4
3: ┆ 2
4: ┆ 4
5: ┆ 1
mod: ┆ +2
total: ╰╶╶ 16
$ roll # defaults to 1d20
throwing 1d20:
1: ┆ 20
total: ╰╶╶ 20
critical hit!
$ roll advantage # or roll adv, roll a
throwing 2d20 with advantage:
1: ┆ 3
2: ┆ 14
total: ╰╶╶ 14
$ roll disadvantage # or roll dis, roll d
throwing 2d20 with disadvantage:
1: ┆ 1
2: ┆ 19
total: ╰╶╶╶ 1
critical miss!
$ roll 1d20
1 ..... 1
total | 1
```
## todo
- [x] roll with (dis)advantage
- [x] print criticals
- [x] use property testing

View File

@ -15,11 +15,22 @@
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
perSystem = { config, self', inputs', pkgs, system, ... }:
let
package = pkgs.python3.pkgs.buildPythonApplication {
buildPkgs = builtins.attrValues {
inherit (pkgs.python311Packages)
hatchling
tomli
;
hatch = pkgs.hatch.override {
python3 = pkgs.python311;
};
};
package = pkgs.python311.pkgs.buildPythonApplication {
pname = "roll";
version = "0.1.0";
src = ./.;
format = "pyproject";
nativeBuildInputs = buildPkgs;
};
in
{
@ -35,15 +46,7 @@
${config.pre-commit.installationScript}
echo "welcome to your python project >~(:)=====--" 1>&2
'';
nativeBuildInputs = builtins.attrValues {
inherit (pkgs.python311Packages)
hatchling
tomli
;
hatch = pkgs.hatch.override {
python3 = pkgs.python311;
};
};
nativeBuildInputs = buildPkgs;
buildInputs = builtins.attrValues {
inherit (pkgs)
autoflake
@ -54,6 +57,7 @@
inherit (pkgs.python311Packages)
ipython
;
roll = package;
};
};
};