66 lines
1 KiB
C
66 lines
1 KiB
C
|
// KOS functions
|
||
|
#include <iostream>
|
||
|
#include <cstdlib>
|
||
|
#include <ctime>
|
||
|
#ifndef kosfunctions_h
|
||
|
#define kosfunctions_h
|
||
|
using namespace std;
|
||
|
|
||
|
string input;
|
||
|
|
||
|
int TSRandomInt(bool useCustomSeed = false, int customSeed = 1, int maxValue = 0)
|
||
|
{
|
||
|
srand(time(0));
|
||
|
if (useCustomSeed == true)
|
||
|
{
|
||
|
srand(customSeed);
|
||
|
}
|
||
|
|
||
|
int modulusvar;
|
||
|
|
||
|
if (maxValue != 0)
|
||
|
{
|
||
|
modulusvar = 1 + maxValue;
|
||
|
}
|
||
|
return (rand() % (modulusvar));
|
||
|
}
|
||
|
|
||
|
void printString(string printString1)
|
||
|
{
|
||
|
cout << endl
|
||
|
<< printString1 << endl;
|
||
|
}
|
||
|
|
||
|
void printStringInstruction(string printString1)
|
||
|
{
|
||
|
cout << endl
|
||
|
<< printString1 << endl
|
||
|
<< endl;
|
||
|
}
|
||
|
|
||
|
void helpCommand()
|
||
|
{
|
||
|
if (input == "help")
|
||
|
;
|
||
|
{
|
||
|
cout << endl
|
||
|
<< "help - lets the user see this menu." << endl
|
||
|
<< "shutdown - shut's down the software." << endl
|
||
|
<< "calculator - opens the calculator menu." << endl
|
||
|
<< "rand - generates a random number." << endl;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void backToMain()
|
||
|
{
|
||
|
/* if(input == "back" || input == "Back")
|
||
|
{
|
||
|
cout << "entering main menu..." << endl << endl;
|
||
|
|
||
|
}
|
||
|
*/
|
||
|
}
|
||
|
|
||
|
#endif
|
||
|
|