diff --git a/33.c b/33.c new file mode 100644 index 0000000..853fd9a --- /dev/null +++ b/33.c @@ -0,0 +1,531 @@ +#include +#include + +typedef struct { + char lName[12]; //Struct containing employee records incl. name, job code, description, who they report to, and their salaries + char fName[25]; + int jCode; + char jTitle[30]; + char reportsTo[25]; + double salary; + + } empProfile; + +typedef struct { + char note[125]; //Struct containing employee notes + + } empNotes; + +enum charcheck + { + match //Used an enum to set 0 to 'match' so the conditionals using strcmp make more intuitive sense + }; + +// + + +int intro( ) { + + int i, j, k = 5; + + char message01[] = "Welcome to ROBCO Industries (TM) Termlink\n\n\n\n"; + char message02[] = "Password Required: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ "; + char linemessage01[] = "__________________________________________________________\n"; + char help[] = "h"; + char password[] = "H5A6E9B7"; + char successmessage01[] = "\nAccess to ROBCO Industries (TM) Termlink granted.\n\n"; + char successMessage02[] = "Welcome, USER\n\n"; + char failureMessage01[] = "\nAccess to ROBCO Industries (TM) Termlink denied.\n\n"; + char abort[] = "abort"; + char helpgrid[] = " 1 2 3 4 5 6 7 8 9"; + char introFin[20]; + char entry[20]; + + printf("\n\n 1 2 3 4 5 6 7 8 9\nA X X X X X 2 X X X\nB X X X X X X 4 X X\nC X X X X X X X X X\nD X X X X X X X X X\nE X X X X X X X X 3\nF X X X X X X X X X\nG X X X X X X X X X\nH X X X X 1 X X X X\nI X X X X X X X X X\n"); //this is the grid puzzle that shows the password to get into the terminal + + + for(i=0;i<200;i++){ + printf("\n"); //print 200 new lines to clear screen + } + + printf("%75s\n", linemessage01); + printf("%68s\n", message01); + printf("\n"); + printf("%75s\n", message02); + printf("%75s\n\n\n\n", linemessage01); //print the menu + + printf("Password: "); + + + while(strcmp(password, entry) != match){ + + + + for(k=5;k>=0;k--) + { + scanf("%s", entry); + + while(k == 1) { + printf("\n\nEmployees: Please look uUP@UP@UP@UP@UP@UP@UP@@@ your personal password in the directory located within the main office.\n\n"); + break; //If you enter 4 incorrect guesses, this message is printed, hinting to look up + } + + if(strcmp(password, entry) != match) { + printf("Please try again... %d tries remaining...\n", k);} + + else if(strcmp(password, entry) == match) { + printf("%75s\n", successmessage01); + printf("%75s\n", successMessage02); + printf("\nEnter any key to continue. To abort, enter 'abort'\n"); + + scanf("%s", introFin); + while(strcmp(abort, introFin) == match){ + + return 0; } + + return 1; + } + } + printf("%75s\n", failureMessage01); + return 0; + } + + +} + +// + + +int menu() { + + empProfile emp1={"Smith", "John", 36748, "Senior Project Manager", "N/A", 90000}; + empProfile emp2={"Windas", "Peter", 73625, "Secretary", "John Smith", 35000}; + empProfile emp3={"Gershengorn", "Caleb", 10293, "Associate Engineer", "John Smith", 40000}; + empProfile emp4={"Yu", "Justin", 10293, "Associate Engineer", "John Smith", 40000}; + empProfile emp5={"Delaney", "Kurt", 10293, "Associate Engineer", "John Smith", 40000}; + empProfile emp6={"Fieri", "Guy", 10293, "Associate Engineer", "John Smith", 40000}; + empProfile emp7={"EEE", "@@", 33223, "Asnngggg^^^^^^^^", "JJJJJJJJJ", 4}; + empProfile emp8={")))))deepr", "go", 11111, "A", "John Smith", 999999}; //members of employee profile struct + + empNotes emp1N={"NULL"}; + empNotes emp2N={"Windas, Peter 3/24/1989: >>Performance generally meets expectations--Pay is quite high compared to his peers in level V"}; //members of employee notes struct + empNotes emp3N={"Gershengorn, Caleb 5/14/1989: >>May be overqualified for new position. May receive an increase at this time."}; + empNotes emp4N={"Yu, Justin 4/3/1991: @@@@@@@@@@@@@@@@@@@@@@$$$$"}; + empNotes emp5N={"Delaney, KuU|U|U|U|U|deeper@go~````dddeeper&&&&go~``````dddeeper&&&&&&&"}; + empNotes emp6N={"Fieri, Guy 3/5/1990: 999999993((((((((((((((((((((((((((((ecord may need to be reviewed^^^^^^^^^^^^^^^^^"}; + empNotes emp7N={"EEE,EEEiiii@@@@reconsider in 6 mont###################"}; + empNotes emp8N={":::::"}; + + char message01[] = "Welcome to ROBCO Industries (TM) Termlink \n"; + char menuLine1[] = ">> 1. View employee profiles \n"; + char menuLine2[] = ">> 2. View employee progress notes \n"; + char menuLine3[] = ">> 3. View PROJECT SAFEHOUSE experiment history \n"; + char menuLine4[] = ">> 4. Access system administrator menu (Admin Password Required) \n"; + char menuLine5[] = " ((Enter '0' at any time to re-print these options)) "; + char lineLine1[] = "------------------------------------------------------------------\n"; + char lineLine2[] = "----------------------------------------------------------------------------------------------------------\n"; + + int option, i, option1 = 1, clearScreen = 300; + char ch; + + for(i=0;i<28;i++){ + printf("\n"); + } + + printf("%75s\n%75s\n%75s%75s\n%75s%75s%75s%75s\n%75s\n\n%75s", lineLine1, message01, lineLine1, lineLine1, menuLine1, menuLine2, menuLine3, menuLine4, menuLine5, lineLine1); //prints the strings that make up the menu + + + + for(i=0;i<20;i++){ + printf("\n"); + } + + + option = 2; + + while(option > 1 || option < 5) { //while loop for menu user input + printf(">>"); + scanf("%d", &option); + switch(option){ + + case 0 : //case 0 reprints the menu + + for(i=0;i>", l); + scanf("%d", &digGuess); + printf("\n"); + arr1[k] = digGuess; + } + + printf("\n\n"); + + for(j=0;j<4;j++) { + + + if(arr1[j] == arr2[j]) { + numCorrect++; + } + + } + + printf("%d/4 correct", numCorrect); + + if (numCorrect == 4) + { + printf("\n"); + + return 1; + } + } + + return 1; + + } + +return 0; + +} + +int adminMenu() { //NOT YET IMPLEMENTED: The admin menu is a replica of the original menu, with added administrative options and hints for the next puzzle hidden throughout the glitched text garbage + + empProfile emp1={"Smith", "John", 36748, "Senior Project Manager", "N/A", 90000}; + empProfile emp2={"Windas", "Peter", 73625, "Secretary", "John Smith", 35000}; + empProfile emp3={"Gershengorn", "Caleb", 10293, "Associate Engineer", "John Smith", 40000}; + empProfile emp4={"Yu", "Justin", 10293, "Associate Engineer", "John Smith", 40000}; + empProfile emp5={"Delaney", "Kurt", 10293, "Associate Engineer", "John Smith", 40000}; + empProfile emp6={"Fieri", "Guy", 10293, "Associate Engineer", "John Smith", 40000}; + empProfile emp7={"EEE", "@@", 33223, "Asnngggg^^^^^^^^", "JJJJJJJJJ", 4}; + empProfile emp8={")))))deepr", "go", 11111, "A", "John Smith", 999999}; //members of employee profile struct + + empNotes emp1N={"NULL"}; + empNotes emp2N={"Windas, Peter 3/24/1989: >>Performance generally meets expectations--Pay is quite high compared to his peers in level V"}; //members of employee notes struct + empNotes emp3N={"Gershengorn, Caleb 5/14/1989: >>May be overqualified for new position. May receive an increase at this time."}; + empNotes emp4N={"Yu, Justin 4/3/1991: @@@@@@@@@@@@@@@@@@@@@@$$$$"}; + empNotes emp5N={"Delaney, KuU|U|U|U|U|deeper@go~````dddeeper&&&&go~``````dddeeper&&&&&&&"}; + empNotes emp6N={"Fieri, Guy 3/5/1990: 999999993((((((((((((((((((((((((((((ecord may need to be reviewed^^^^^^^^^^^^^^^^^"}; + empNotes emp7N={"EEE,EEEiiii@@@@reconsider in 6 mont###################"}; + empNotes emp8N={":::::"}; + + char message01[] = "Welcome to ROBCO Industries (TM) Termlink \n"; + char menuLine1[] = ">> 1. View employee profiles \n"; + char menuLine2[] = ">> 2. View employee progress notes \n"; + char menuLine3[] = ">> 3. View PROJECT SAFEHOUSE experiment history \n"; + char adminLine1[] = ">> 5. Facility tempurature control \n"; + char adminLine2[] = ">> 6. Facility atmospheric pressure control \n"; + char adminLine3[] = ">> 7. Facility entrance/exit vault control \n"; + char menuLine5[] = " ((Enter '0' at any time to re-print these options)) "; + char lineLine1[] = "------------------------------------------------------------------\n"; + char lineLine2[] = "----------------------------------------------------------------------------------------------------------\n"; + + int option, i, option1 = 1, clearScreen = 300; + char ch; + + for(i=0;i<28;i++){ + printf("\n"); + } + + printf("%75s\n%75s\n%75s%75s\n%75s%75s%75s%75s%75s%75s%75s\n%75s\n", lineLine1, message01, lineLine1, lineLine1, menuLine1, menuLine2, menuLine3, adminLine1, adminLine2, adminLine3, menuLine5, lineLine1); + //prints the strings that make up the menu + + + + for(i=0;i<20;i++){ + printf("\n"); + } + + + option = 2; + + while(option > 1 || option < 5) { //while loop for menu user input + printf(">>"); + scanf("%d", &option); + switch(option){ + + case 0 : //case 0 reprints the menu + + for(i=0;i>No measures have been taken to prevent incorrect user input from breaking the game! + +GUIDE/FUTURE PLANS: + +The first puzzle requires you to enter a password to enter the terminal. If you guess +random entries, after 4 incorrect guesses, text is printed that hints to look up. +if you scroll up far enough, a grid of X's is shown where some X's are replaced with +numbers. The password consists of the coordinates of each number in sequence. The +password is H5A6E9B7. + +The second puzzle is not functioning yet, but it requires the user to input a PIN +number to access the admin menu. The PIN is randomly generated and the user will guess +it digit-by-digit. after entering each digit the terminal will tell the user how many +digits he/she guessed correctly. The correct guesses include placement, so the user has +a clue as to how close he/she is. There is also a limited number of times the user can +before he/she is kicked out of the terminal. + + +The main menu is fully implemented in this version but if you try to advance into the +administrative menu there is still no method to return to the main menu. The +administrative menu is coded into the game, but since the PIN guessing puzzle isn't +functioning, there is no way to access the admin menu currently. + +The game's admin menu will be a replica of the main menu plus extra administrative +options. one of these options will be exit vault control, which will be 'corrupted', +leading the player to find another way through. There will be hints hidden throughout +the admin menu that will guide the player to the file system, where they have to do some +file manipulation to be able to access vault door controls and exit. \ No newline at end of file