You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modifications after last commit with QC bugfixes applied as well:
- Add commands Y2038, CalcQuadratic, Factorial
- Add game Guess The Number
- Add settings for the Guess The Number game
- Fix settings indentation in help page
- Fix issues with incomplete error checking in settings involving colours in the Settings command
std::cout << wordWrap("\n -h\t\tDisplays this help message.\n --cardodge\tStarts the CarDodge game, a game where you dodge enemy cars to gain points.\n\n"
1041
+
std::cout << wordWrap("\n -h\t\tDisplays this help message.\n --cardodge\tStarts the CarDodge game, a game where you dodge enemy cars to gain points.\n"
1042
+
" --gtn\t\tStarts the Guess The Number game, a game where you guess a number between 1 and 100 in as little tries as you can.\n\n"
1040
1043
"Example: game --cardodge\n\n");
1041
1044
1042
1045
return;
@@ -1084,4 +1087,68 @@ namespace helpmsgs
1084
1087
1085
1088
return;
1086
1089
}
1090
+
1091
+
// FactorialHelp
1092
+
voidFactorialHelp() {
1093
+
CentreColouredText(" ___FACTORIAL___ ", 1);
1094
+
std::cout << "\n";
1095
+
CentreColouredText("This command calculates the factors and prime factors of a positive integer.", 2);
1096
+
std::cout << "\n\n";
1097
+
1098
+
colourSubheading();
1099
+
std::cout << "What this command does:" << NOULINE_STR;
std::cout << wordWrap("\n- This command simply calculates the prime factors and factors of a positive integer.\n- The results are displayed on the terminal screen.\n\n");
1102
+
1103
+
colourSubheading();
1104
+
std::cout << "Possible arguments for this command:" << NOULINE_STR;
std::cout << wordWrap("\n -h\tDisplays this help message.\n <num>\tFactorise a number from an argument parameter. Put the number in place of <num>.\n\nExample: factorial 45\n\n");
1107
+
1108
+
return;
1109
+
}
1110
+
1111
+
// CalcQuadraticHelp
1112
+
voidCalcQuadraticHelp() {
1113
+
CentreColouredText(" ___CALCQUADRATIC___ ", 1);
1114
+
std::cout << "\n";
1115
+
CentreColouredText("CalcQuadratic allows you to compute all values of a quadratic equation quickly and easily.", 2);
1116
+
std::cout << "\n\n";
1117
+
1118
+
colourSubheading();
1119
+
std::cout << "What this command does:" << NOULINE_STR;
std::cout << wordWrap("\n- This command calculates all the values of a quadratic mathematical equation quickly and easily.\n- All the command needs is the A, B and C values, from this quadratic equation form: [ax^2 + bx + c = 0].\n\n");
1122
+
1123
+
colourSubheading();
1124
+
std::cout << "Possible arguments for this command:" << NOULINE_STR;
std::cout << wordWrap("\n -h\t\tDisplays this help message.\n <a> <b> <c>\tCompute values of quadratic equation from arguments. Put A, B and C values in place of <a>, <b> and <c> respectively.\n\n"
1127
+
"Example: calcquadratic 1 9 18\n\nNOTE: The A, B and C arguments must be numerical for the calculator to work.\n\n");
1128
+
1129
+
return;
1130
+
}
1131
+
1132
+
// Y2038Help
1133
+
voidY2038Help() {
1134
+
CentreColouredText(" ___Y2038___ ", 1);
1135
+
std::cout << "\n";
1136
+
CentreColouredText("This command displays how long is left until the Y2038 time overflow occurs.", 2);
1137
+
std::cout << "\n\n";
1138
+
1139
+
colourSubheading();
1140
+
std::cout << "What this command does:" << NOULINE_STR;
std::cout << wordWrap("\n- This command displays how long is left until the Y2038 time overflow occurs (aka the Y2038 problem, Y2K38).\n- This bug occurs because there are simply too many seconds to fit into a 32-bit integer. Therefore, it affects all 32-bit systems."
1143
+
"\n- You can find out more about this phenomenon on the Wikipedia page: ");
UserErrorDisplay("An error occured. Your setting option seems to be incorrect. Make sure it's a number and try again.\nType \"settings -h\" for more info.\n");
VerbosityDisplay("In Commands() - ERROR: Could not detect numerical value in string-based number argument.\n");
816
+
UserErrorDisplay("An error occured. Your setting option seems to be incorrect. Make sure it's a number and try again.\nType \"settings -h\" for more info.\n");
VerbosityDisplay("In Commands() - ERROR: Could not detect numerical value in string-based number argument.\n");
827
+
UserErrorDisplay("An error occured. Your setting option seems to be incorrect. Make sure it's a number and try again.\nType \"settings -h\" for more info.\n");
0 commit comments