Mercurial > codedump
changeset 5:9241ce1e5abe
Update win95kg.cpp
committer: GitHub <noreply@github.com>
author | Paper <37962225+mrpapersonic@users.noreply.github.com> |
---|---|
date | Mon, 04 Jan 2021 14:21:00 -0500 |
parents | 0a19385c6066 |
children | aac9a23bd027 |
files | win95kg.cpp |
diffstat | 1 files changed, 94 insertions(+), 99 deletions(-) [+] |
line wrap: on
line diff
--- a/win95kg.cpp Mon Jan 04 14:20:30 2021 -0500 +++ b/win95kg.cpp Mon Jan 04 14:21:00 2021 -0500 @@ -3,138 +3,133 @@ not sure if this will work fully, but from what i've seen it works well enough */ #include <ctime> - #include <cstdlib> - #include <cstring> - #include <iomanip> - #include <iostream> - #include <string> int a(), b(), c(), d(), e(); int main(int argc, char * argv[]) { - int endpoint, startpoint, sadsong; - srand((unsigned) time(NULL)); - if (argc >= 2) { - if (strcmp(argv[1], "--office") == 0) { - startpoint = c(); - sadsong = 4; - } else if (strcmp(argv[1], "--oem") == 0) { - int first = d(), third = e(); - std::cout << std::setw(5) << std::setfill('0') << first; - std::cout << "-OEM-"; - std::cout << std::setw(7) << std::setfill('0') << third << "-"; - std::cout << std::setw(5) << std::setfill('0') << (rand() % 100000); - return 0; - } else if (strcmp(argv[1], "--normal") == 0) { - startpoint = a(); - sadsong = 3; + int endpoint, startpoint, sadsong; + srand((unsigned) time(NULL)); + if (argc >= 2) { + if (strcmp(argv[1], "--office") == 0) { + startpoint = c(); + sadsong = 4; + } else if (strcmp(argv[1], "--oem") == 0) { + int first = d(), third = e(); + std::cout << std::setw(5) << std::setfill('0') << first; + std::cout << "-OEM-"; + std::cout << std::setw(7) << std::setfill('0') << third << "-"; + std::cout << std::setw(5) << std::setfill('0') << (rand() % 100000); + return 0; + } else if (strcmp(argv[1], "--normal") == 0) { + startpoint = a(); + sadsong = 3; + } else { + std::cout << "usage: " << argv[0] << " [--normal] [--oem] [--office]"; + return 0; + } } else { - std::cout << "usage: " << argv[0] << " [--normal] [--oem] [--office]"; - return 0; + std::cout << "usage: " << argv[0] << " [--normal] [--oem] [--office]"; + return 0; } - } else { - std::cout << "usage: " << argv[0] << " [--normal] [--oem] [--office]"; + endpoint = b(); + std::cout << std::setw(sadsong) << std::setfill('0') << startpoint << "-"; + std::cout << std::setw(7) << std::setfill('0') << endpoint; return 0; - } - endpoint = b(); - std::cout << std::setw(sadsong) << std::setfill('0') << startpoint << "-"; - std::cout << std::setw(7) << std::setfill('0') << endpoint; - return 0; } int a() { - int num; - num = rand() % 1000; - while ((num == 333) and(num == 444) and(num == 555) and(num == 666) and(num == 777) and(num == 888) and(num == 999)) { + int num; num = rand() % 1000; - } - while ((num % 3) != 0) { - num = num + 1; - } - return num; + while ((num == 333) and(num == 444) and(num == 555) and(num == 666) and(num == 777) and(num == 888) and(num == 999)) { + num = rand() % 1000; + } + while ((num % 3) != 0) { + num = num + 1; + } + return num; } int b() { - int first_digits = rand() % 10000000; - int last_digit = rand() % 10; - while ((last_digit == 0) || (last_digit >= 8)) { - last_digit = rand() % 10; - } - std::string thisis = std::to_string(first_digits); - std::string veryfrustrating = std::to_string(last_digit); - std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); - int second_segment = std::stoi(second_segment_p1); - while (second_segment % 7 != 0) { - first_digits = rand() % 10000000; - last_digit = rand() % 10; + int first_digits = rand() % 10000000; + int last_digit = rand() % 10; while ((last_digit == 0) || (last_digit >= 8)) { - last_digit = rand() % 10; + last_digit = rand() % 10; } std::string thisis = std::to_string(first_digits); std::string veryfrustrating = std::to_string(last_digit); std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); - second_segment = std::stoi(second_segment_p1); - } - return second_segment; + int second_segment = std::stoi(second_segment_p1); + while (second_segment % 7 != 0) { + first_digits = rand() % 10000000; + last_digit = rand() % 10; + while ((last_digit == 0) || (last_digit >= 8)) { + last_digit = rand() % 10; + } + std::string thisis = std::to_string(first_digits); + std::string veryfrustrating = std::to_string(last_digit); + std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); + second_segment = std::stoi(second_segment_p1); + } + return second_segment; } int c() { - int new_site = rand() % 1000; - int ez_pwned = new_site % 10 + 1; - while (ez_pwned >= 10) { - ez_pwned = ez_pwned - 10; - } - std::string thisisstill = std::to_string(new_site); - std::string prettyfrustrating = std::to_string(ez_pwned); - std::string iamsocool = (std::string(thisisstill) + std::string(prettyfrustrating)); - int mysinusesareclogged = std::stoi(iamsocool); - return mysinusesareclogged; + int new_site = rand() % 1000; + int ez_pwned = new_site % 10 + 1; + while (ez_pwned >= 10) { + ez_pwned = ez_pwned - 10; + } + std::string thisisstill = std::to_string(new_site); + std::string prettyfrustrating = std::to_string(ez_pwned); + std::string iamsocool = (std::string(thisisstill) + std::string(prettyfrustrating)); + int mysinusesareclogged = std::stoi(iamsocool); + return mysinusesareclogged; } int d() { - int day = (rand() % 366) + 1; - const char * years[] = { - "95", - "96", - "97", - "98", - "99", - "00", - "01", - "02", - "03" - }; - int index = (rand() % 9); - const char * year = years[index]; - std::string iamsotired = std::to_string(day); - std::string ofdoingthis = year; - std::string pleasehelp = (std::string(iamsotired) + std::string(ofdoingthis)); - int ohmygod = std::stoi(pleasehelp); - return ohmygod; + int day = (rand() % 366) + 1; + const char * years[] = { + "95", + "96", + "97", + "98", + "99", + "00", + "01", + "02", + "03" + }; + int index = (rand() % 9); + const char * year = years[index]; + std::string iamsotired = std::to_string(day); + std::string ofdoingthis = year; + std::string pleasehelp = (std::string(iamsotired) + std::string(ofdoingthis)); + int ohmygod = std::stoi(pleasehelp); + return ohmygod; } int e() { - int first_digits = rand() % 1000000; - int last_digit = rand() % 10; - while ((last_digit == 0) || (last_digit >= 8)) { - last_digit = rand() % 10; - } - std::string thisis = std::to_string(first_digits); - std::string veryfrustrating = std::to_string(last_digit); - std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); - int second_segment = std::stoi(second_segment_p1); - while (second_segment % 7 != 0) { - first_digits = rand() % 10000000; - last_digit = rand() % 10; + int first_digits = rand() % 1000000; + int last_digit = rand() % 10; while ((last_digit == 0) || (last_digit >= 8)) { - last_digit = rand() % 10; + last_digit = rand() % 10; } std::string thisis = std::to_string(first_digits); std::string veryfrustrating = std::to_string(last_digit); std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); - second_segment = std::stoi(second_segment_p1); - } - return second_segment; + int second_segment = std::stoi(second_segment_p1); + while (second_segment % 7 != 0) { + first_digits = rand() % 10000000; + last_digit = rand() % 10; + while ((last_digit == 0) || (last_digit >= 8)) { + last_digit = rand() % 10; + } + std::string thisis = std::to_string(first_digits); + std::string veryfrustrating = std::to_string(last_digit); + std::string second_segment_p1 = (std::string(thisis) + std::string(veryfrustrating)); + second_segment = std::stoi(second_segment_p1); + } + return second_segment; }