Something
public text v1 · immutablerequire random.fs
: sided-roll ( sides -- result ) random 1+ ;
: sided-rolls ( rolls sides -- total ) 0 -rot swap 0 ?do tuck sided-roll + swap loop drop ;
\ Example -- 2d4:
2 4 sided-rolls .
: d4 ( rolls -- total ) 4 sided-rolls ;