Skip to content

Commit

Permalink
fix bug in dice rolling: highest value was never rolled
Browse files Browse the repository at this point in the history
  • Loading branch information
lkeegan committed Feb 14, 2024
1 parent 32ea1cb commit df2ff4c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion calculate-liam/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "calculate-liam"
version = "0.0.6"
version = "0.0.7"
dependencies = ["click", "numpy"]
authors = [
{ name="Liam Keegan", email="liam@keegan.ch" },
Expand Down
3 changes: 2 additions & 1 deletion calculate-liam/src/calculate_liam/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ def flip_coin_cli():
def roll_dice_cli(n_dice, n_sides):
click.echo("")
for d in roll_dice(n_dice, n_sides):
click.secho(f" {d} \n", bold=True, bg="red")
click.secho(f" {d} ", bold=True, bg="red")
click.echo("")
2 changes: 1 addition & 1 deletion calculate-liam/src/calculate_liam/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ def flip_coin() -> str:


def roll_dice(n_dice: int, n_sides: int):
return np.random.randint(1, n_sides, n_dice)
return np.random.randint(low=1, high=n_sides + 1, size=n_dice)

0 comments on commit df2ff4c

Please sign in to comment.