Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 25 additions & 14 deletions NumberGuess/NumberGuess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,19 @@

using namespace std;

// ANSI Color Codes
const string RESET = "\033[0m";
const string RED = "\033[31m";
const string GREEN = "\033[32m";
const string YELLOW = "\033[33m";
const string CYAN = "\033[36m";

void showEasterEgg() {
cout << "\n[!] EASTER EGG ACTIVATED: THE ZEN MODE" << endl;
cout << "Inspired by the Word 1.1a secret found 29 years later." << endl;
cout << "EiJackGH Lab - Saying YES in 2026." << endl;
cout << "========================================" << endl;
cout << CYAN << "\n╔════════════════════════════════════════╗" << RESET << endl;
cout << CYAN << "β•‘ " << YELLOW << "✨ EASTER EGG ACTIVATED: THE ZEN MODE ✨" << CYAN << " β•‘" << RESET << endl;
cout << CYAN << "β•‘ " << RESET << "Inspired by the Word 1.1a secret. " << CYAN << "β•‘" << RESET << endl;
cout << CYAN << "β•‘ " << RESET << "EiJackGH Lab - Saying YES in 2026. " << CYAN << "β•‘" << RESET << endl;
cout << CYAN << "β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•" << RESET << endl;
}

int main() {
Expand All @@ -21,12 +29,14 @@ int main() {
int guess = 0;
int attempts = 0;

cout << "--- EI-JACK LAB: NUMBER GUESSER V1.0 ---" << endl;
cout << "I'm thinking of a number between 1 and 100." << endl;
cout << CYAN << "╔════════════════════════════════════════╗" << RESET << endl;
cout << CYAN << "β•‘ 🎲 EI-JACK LAB: NUMBER GUESSER V1.0 β•‘" << RESET << endl;
cout << CYAN << "β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•" << RESET << endl;
cout << "\nI'm thinking of a number between 1 and 100." << endl;
cout << "(Hint: Type 'zen' to see the credits)" << endl << endl;

while (guess != secretNumber) {
cout << "Enter your guess: ";
cout << "πŸ‘‰ Enter your guess: ";
cin >> input;

// Check for Easter Egg
Expand All @@ -39,23 +49,24 @@ int main() {
try {
guess = stoi(input);
} catch (...) {
cout << "Invalid input. Please enter a number." << endl;
cout << RED << "Invalid input. Please enter a number." << RESET << endl;
continue;
}

attempts++;

if (guess > secretNumber) {
cout << ">>> Too high! Try again." << endl;
cout << RED << "πŸ“ˆ Too high! Try again." << RESET << endl;
} else if (guess < secretNumber) {
cout << ">>> Too low! Try again." << endl;
cout << YELLOW << "πŸ“‰ Too low! Try again." << RESET << endl;
} else {
cout << "\nCONGRATULATIONS!" << endl;
cout << "You found it in " << attempts << " attempts." << endl;
cout << GREEN << "\nπŸŽ‰ CONGRATULATIONS! πŸŽ‰" << RESET << endl;
cout << GREEN << "You found it in " << attempts << " attempts." << RESET << endl;
}
}

cout << "----------------------------------------" << endl;
system("pause"); // Essential for Dev-C++ to keep the window open
cout << CYAN << "β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•" << RESET << endl;
cout << "\nPress Enter to exit..." << endl;
cin.ignore(); cin.get(); // Cross-platform pause to keep the window open
return 0;
}
Loading