P R E L I M I N A R Y S P E C I F I C A T I O N Due 2:00 am, Friday, 01 May 2020 CPSC 223b Homework #7 If At First You Don't Succeed, ... (It Boggles my Mind) REMINDER: Do not under any circumstances copy someone else's code for this assignment, give your code to someone else, or make it publicly available. After discussing any aspect of the assignment with anyone other than a member of the teaching staff (such discussions must be noted in your log file), do not keep any written or electronic record and engage in some mind-numbing activity before you work on the assignment again. Sharing ANY related document (e.g., code or test cases) is a violation of this policy. Since code reuse is an important part of programming, you may study published code (e.g., from textbooks or the Net) and/or incorporate it in a program, provided that you give proper attribution in your log file and in your source file(s) (see the syllabus for details) and that the bulk of the code submitted is your own. Note: Removing/rewriting comments, renaming functions/variables, or reformatting statements does not convey ownership. (40) Write a program Boggle [-c] [-t] nRows nCols board that can be used to list every word in the standard input that is a "Boggle word" for the NROWS x NCOLS array BOARD. The standard input contains one word per line, each containing only alphabetic characters. These words serve as the "Boggle dictionary". The characters in the array are stored in the command-line argument BOARD by rows. For example, % Boggle 3 4 ABCDEFGHIJKL specifies the board A B C D E F G H I J K L since NROWS = 3 and NCOLS = 4. A word is a Boggle word if its letters can be spelled out by starting at one square on the board and passing through a sequence of squares that is connected horizontally, vertically, or diagonally. That is, you cannot skip intervening squares or remain on the same square to get the next letter. For example, the board E P I P R O U S T contains the words PEPPER, SUPERIOR, and REPERTOIRE among others, but not PEEPER or PROUST. When comparing letters, case is ignored and a _ on the board matches any letter (a la the blank tile in Scrabble). For example, the board E P I _ R O U S T also contains the words PEEPER and PROUST, but not JOUST. The Boggle words found are printed out in alphabetical order, in lower case, along with the number of times that they appear, using the format "%s: %d\n". For example, for the EPIPROUST board and the list of words above: pepper: 4 repertoire: 2 superior: 1 And for the EPI_ROUST board, peeper: 11 pepper: 12 proust: 4 repertoire: 16 superior: 4 With the -c flag all (and only) the non-Boggle words in the dictionary are printed in alphabetical order using the format "%s\n". Note: The real Boggle also requires that letters/wildcards on the board cannot be used more than once to form a word. This behavior is invoked by the -t flag. Use the submit command to turn in the source files for Boggle, a Makefile, and your log file (see Homework #1). YOU MUST SUBMIT YOUR FILES (INCLUDING YOUR LOG FILE) AT THE END OF ANY SESSION WHERE YOU WRITE OR DEBUG CODE, AND AT LEAST ONCE EVERY HOUR DURING LONGER SESSIONS. (All submissions are retained.) Notes ~~~~~ 1. Boggle should detect invalid command-line arguments (e.g., nonpositive numbers of rows or columns or a mismatch between the size of board and the size of the array), printing a one-line error message to stderr and exiting. However, you may use atoi() to extract a number from an argument without checking that the argument contains only digits or that the number fits into an int. 2. Your implementation of Boggle should use tries to represent the dictionary. However, you need not create a Trie ADT. Hint: You can also store in the trie a count of the number of ways to form a Boggle word. 3. To make Boggle slightly more robust (and able to use dictionaries such as /c/cs223/Doc/words that contain ', -, &, etc.), lines in the standard input that contain nonalphabetic characters are ignored and do not provoke error messages. 4. To conserve space, Boggle should * Store in the trie only those pointers corresponding to lower-case letters (worth at most 5 points). Thus it uses random access rather than linear or binary search to reference a child trie given a letter. * Free all storage before exiting (worth 0 points itself but assumed when testing the previous property). 5. The cubes in the 4x4 Boggle game contain the following combinations of letters (each group of 6 represents the 6 faces of one cube): LRYTTE ANAEEG AFPKFS YLDEVR EGHWNE OATTOW HCPOAS NMIQHU VTHRWE IDSYTT XLDERI ZNRNHL SEOTIS MTOICU ENSIEU OBBAOJ There is also a 5x5 version. CS-223-04/15/20