Advertisement
Guest User

Untitled

a guest
Dec 5th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.30 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <string>
  4. #include <Windows.h>
  5. #include "characterList.h"
  6. #include "toLowerCase.h"
  7.  
  8. using namespace std;
  9.  
  10. int main() {
  11.     HANDLE hConsole;
  12.     hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
  13.  
  14.    
  15. //          COLOR TESTER:
  16. //  for (int i = 0; i <= 255; i++) {
  17. //      SetConsoleTextAttribute(hConsole, i);
  18. //      cout << i << ": The quick brown fox jumps over the lazy dog!            \n";
  19. //  }
  20.    
  21.     const string C_letters = "qwertyuiopasdfghjklzxcvbnm";
  22.     const string C_numbers = "0123456789";
  23.     const string C_poorSymbols = "/*-+.,";
  24.     const string C_richSymbols = "!@#$%^&*()_{}[]'\\\"|:;<>`~";
  25.     string difficulty;
  26.     int stringLength = 1;
  27.  
  28.     SetConsoleTextAttribute(hConsole, 10);
  29.     cout <<
  30.         ".:         Please select difficulty            :.\n" <<
  31.         "::                Difficulties                 ::\n" <<
  32.         "::   You can combine by adding them together   ::\n" <<
  33.         "': LETTERS -L , NUMBERS -N , POOR -P , RICH -R :'" << endl;
  34.     cin >> difficulty;
  35.     cout << "Select the max length of string (Default- 1): ";
  36.     cin >> stringLength;
  37.  
  38.     cout << endl;
  39.     difficulty = toLowerCase(difficulty);
  40.    
  41.     int selection = 0;
  42.     /*
  43.         =========================================
  44.         ALL = ALL! :D
  45.  
  46.         13 = L
  47.         23 = N
  48.         34 = P
  49.         45 = R
  50.         36 = L, N
  51.         47 = L, P
  52.         58 = L, R
  53.         57 = N, P
  54.         68 = N, R
  55.         79 = P, R
  56.         =========================================
  57.     */
  58.  
  59.     for (int i = 0; i < difficulty.length(); i++) {
  60.         if (difficulty[i] == 'l') selection += 13;
  61.         if (difficulty[i] == 'n') selection += 23;
  62.         if (difficulty[i] == 'p') selection += 34;
  63.         if (difficulty[i] == 'r') selection += 45;
  64.     }
  65.    
  66.     if (selection == 0) {
  67.         SetConsoleTextAttribute(hConsole, 78);
  68.         cout << "\nERROR: Cannot read valid input info! (Try and type the correct form. Example: NL or ALL\n\n" << endl;
  69.         return 1;
  70.     } else if (selection == 13) { // This is for letters.
  71.         for (int i = 0; i < C_letters.length(); i++) {
  72.             cout << i + 1 << " : " << C_letters[i] << endl;
  73.         }
  74.         //ToDo: FIX UR SHITTY TRASH remarks/help: m>qm mm>qqm qmm mmm>mmmm etc..
  75.     } else if (selection == 23) { // This is for numbers.
  76.         while (stringLength > 0) {
  77.             for (int i = 0; i < C_numbers.length(); i++) {
  78.                 cout << C_numbers[i];
  79.             } // Dont mind this up here its trash code ;d
  80.             stringLength--;
  81.         }
  82.     }
  83.     cout << endl;
  84.     return 0;
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement