#Diced - An algebraic dice notation parser in Gleam!

1 messages · Page 1 of 1 (latest)

fading perch
flat ermine
#

what kinda feedback are you after

digital hedge
#

for this example, why is the amount of dice "2" instead of "5" (or 4)

  echo diced.parse("5d20kh2kl2")
  // Ok(diced.Basic(2, 20, [diced.KeepHighest(2), diced.KeepLowest(2)]))
fading perch
#

because i'm stupid and copy pasted it

#

it does give 5 lmao

#

updated docs >w<

fading perch
# flat ermine what kinda feedback are you after

If the API feels ergonomic (I think it does but I wrote it lmao) and if anyone feels like anything is missing. There two extra parts of the "spec" (there isn't an official one afaict) which haven't been implemented, but I do eventually want to do though - being Dice Pools ({1d20, 1d10}kh) and whatever the fuck you would call this: 1d20d20

#

I left the actual rolling/randomisation to the consumer of the library, but maybe I want a function similar to this fn roll(dice: Dice, random_fn: fn(Int, Int) -> Int)? I'm not sure and just left it out because of that

flat ermine
#

a Number is like the 4 in 1d6 + 4?

fading perch
#

ah right I also don't have maths implemented, but yes it would be

flat ermine
#

outside of general feedback around me personally not knowing the notation i think you probably dont want DiceError to be opaque

fading perch
#

ah oki doki

digital hedge
#

typo: width_modifier_value -> with_modifier_value