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 ofdicerollπ-v,--versionβ returns the version ofdicerollβ-r,--randomβ uses/dev/randomfor random number generating π₯-u,--urandomβ uses/dev/urandomfor 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 normalstdininput 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. hence3d6means "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 to1. if the second number is not a number, but a percentage sign (%), then the number of sides becomes100(for a percentage roll). if this is not included in the dice string, then the default is1d6. 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 string6x3d6. 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*100returns a number in the range of300-1800, because3-18is the range for3d6and the result is then multipled by100. (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+1results in a range from2-5(1-4for the die, plus1). 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 therolldiceprogram π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 π²πβ¨π
π¦ where this page comes from
- debian bookworm: rolldice 1.16-1+b3 Β· GPL-2.0-only
- debian trixie: rolldice 1.16-1+b4 Β· GPL-2.0-only
- ubuntu jammy: rolldice 1.16-1build1 Β· GPL-2.0-only
- ubuntu noble: rolldice 1.16-1build3 Β· GPL-2.0-only
- ubuntu questing: rolldice 1.16-1build3
- ubuntu resolute: rolldice 1.16-1build4 Β· GPL-2.0-only
- ubuntu stonking: rolldice 1.16-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms