C#,Web。
Introduction
Assessment Tasks 1 and 2 comprise parts of the one project that must be developed using C# and MS Visual Studio. These require you to design and develop software related to the word game called crozzle (see class notes of week 1).
Assessment Task 1 focuses on
- loading data from three files related to configuration, allowable words, and a completed crozzle,
- validating/invalidating the three input data files
- validating/invalidating a crozzle that is described in these files,
- computing the score of a crozzle,
- displaying that crozzle and its score,
- coding to conventions and standards,
- coding unit tests,
- implementing menus, file dialogs, web browser(s) and regular expressions, and
- creating a portfolio document;
Assessment Task 2 focuses on
- loading data from three files related to creating a new crozzle such that its score is valid and is the highest possible that you can achieve,
- ensuring that this new crozzle is valid,
- saving this new crozzle to a file,
- optimisation techniques,
- appropriate scoping of code elements,
- method characteristics such as cohesion and coupling,
- the usage of return statements,
- implementing exception handling, and
- creating a portfolio document;
Software Requirements - GUI
Your software solution for Assessment Task 1 requires a GUI interface. As part of your GUI, you must use one or more WebBrowser controls to display program generated data such as the crozzle, crozzle’s score, and errors detected during validation. For example, it’s possible to transform program generated data to HTML, then use a WebBrowser control to render this HTML.
It is essential that you use one or more WebBrowser controls from the Toolbox of Visual Studio. Like a Button control, you can drag and drop a WebBrowser control from the Toolbox to your GUI form. You must not use IE, Firefox, or other common browsers.
Software Requirements - Crozzle TXT file
Your software solution for Assessment Task 1 requires the following data from a crozzle TXT file to be read by your program during runtime (see “Test 1 Crozzle.txt” as an example).
-
Lines contain zero or more white spaces are allowed.
-
Lines containing a comment are allowed. The symbol // will indicate the start of a comment, the end of line will represent the end of a comment. It will be possible to mix data and a comment on one line. For example: ROWS=10 // A crozzle of 10 rows.
-
There will be a line containing the file name of a configuration file. This can be an absolute or a relative file name.
-
There will be a line containing the file name of a file that contains a comma separated list of words. This file name can also be absolute or relative. Two examples are:
-
There will be a line containing a positive integer representing the actual number of rows in the crozzle. For example: ROWS=10
-
There will be a line containing a positive integer representing the actual number of columns in the crozzle. For example: COLUMNS=10
-
For each horizontal word displayed in a crozzle (as depicted in Figure 1) there is a line of data. For example: ROW=2,OSCAR,9
Such a line includes the following three kinds of values, separated by commas:
- i. the orientation identifier, equals symbol, and the row number. This number indicates which row the word is placed: the first row is represented by the number 1,
- ii. the actual word, and
- iii. the column number of the first letter of that word: the first column is represented by the number 1.
-
For each vertical word displayed in a crozzle (as depicted in Figure 1) there is a line of data. For example: COLUMN=11,CHARLES,2
Such a line includes the following three kinds of values, separated by commas:
- i. the orientation identifier, equals symbol, and the column number. This number indicates which column the word is placed: the first column is represented by the number 1,
- ii. the actual word, and
- iii. the row number of the first letter of that word: the first row is represented by the number 1.
-
As there is no predefined ordering to these data items, the following 2 crozzle file examples are valid.
Software Requirements - Configuration TXT file
Your software solution for Assessment Task 1 requires the following data from a configuration TXT file to be read by your program during runtime (an example can be seen in “Test 1 Configuration.txt”):
-
Lines contain zero or more white spaces are allowed.
-
Lines containing a comment are allowed. The symbol // will indicate the start of a comment, the end of line will represent the end of a comment. It will be possible to mix data and a comment on one line. For example: LOGFILE_NAME=quot;.\..\log.txtquot; // relative file name
-
There will be a line containing the file name of a log file. This can be an absolute or relative file name.
-
There will be two lines, each containing a positive integer representing limits to the number of unique words in the word list.
-
There will be a line containing a string representing the score of an invalid crozzle. For example: INVALID_CROZZLE_SCORE=quot;INVALID CROZZLEquot;
-
There will be a line containing a Boolean representing whether or not to display the crozzle using uppercase or lowercase letters. For example: UPPERCASE=true
-
There will be a line containing a string representing a HTML style, which can be used to manage how to render a crozzle.
-
There will be two lines containing colour codes representing the background colour of empty and non-empty crozzle cells.
-
There will be four lines containing limits on the size of a crozzle’s grid.
-
There will be four lines containing limits on the number of horizontal and vertical words within a valid crozzle.
-
There will be four lines containing limits on the number of intersecting vertical words for each horizontal word, and the number of intersecting horizontal words for each vertical word.
-
There will be two lines containing limits on the number of duplicate words allowed within a crozzle.
-
There will be two lines containing limits on the number of valid disconnected groups of words that are allowed within a crozzle. A maximum value of 1 indicates that all words in the crozzle are within 1 connected group of words. The crozzle in Figure 1 shows 2 disconnected groups of words; one group is shaded in yellow, the other group is shaded in orange.
-
There will be one line containing the number of points per word within a crozzle. For example: POINTS_PER_WORD=10
The seven horizontal and seven vertical words in the crozzle depicted in Figure 1 would score 70+70=140 points, based on this example.
-
There will be one line containing the number of points per letter, where each such letter is at the intersection of a horizontal and vertical word.
-
There will be one line containing the number of points per letter, where each such letter is not at the intersection of a horizontal and vertical word.
Software Requirements - Word list TXT file
-
Your software solution for Assessment Task 1 requires comma separated words to be read by your program during runtime (see “Test 1 Wordlist.txt” as an example).
-
A valid word list file does not contain duplicates.
Software Requirements - Validating files and crozzle
-
Your software solution for Assessment Task 1 requires the three TXT input data files to be validated. Aspects of these files which are found to be invalid must be written to a log file and displayed on your GUI.
-
Your software solution for Assessment Task 1 requires the crozzle to be validated too, but only if the input data files are valid.
Consequently, it is possible to have valid input files, but the crozzle is invalid. For example, if the value of MAXIMUM_NUMBER_OF_GROUPS is less than 2, the crozzle in Figure 1 is invalid.
Aspects of this crozzle that are invalid must be written to a log file and displayed on your GUI.
Software Requirements - Displaying a crozzle and its score
-
Whether or not the input files and crozzle are valid, your software solution for Assessment Task 1 requires that a valid or invalid crozzle is displayed on your GUI. For example, depending on configuration settings or the word list file, the crozzle in Figure 1 might be valid/invalid, but it can still be displayed.
-
Your software solution for Assessment Task 1 requires the score of a valid crozzle to be computed and displayed on your GUI. However, display the appropriate configuration value for the score of an invalid crozzle.
Software Requirements - Constraints
Your software solution for Assessment Task 1 requires constraints to be considered and adhered to when validating a crozzle and determining a crozzle score. These constraints are:
- A valid crozzle must conform to configuration settings.
- Each sequence of two or more horizontal (vertical) characters delimited by spaces or the crozzle edge must form a word that can be found in the wordlist.
- A horizontal word can only run from left to right.
- A vertical word can only run from high to low.
- Diagonal sequences of characters, which can be formed by horizontal and vertical words, are not pertinent to scoring or validity.
Data files
To help you design and develop your solution to Assessment Task 1, you will be provided with 9 files as listed in the following table. The validity of each file and the associate crozzle is also listed in this table. That is:
- The three files for Test 1 are all valid, and also the crozzle is valid. Consequently, your program should not detect and report issues for this group of test files.
- The three files for Test 2 are all invalid, and also the crozzle is invalid. Portions of this invalid crozzle cannot be displayed as, for example, there is not enough data in the crozzle file to identify the location of a word. However, other portions of this invalid crozzle can be displayed on the GUI.
- The three files for Test 3 are all valid, but the crozzle is actually invalid. Your program must display as much of this invalid crozzle as possible.