aboutsummaryrefslogtreecommitdiff
path: root/CST 126/Homework 1/helpers.hpp
diff options
context:
space:
mode:
authorarthurtspears <[email protected]>2024-04-20 11:16:36 -0700
committerGitHub <[email protected]>2024-04-20 11:16:36 -0700
commit659a1f12d935130bf8da4fe14165e4f421ac7c18 (patch)
treecebf8ee2c18c8e0aa4cf5fc4630a8005164b068d /CST 126/Homework 1/helpers.hpp
parentAdded helpers.h file. (diff)
downloadhomework-1-arthurtspears-develop.tar.xz
homework-1-arthurtspears-develop.zip
Adding basic unit tests to Solution (#2)HEADdevelop
* all work up until inclass practice * Added Unit Tests Project * Added second unit tests project as example. * Bring up to date for merge
Diffstat (limited to 'CST 126/Homework 1/helpers.hpp')
-rw-r--r--CST 126/Homework 1/helpers.hpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/CST 126/Homework 1/helpers.hpp b/CST 126/Homework 1/helpers.hpp
new file mode 100644
index 0000000..8225722
--- /dev/null
+++ b/CST 126/Homework 1/helpers.hpp
@@ -0,0 +1,44 @@
+#ifndef HELPERS_HPP
+#define HELPERS_HPP
+
+#include <random>
+
+typedef unsigned long long uLong;
+typedef unsigned char BYTE;
+
+inline int Random(const int& lowest, const int& highest)
+{
+ std::random_device rd;
+ std::mt19937 gen(rd());
+ std::uniform_int_distribution<int> dis(lowest, highest);
+ const int random_number = dis(gen);
+ return random_number;
+}
+
+inline void GenerateRandomNumbers(int arrayToFill[], const int& size)
+{
+ std::random_device rd;
+ std::mt19937 gen(rd());
+ std::uniform_int_distribution<int> dis(0, size);
+ for (auto i = 0; i < size; ++i)
+ {
+ const int random_number = dis(gen);
+ arrayToFill[i] = random_number;
+ }
+}
+inline int add(int num, char myChar)
+{
+ return num + myChar;
+}
+inline int add(int num, int num2, int num3)
+{
+ return num + num2 + num3;
+}
+inline int add(int num, int num2, int num3, int num4)
+{
+ return num + num2 + num3 + num4;
+}
+
+
+
+#endif