Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- #include <string>
- #include <Windows.h>
- #include "characterList.h"
- #include "toLowerCase.h"
- using namespace std;
- int main() {
- HANDLE hConsole;
- hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
- // COLOR TESTER:
- // for (int i = 0; i <= 255; i++) {
- // SetConsoleTextAttribute(hConsole, i);
- // cout << i << ": The quick brown fox jumps over the lazy dog! n";
- // }
- const string C_letters = "qwertyuiopasdfghjklzxcvbnm";
- const string C_numbers = "0123456789";
- const string C_poorSymbols = "/*-+.,";
- const string C_richSymbols = "!@#$%^&*()_{}[]'\"|:;<>`~";
- string difficulty;
- int stringLength = 1;
- SetConsoleTextAttribute(hConsole, 10);
- cout <<
- ".: Please select difficulty :.n" <<
- ":: Difficulties ::n" <<
- ":: You can combine by adding them together ::n" <<
- "': LETTERS -L , NUMBERS -N , POOR -P , RICH -R :'" << endl;
- cin >> difficulty;
- cout << "Select the max length of string (Default- 1): ";
- cin >> stringLength;
- cout << endl;
- difficulty = toLowerCase(difficulty);
- int selection = 0;
- /*
- =========================================
- ALL = ALL! :D
- 13 = L
- 23 = N
- 34 = P
- 45 = R
- 36 = L, N
- 47 = L, P
- 58 = L, R
- 57 = N, P
- 68 = N, R
- 79 = P, R
- =========================================
- */
- for (int i = 0; i < difficulty.length(); i++) {
- if (difficulty[i] == 'l') selection += 13;
- if (difficulty[i] == 'n') selection += 23;
- if (difficulty[i] == 'p') selection += 34;
- if (difficulty[i] == 'r') selection += 45;
- }
- if (selection == 0) {
- SetConsoleTextAttribute(hConsole, 78);
- cout << "nERROR: Cannot read valid input info! (Try and type the correct form. Example: NL or ALLnn" << endl;
- return 1;
- } else if (selection == 13) { // This is for letters.
- for (int i = 0; i < C_letters.length(); i++) {
- cout << i + 1 << " : " << C_letters[i] << endl;
- }
- //ToDo: FIX UR SHITTY TRASH remarks/help: m>qm mm>qqm qmm mmm>mmmm etc..
- } else if (selection == 23) { // This is for numbers.
- while (stringLength > 0) {
- for (int i = 0; i < C_numbers.length(); i++) {
- cout << C_numbers[i];
- }
- stringLength--;
- }
- }
- cout << endl;
- return 0;
- }
- #include <string>
- std::string toLowerCase(std::string stringToLower) {
- std::string CharStorage = stringToLower;
- for (int i = 0; i < stringToLower.length(); i++) {
- if (stringToLower[i] == 'A') CharStorage[i] = 'a';
- else if (stringToLower[i] == 'B') CharStorage[i] = 'b';
- else if (stringToLower[i] == 'C') CharStorage[i] = 'c';
- else if (stringToLower[i] == 'D') CharStorage[i] = 'd';
- else if (stringToLower[i] == 'E') CharStorage[i] = 'e';
- else if (stringToLower[i] == 'F') CharStorage[i] = 'f';
- else if (stringToLower[i] == 'G') CharStorage[i] = 'g';
- else if (stringToLower[i] == 'H') CharStorage[i] = 'h';
- else if (stringToLower[i] == 'I') CharStorage[i] = 'i';
- else if (stringToLower[i] == 'J') CharStorage[i] = 'j';
- else if (stringToLower[i] == 'K') CharStorage[i] = 'k';
- else if (stringToLower[i] == 'L') CharStorage[i] = 'l';
- else if (stringToLower[i] == 'M') CharStorage[i] = 'm';
- else if (stringToLower[i] == 'N') CharStorage[i] = 'n';
- else if (stringToLower[i] == 'O') CharStorage[i] = 'o';
- else if (stringToLower[i] == 'P') CharStorage[i] = 'p';
- else if (stringToLower[i] == 'Q') CharStorage[i] = 'q';
- else if (stringToLower[i] == 'R') CharStorage[i] = 'r';
- else if (stringToLower[i] == 'S') CharStorage[i] = 's';
- else if (stringToLower[i] == 'T') CharStorage[i] = 't';
- else if (stringToLower[i] == 'U') CharStorage[i] = 'u';
- else if (stringToLower[i] == 'Y') CharStorage[i] = 'y';
- else if (stringToLower[i] == 'W') CharStorage[i] = 'w';
- else if (stringToLower[i] == 'X') CharStorage[i] = 'x';
- else if (stringToLower[i] == 'Y') CharStorage[i] = 'y';
- else if (stringToLower[i] == 'Z') CharStorage[i] = 'z';
- }
- return CharStorage;
- }
Add Comment
Please, Sign In to add comment