Created
April 18, 2016 16:29
-
-
Save Sumolari/0e55184f0449b2180d09af3f339fbc15 to your computer and use it in GitHub Desktop.
Dice demo with MawKit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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