Guest User

Untitled

a guest
Dec 5th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.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 ALLnn" << 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. }
  80. stringLength--;
  81. }
  82. }
  83. cout << endl;
  84. return 0;
  85. }
  86.  
  87. #include <string>
  88.  
  89. std::string toLowerCase(std::string stringToLower) {
  90. std::string CharStorage = stringToLower;
  91. for (int i = 0; i < stringToLower.length(); i++) {
  92. if (stringToLower[i] == 'A') CharStorage[i] = 'a';
  93. else if (stringToLower[i] == 'B') CharStorage[i] = 'b';
  94. else if (stringToLower[i] == 'C') CharStorage[i] = 'c';
  95. else if (stringToLower[i] == 'D') CharStorage[i] = 'd';
  96. else if (stringToLower[i] == 'E') CharStorage[i] = 'e';
  97. else if (stringToLower[i] == 'F') CharStorage[i] = 'f';
  98. else if (stringToLower[i] == 'G') CharStorage[i] = 'g';
  99. else if (stringToLower[i] == 'H') CharStorage[i] = 'h';
  100. else if (stringToLower[i] == 'I') CharStorage[i] = 'i';
  101. else if (stringToLower[i] == 'J') CharStorage[i] = 'j';
  102. else if (stringToLower[i] == 'K') CharStorage[i] = 'k';
  103. else if (stringToLower[i] == 'L') CharStorage[i] = 'l';
  104. else if (stringToLower[i] == 'M') CharStorage[i] = 'm';
  105. else if (stringToLower[i] == 'N') CharStorage[i] = 'n';
  106. else if (stringToLower[i] == 'O') CharStorage[i] = 'o';
  107. else if (stringToLower[i] == 'P') CharStorage[i] = 'p';
  108. else if (stringToLower[i] == 'Q') CharStorage[i] = 'q';
  109. else if (stringToLower[i] == 'R') CharStorage[i] = 'r';
  110. else if (stringToLower[i] == 'S') CharStorage[i] = 's';
  111. else if (stringToLower[i] == 'T') CharStorage[i] = 't';
  112. else if (stringToLower[i] == 'U') CharStorage[i] = 'u';
  113. else if (stringToLower[i] == 'Y') CharStorage[i] = 'y';
  114. else if (stringToLower[i] == 'W') CharStorage[i] = 'w';
  115. else if (stringToLower[i] == 'X') CharStorage[i] = 'x';
  116. else if (stringToLower[i] == 'Y') CharStorage[i] = 'y';
  117. else if (stringToLower[i] == 'Z') CharStorage[i] = 'z';
  118. }
  119. return CharStorage;
  120. }
Add Comment
Please, Sign In to add comment