// User input is denoted with the "> In: " prefix and an indent before it // ----jGRASP exec: java SecretSanta *** SECRET SANTA *** *** This program allows you to add the participants of the *** *** game and assign them matches to send and receive gifts. *** *** CREATE PARTICIPANTS LIST *** *** Enter the number of participants desired *** > In: 4 *** Enter the name for participant #1 *** > In: A *** Enter the email for participant #1: "A" *** > In: A@example.com *** Enter the name for participant #2 *** > In: B *** Enter the email for participant #2: "B" *** > In: B@example.com *** Enter the name for participant #3 *** > In: C *** Enter the email for participant #3: "C" *** > In: C@example.com *** Enter the name for participant #4 *** > In: D *** Enter the email for participant #4: "D" *** > In: D@example.com *** MAIN MENU *** (C)reate participants list. (L)ist the names and emails of all participants. Create (P)airings for the participants. View (A)ll the pairings of participants. View the recipient for (O)ne participant. Scroll through (E)ach recipient for all participants one by one. (S)ave participants list, their emails, and their pairings to a file. (Q)uit. > In: l *** LIST NAMES AND EMAILS OF ALL PARTICIPANTS *** 1: "A" ("A@example.com") 2: "B" ("B@example.com") 3: "C" ("C@example.com") 4: "D" ("D@example.com") *** MAIN MENU *** (C)reate participants list. (L)ist the names and emails of all participants. Create (P)airings for the participants. View (A)ll the pairings of participants. View the recipient for (O)ne participant. Scroll through (E)ach recipient for all participants one by one. (S)ave participants list, their emails, and their pairings to a file. (Q)uit. > In: a *** MATCHES OF ALL PARTICIPANTS *** *** There are no pairings created for the participants yet. *** *** MAIN MENU *** (C)reate participants list. (L)ist the names and emails of all participants. Create (P)airings for the participants. View (A)ll the pairings of participants. View the recipient for (O)ne participant. Scroll through (E)ach recipient for all participants one by one. (S)ave participants list, their emails, and their pairings to a file. (Q)uit. > In: o *** VIEW SPECIFIC RECIPIENT OF A PARTICIPANT *** *** There are no pairings created for the participants yet. *** *** MAIN MENU *** (C)reate participants list. (L)ist the names and emails of all participants. Create (P)airings for the participants. View (A)ll the pairings of participants. View the recipient for (O)ne participant. Scroll through (E)ach recipient for all participants one by one. (S)ave participants list, their emails, and their pairings to a file. (Q)uit. > In: e *** VIEW EACH RECIPIENT OF ALL PARTICIPANTS ONE BY ONE *** *** There are no pairings created for the participants yet. *** *** MAIN MENU *** (C)reate participants list. (L)ist the names and emails of all participants. Create (P)airings for the participants. View (A)ll the pairings of participants. View the recipient for (O)ne participant. Scroll through (E)ach recipient for all participants one by one. (S)ave participants list, their emails, and their pairings to a file. (Q)uit. > In: s *** SAVE ALL PARTICIPANTS NAMES, EMAILS, AND THEIR PAIRINGS TO A FILE *** *** There are no pairings created for the participants yet. *** *** MAIN MENU *** (C)reate participants list. (L)ist the names and emails of all participants. Create (P)airings for the participants. View (A)ll the pairings of participants. View the recipient for (O)ne participant. Scroll through (E)ach recipient for all participants one by one. (S)ave participants list, their emails, and their pairings to a file. (Q)uit. > In: p *** ASSIGN RECIPIENTS FOR ALL PARTICIPANTS *** *** SEARCH FOR: "A" *** Random participant was themselves...RETRYING. Random participant was themselves...RETRYING. Random participant was themselves...RETRYING. Random participant was themselves...RETRYING. Random participant found. *** SEARCH FOR: "B" *** Random participant was "C" who already has sender: "A"...RETRYING. Random participant was themselves...RETRYING. Random participant was "C" who already has sender: "A"...RETRYING. Random participant found. *** SEARCH FOR: "C" *** Random participant was themselves...RETRYING. Random participant found. *** SEARCH FOR: "D" *** Random participant was "B" who already has sender: "C"...RETRYING. Random participant was "C" who already has sender: "A"...RETRYING. Random participant was themselves...RETRYING. Random participant was "C" who already has sender: "A"...RETRYING. Random participant was "C" who already has sender: "A"...RETRYING. Random participant was "B" who already has sender: "C"...RETRYING. Random participant was themselves...RETRYING. Random participant was "A" who already has sender: "B"...RETRYING. Random participant was "A" who already has sender: "B"...RETRYING. Random participant was "C" who already has sender: "A"...RETRYING. *** NOT ALL PARTICIPANTS HAVE MATCHES *** *** RESTARTING LOOP *** *** SEARCH FOR: "A" *** Random participant found. *** SEARCH FOR: "B" *** Random participant was "C" who already has sender: "A"...RETRYING. Random participant found. *** SEARCH FOR: "C" *** Random participant was "D" who already has sender: "B"...RETRYING. Random participant found. *** SEARCH FOR: "D" *** Random participant was "B" who already has sender: "C"...RETRYING. Random participant was themselves...RETRYING. Random participant was "B" who already has sender: "C"...RETRYING. Random participant was themselves...RETRYING. Random participant was themselves...RETRYING. Random participant was themselves...RETRYING. Random participant was themselves...RETRYING. Random participant was themselves...RETRYING. Random participant was "B" who already has sender: "C"...RETRYING. Random participant was "B" who already has sender: "C"...RETRYING. Random participant was "B" who already has sender: "C"...RETRYING. Random participant was themselves...RETRYING. Random participant was themselves...RETRYING. Random participant was themselves...RETRYING. Random participant was "B" who already has sender: "C"...RETRYING. Random participant was themselves...RETRYING. Random participant was "C" who already has sender: "A"...RETRYING. Random participant found. *** ALL PARTICIPANTS HAVE MATCHES *** *** MAIN MENU *** (C)reate participants list. (L)ist the names and emails of all participants. Create (P)airings for the participants. View (A)ll the pairings of participants. View the recipient for (O)ne participant. Scroll through (E)ach recipient for all participants one by one. (S)ave participants list, their emails, and their pairings to a file. (Q)uit. > In: a *** MATCHES OF ALL PARTICIPANTS *** "A ("A@example.com")" will get a gift from "D" and send a gift to "C" "B ("B@example.com")" will get a gift from "C" and send a gift to "D" "C ("C@example.com")" will get a gift from "A" and send a gift to "B" "D ("D@example.com")" will get a gift from "B" and send a gift to "A" *** MAIN MENU *** (C)reate participants list. (L)ist the names and emails of all participants. Create (P)airings for the participants. View (A)ll the pairings of participants. View the recipient for (O)ne participant. Scroll through (E)ach recipient for all participants one by one. (S)ave participants list, their emails, and their pairings to a file. (Q)uit. > In: o *** VIEW SPECIFIC RECIPIENT OF A PARTICIPANT *** *** Select the number of a specific participant *** *** LIST NAMES AND EMAILS OF ALL PARTICIPANTS *** 1: "A" ("A@example.com") 2: "B" ("B@example.com") 3: "C" ("C@example.com") 4: "D" ("D@example.com") > In: 3 "C" will send a gift to "B" *** Press enter to clear the output *** > In: (enter) // screen cleared *** MAIN MENU *** (C)reate participants list. (L)ist the names and emails of all participants. Create (P)airings for the participants. View (A)ll the pairings of participants. View the recipient for (O)ne participant. Scroll through (E)ach recipient for all participants one by one. (S)ave participants list, their emails, and their pairings to a file. (Q)uit. > In: e *** VIEW EACH RECIPIENT OF ALL PARTICIPANTS ONE BY ONE *** *** Press enter to see the first participant "A". *** > In: (enter) // screen cleared "A" will send a gift to "C" *** Press enter to clear the screen or enter Q to go back to the main menu *** > In: (enter) // screen cleared *** Press enter to see the recipient for the next participant: B (3 left) *** *** Enter Q to go back to the main menu *** > In: (enter) // screen cleared "B" will send a gift to "D" *** Press enter to clear the screen or enter Q to go back to the main menu *** > In: (enter) // screen cleared *** Press enter to see the recipient for the next participant: C (2 left) *** *** Enter Q to go back to the main menu *** > In: (enter) // screen cleared "C" will send a gift to "B" *** Press enter to clear the screen or enter Q to go back to the main menu *** > In: (enter) // screen cleared *** Press enter to see the recipient for the next participant: D (1 left) *** *** Enter Q to go back to the main menu *** > In: (enter) // screen cleared "D" will send a gift to "A" *** Press enter to clear the screen or enter Q to go back to the main menu *** > In: (enter) // screen cleared *** There are no more participants. *** *** Press enter or enter Q to go back to the main menu *** > In: (enter) // screen cleared *** MAIN MENU *** (C)reate participants list. (L)ist the names and emails of all participants. Create (P)airings for the participants. View (A)ll the pairings of participants. View the recipient for (O)ne participant. Scroll through (E)ach recipient for all participants one by one. (S)ave participants list, their emails, and their pairings to a file. (Q)uit. > In: s *** SAVE ALL PARTICIPANTS NAMES, EMAILS, AND THEIR PAIRINGS TO A FILE *** *** Enter a desired name for the file (without a file extension). *** *** THIS WILL OVERWRITE ANY EXISTING FILE WITH THE SAME NAME. *** > In: out *** MAIN MENU *** (C)reate participants list. (L)ist the names and emails of all participants. Create (P)airings for the participants. View (A)ll the pairings of participants. View the recipient for (O)ne participant. Scroll through (E)ach recipient for all participants one by one. (S)ave participants list, their emails, and their pairings to a file. (Q)uit. > In: q // ----jGRASP: operation complete.