A CLI dice rolling program written in C++

lotus cad1f976c9 Merge branch 'master' of https://git.zerohack.xyz/lotus/dnd-dice 1 month ago
include 43a925397f Added debug and optimized build targets, refactored in preparation for adding unit tests, renamed some files to be more consistent. 2 months ago
tests 43a925397f Added debug and optimized build targets, refactored in preparation for adding unit tests, renamed some files to be more consistent. 2 months ago
.clang_complete f1e21752a1 added more paths to clang_complete depending on lib version 2 months ago
.gitignore e834a280b5 complete revamp of application, wrote docs, included makefile 6 months ago
.travis.yml 6fc4951820 added travis config and updated readme with badge 1 month ago
LICENSE.md e834a280b5 complete revamp of application, wrote docs, included makefile 6 months ago
README.md 6fc4951820 added travis config and updated readme with badge 1 month ago
compile_commands.json 43a925397f Added debug and optimized build targets, refactored in preparation for adding unit tests, renamed some files to be more consistent. 2 months ago
die.cpp 43a925397f Added debug and optimized build targets, refactored in preparation for adding unit tests, renamed some files to be more consistent. 2 months ago
dnd-dice.1 43a925397f Added debug and optimized build targets, refactored in preparation for adding unit tests, renamed some files to be more consistent. 2 months ago
main.cpp 33d2d10521 updated README to reflect recent changes, plus a version bump 2 months ago
makefile becc72dd7e added asan and ubsan to debug target 2 months ago

README.md

License Build Status

Motivations:

I just wanna roll some sweet nat 20's!

Features

  • Roll d20, d12, d8, d6, d4, d2, and percentile dice!
  • Specify any number of dice!
  • No external dependencies!
  • Portable! Written in pure modern C++14
  • Fully unit test code coverage [coming]

Prerequisites:

  • Compiler capable of C++14 (i.e. GCC5 or Clang3.4)
  • POSIX make (GNU make, Bmake, etc.)

Install:

Source

git clone https://git.zerohack.xyz:443/lotus/dnd-dice.git
cd dnd-dice
make && make install # may require root privileges

# to build a debug version
make debug

# to build a optimized version
make opt

Binary

Check out the Releases page..

Usage:

dnd-dice                       # interactively input dice to roll
dnd-dice -d 20                 # roll a d20
dnd-dice -d 10 -n 4            # roll four d10s
dnd-dice -v                    # show version info
dnd-dice -h                    # show this help info 

Built with:

Free and Open Source software and the help of the church of Emacs ;)

Notes:

This does not include a secure random number generator. The rolls wont be truly non-deterministic. I use the C++ standard random_device and Mersenne-Twister to get the random numbers. The Mersenne-Twister is considered a really good pseudo-random generator and will produce large volumes of high quality pseudo-random values quickly. This works well enough for this application, and my needs. If you want true randomness build you own application against OpenSSL or just roll real dice.

License / Disclaimer:

This project is licensed under the BSD 3-Clause license. See LICENSE.md for more info.

Don't blame me when your computer explodes.