| hharpole (1) | |
|
/***************** * CREATED * * BY * * HUNTER HARPOLE * ******************/ //This is a simple c++ version of the fallout 3 Terminal computer password hack. //For this version I have the password set to AGREE //Enjoy! #include<iostream> #include<iomanip> #include<string> using namespace std; int main() { int n; int num_attempts = 4; string your_attempt = " "; int y; cout << "ROBCO INDUSTRIES (™) TERMLINK PROTOCOL" << endl; cout << "ENTER PASSWORD NOW" << endl; cout << endl; cout << num_attempts << " ATTEMPT(S) LEFT: "; for (n=0; n<num_attempts; n++) { cout << "■"; } cout << endl; cout << endl; cout << "0xF4F0 VIRAL 0xF5BC MINES" << endl; cout << "0cF4FC DARED 0xF5C8 LIKES" << endl; cout << "0xF508 WIRES 0xF5D4 PARTS" << endl; cout << "0xF514 LINES 0xF5E0 HAREM" << endl; cout << "0xF520 LIVES 0xF5EC LINED" << endl; cout << "0xF52C SORTS 0xF5F8 WARNS" << endl; cout << "0xF538 AGREE 0xF604 THREW" << endl; cout << "0xF544 FARMS 0xF610 SIDES" << endl; do { if (num_attempts > 0) { cout << " > "; cin >> your_attempt; if (your_attempt != "AGREE") { if (your_attempt == "VIRAL" || your_attempt == "LINES" || your_attempt == "LIVES" || your_attempt == "SORTS" || your_attempt == "FARMS" || your_attempt == "MINES" || your_attempt == "LIKES" || your_attempt == "PARTS" || your_attempt == "LINED" || your_attempt == "WARNS" || your_attempt == "SIDES" ) { cout << "Incorrect! " << "1/5 Characters Right" << endl;} else { cout << "Incorrect! " << "2/5 Characters Right" << endl;}} } num_attempts = num_attempts - 1; cout << num_attempts << " ATTEMPT(S) LEFT: "; for (n=0; n<num_attempts; n++) { cout << "■"; } cout << endl; } while (your_attempt != "AGREE" && num_attempts != 0); if ( your_attempt == "AGREE" ) { cout << "Exact Match! +75 XP" << endl; } else { cout << "You have been temporarily locked out! Contact the Administrator!" << endl; } return 0; } Any Ideas on how to make this program even better??? | |
|
|
|
| Aramil of Elixia (772) | |
| wrap in [_code_] blocks? | |
|
|
|
| errcheck (2) | |
|
It's not very good code to begin with. The password is hardcoded, and the password check is redundant and slow. I recommend you to start from scratch. | |
|
|
|