Notes on hw6codea This is the battleship program for the second week, very similar to the first weeks program: - It is capable of multiple ships, and queries the user on start up how many ships to play with. However, t does have an algorithm to make sure you cant place to many ships for the board size. The default size is 10x10. - The curent size is defined as a global variable, but can be changed, upto 20 for a 20x20 board before the size of the board is too big to be displayed all at once on the standard screen. Currently, in order to change the size, you must change the variable in the code and then recompile. - There are 5 constant global characters, which are used througout the program and referenced to so one can change the look of the output display by changing only one thing at the top of the code, which is another way of eliminating 'magic variables. - The program outputs a display of the board for each bomb. However the board displayed (in normal mode) is different from the board stored internal and only displays misses, hits, and open unbombed spaces, while the internal array also stores where the ships are located. - The display is given in col/row format, the columns are numbered and the rows are lettered (ex. 0-9, a-j) - The input for the bomb selection is in the format of (col number)(comma)(row letter) and this format must be used, although the program will accept one or two digits for the numbered column, the comma MUST be used to seperate with no spaces. However, the program will also pick a random spot if the user enters a question mark (?) as the first character of the query (the other characters are irrelevant if so) - The program has 5 avaliable command line arguments at this time which are used as switches. Using command line arguments also outputs a statment saying commmand line arguments are being used. They are: * rand : seeds the random number generator with the current time * help : displays a help message and then quits, the help includes the avaliable command line args * score : keeps score based on a scores file (REQUIRES that the file 'scores.dat' exists * norules : does not display the set of rules normally displayed when running the program * test : turns the game on test/cheat mode, displaying the internal char array (you can see the ships at all times) for testing purposes * ships : randomizes the size of the ships between 3 and 5 - Two conditions can cause overflow that are known. * entering anything but a number for the "how many ships" query. * Using far too many characters (such as over 10) for the bomb selection query.