Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- #include <string>
- #include <random>
- #include <ctime>
- #include <stdlib.h>
- using namespace std;
- void scl() {
- system("cls");
- }
- class AllColors {
- public:
- void ColorChoices() {
- std::cout << ") Red" << endl;
- std::cout << ") Green" << endl;
- std::cout << ") Aqua" << endl;
- std::cout << ") White" << endl;
- std::cout << ") Default" << endl;
- std::cout << ") Menu\n" << endl;
- }
- };
- int main() {
- system("color d");
- ShowWindow(GetConsoleWindow(), SW_MAXIMIZE);
- SetConsoleTitle("Number Guess V1 Development Build");
- int menu();
- menu();
- return 0;
- }
- int menu() {
- string _menu_choice;
- std::cout << "Play Game" << endl;
- std::cout << "Settings" << endl;
- std::cout << "Exit\n" << endl;
- std::cout << "> ";
- cin >> _menu_choice;
- if (_menu_choice == "PLAY" || _menu_choice == "Play" || _menu_choice == "play"
- || _menu_choice == "GAME" || _menu_choice == "Game" || _menu_choice == "game") {
- int playGame();
- playGame();
- }
- else if (_menu_choice == "SETTINGS" || _menu_choice == "Settings" || _menu_choice == "settings") {
- scl();
- void settings();
- settings();
- }
- else if (_menu_choice == "EXIT" || _menu_choice == "Exit" || _menu_choice == "exit"
- || _menu_choice == "QUIT" || _menu_choice == "Quit" || _menu_choice == "quit") {
- scl();
- void quit();
- quit();
- }
- else {
- scl();
- int menu();
- menu();
- }
- return 0;
- }
- int playGame() {
- scl();
- string PlayGameOption;
- std::cout << ") Easy" << endl;
- std::cout << ") Medium" << endl;
- std::cout << ") Hard" << endl;
- std::cout << ") Menu\n" << endl;
- std::cout << "> ";
- cin >> PlayGameOption;
- if (PlayGameOption == "EASY" || PlayGameOption == "Easy" || PlayGameOption == "easy") {
- scl();
- int playGameEasy();
- playGameEasy();
- }
- else {
- scl();
- int playGame();
- playGame();
- }
- return 0;
- }
- int playGameEasy() {
- int NumberEasy;
- default_random_engine RandomEngineForEasyMode(time(NULL));
- uniform_int_distribution<int> EasyMode(1, 20);
- std::cout << "Enter 0 To Exit..." << endl;
- std::cout << "--Press Any Key To Continue--" << endl;
- system("pause >nul");
- scl();
- Easy:
- std::cout << "Guess the number from 1 to 20.\n" << endl;
- cin >> NumberEasy;
- if (GetAsyncKeyState('0') & 0x8000) {
- scl();
- int playGame();
- playGame();
- }
- if (NumberEasy == (EasyMode(RandomEngineForEasyMode))) {
- scl();
- std::cout << "Correct!" << endl;
- std::cout << "--Press Any Key To Continue--" << endl;
- system("pause >nul");
- scl();
- int playGame();
- playGame();
- }
- else {
- scl();
- goto Easy;
- }
- return 0;
- }
- void color() {
- scl();
- string ColorChoice;
- AllColors Colors;
- Colors.ColorChoices();
- std::cout << endl;
- std::cout << "> ";
- cin >> ColorChoice;
- if (ColorChoice == "RED" || ColorChoice == "Red" || ColorChoice == "red") {
- system("color c");
- scl();
- void settings();
- settings();
- }
- else if (ColorChoice == "GREEN" || ColorChoice == "Green" || ColorChoice == "green") {
- system("color a");
- scl();
- void settings();
- settings();
- }
- else if (ColorChoice == "AQUA" || ColorChoice == "Aqua" || ColorChoice == "aqua") {
- system("color b");
- scl();
- void settings();
- settings();
- }
- else if (ColorChoice == "WHITE" || ColorChoice == "White" || ColorChoice == "white") {
- system("color f");
- scl();
- void settings();
- settings();
- }
- else if (ColorChoice == "DEFAULT" || ColorChoice == "Default" || ColorChoice == "default") {
- system("color a");
- scl();
- void settings();
- settings();
- }
- else if (ColorChoice == "BACK" || ColorChoice == "Back" || ColorChoice == "back") {
- scl();
- void settings();
- settings();
- }
- else {
- scl();
- void color();
- color();
- }
- }
- void settings() {
- string _setting_choice;
- std::cout << ") Color" << endl;
- std::cout << ") Menu\n" << endl;
- std::cout << "> ";
- cin >> _setting_choice;
- if (_setting_choice == "COLOR" || _setting_choice == "Color" || _setting_choice == "color") {
- void color();
- color();
- }
- else if (_setting_choice == "MENU" || _setting_choice == "Menu" || _setting_choice == "menu") {
- scl();
- int menu();
- menu();
- }
- else {
- scl();
- void settings();
- settings();
- }
- }
- void quit() {
- string _quit_sure;
- std::cout << "Are you sure you want to quit? (Y\N)" << endl;
- cin >> _quit_sure;
- if (_quit_sure == "Y" || _quit_sure == "y") {
- exit(0);
- }
- else {
- scl();
- int menu();
- menu();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement