ROLLDICE(6)

πŸ’– ROLLDICE πŸ’–

okay bestie, welcome to ROLLDICE(6) from the Games Manual section β€” yes we're in the games corner of the man pages, it's giving arcade carpet energy and I'm obsessed. 🎲✨


🌸 NAME 🌸

rolldice β€” rolls virtual dice. that's it, that's the whole job, and it does it flawlessly no cap πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

rolldice [ options ] [dice_string [dice_string ...]]

✨ DESCRIPTION ✨

so like, rolldice rolls virtual dice. the dice strings you pass on the command line carry all the info about which dice to roll, in a format that's comparable to the format used in most role playing games. rpg girlies stay winning 🧚

and if you don't hand it any dice strings as command line arguments? no stress, it just uses stdin as input instead. lowkey flexible of it πŸ¦‹


πŸ’… OPTIONS πŸ’…

  • -h, --help β€” returns the usage of diceroll πŸ’–
  • -v, --version β€” returns the version of diceroll ⭐
  • -r, --random β€” uses /dev/random for random number generating πŸ”₯
  • -u, --urandom β€” uses /dev/urandom for random number generating (this one is the default, bestie, it's the main character) πŸ‘‘
  • -s, --separate β€” prints out the result of each individual die separately, as well as the operations and totals. like a full receipts moment, we love transparency 🧾✨
  • -i, --interactive β€” prompts the user to input dice strings. and here's the twist: it differs from normal stdin input in that errors do not cause the program to immediately exit, but rather return to the prompt. it's forgiving, it's gentle, it's the friend who lets you redo your order 😭🫢

🌈 DICE STRING FORMAT 🌈

the dice string uses the following format:

{#x}{#}d[#|%]{*#}{+/-#}{s#}

ok so real talk β€” the dice string doesn't have to be in the exact format outlined above, but this is the order I use. it will try to parse any different string containing the same sections in the best way it can, and will throw out anything that isn't one of the sections below. it's doing its best, okay πŸ™ˆ

  • {#}d[#|%] β€” the first number is the number of dice to roll, and the second number is the number of sides the dice have. the numbers rolled on each die are then added up and given as the result. hence 3d6 means "roll three six-sided dice, add them together and return the result". if the first number is left out, then the number of dice defaults to 1. if the second number is not a number, but a percentage sign (%), then the number of sides becomes 100 (for a percentage roll). if this is not included in the dice string, then the default is 1d6. defaults carrying the whole team fr fr πŸ’œ
  • {#x} β€” this number describes how many times to roll. for example, if you want to roll 3 six-sided dice 6 times, you use the dice string 6x3d6. this returns six numbers, corresponding to the six different rolls. six results, six vibes ✨
  • {*#} β€” this number describes how many times to multiply the result of each roll. 3d6*100 returns a number in the range of 300-1800, because 3-18 is the range for 3d6 and the result is then multipled by 100. (their spelling, not mine, I'm just the messenger πŸŽ€)
  • {+/-#} β€” this number is the modifier to be added or subtracted, depending on the sign, from each roll. 1d4+1 results in a range from 2-5 (1-4 for the die, plus 1). and IMPORTANT: this step is handled after the multiplication modifier. order matters bestie, do not skip this πŸ’…
  • {s#} β€” this number describes how many lowest dice rolls to drop. and this step is handled before the multiplication modifier. also order matters. we love a specific sequence πŸ”₯

in the order show above. for an extreme example, "3x4d6*5+1s2" would roll four six-sided dice, drop the lowest two, multiply the result by 5, add 1 to that, and repeat the process two more times, for a total of three results. that's a whole journey and honestly? iconic. πŸ†


🫢 DIAGNOSTICS 🫢

the following error messages may appear on STDERR:

  • Requested * is too large β€” memory could not be allocated while parsing the string passed to the rolldice program 😭
  • Problems with the malformed dice string β€” the dice string contains a syntax error (see upper section DICE STRING FORMAT) πŸ’€
  • Unknown option β€” an unknown command-line option was provided πŸ™ˆ

the exit values returned by rolldice follow the BSD convention. periodt. πŸ‘‘


πŸ’œ AUTHOR πŸ’œ

Stevie Strickland <sstrickl@ccs.neu.edu> β€” thank you for your service, legend πŸ«‘πŸ’–


⭐ VERSION ⭐

1.16 - 18 Dec 2012


and that's the whole page bestie!! this one's a Linux situation, dated 16 Oct 2015, and it lives in section 6 with all the other games. now go roll some dice, you absolute main character πŸŽ²πŸ‘‘βœ¨πŸ’