MTEngine
A random number generator engine for C++ based on the Mersenne Twister algorithm.
Loading...
Searching...
No Matches
C:/Users/harshn/Desktop/MTEngine/example.cpp
Go to the documentation of this file.
1#include "MTEngine.hpp"
2#include "PrintUtils/PrintUtils.hpp"
3#include <vector>
4#include <iostream>
5
9int main()
10{
16 MTEngine engine;
17
22 std::cout << engine.rand() << std::endl;
23
29 std::cout << engine.choice(1, 2, 3) << std::endl;
30
34 std::vector<double> v = {1, 2, 3, 4, 5};
35
40 engine.Shuffle(v);
41
46 std::cout << v << std::endl;
47
48
54 std::cout<<engine.Choice(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)<<std::endl;
55
59 return 0;
60}
A class that represents a random number generator engine.
Definition MTEngine.hpp:22
T Choice(T Start, Args... args)
Definition MTEngine.hpp:100
void Shuffle(std::vector< T > &X)
Definition MTEngine.hpp:67
double choice(double a, double b)
Definition MTEngine.cpp:97
double rand()
Definition MTEngine.cpp:84
int main()
Definition example.cpp:9