Skip to content

Instantly share code, notes, and snippets.

@Sumolari
Created April 18, 2016 16:29
Show Gist options
  • Save Sumolari/0e55184f0449b2180d09af3f339fbc15 to your computer and use it in GitHub Desktop.
Save Sumolari/0e55184f0449b2180d09af3f339fbc15 to your computer and use it in GitHub Desktop.
Dice demo with MawKit
#include "MawKit/Range.hpp"
#include "MawKit/Random.hpp"
#include <vector>
long long throw20FacesDice() {
return MK::LLRange( 1, 20 ).randomInteger();
}
double getRandomNumberFrom0UpTo100() {
return MK::DRange( 0, 100 ).randomFloatingPoint();
}
int randomChoose() {
std::vector<int> favouriteNumbers = { -1, 3, 6, -5, 7 };
return MK::Random::Choose( favouriteNumbers );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment