Introduction
:queue[0]Queue2,Queue[1]~[3]3~5Queue1
Requirement
COMP1911 17s1 COMP1911 - Introduction to Programming - 17s1 Introduction to Programming
Assignment 2 - C Words
Modifications:
16/05 modified signal handler code for the bonus stage
13/05 Added information about signal handlers for the bonus stage
Introduction
The aim of the game C Words is to see words that be created from the letters you are given in a way to maximise your score!
The game is played on an n x n grid (we will use a 5 x 5 grid). Tiles are succesively drawn from a pile of tiles. Each tile is marked with a letter and a score. Players enter the letter and score into one square of the grid with the purpose of forming as many 3 to n letter words, horizontally and vertically, as possible. Players list all words formed and total a score for each word by adding the score associated with each letter of the word. The final game score is then obtained by adding the score for each word once all squares in the grid have been filled.
Stage 0: Reading tiles
In Stage 0 your are to implement a program that first prompts the user for a list of nxn (25) tiles. The program then prints out the tiles.
The tiles can be entered with any number of spaces (or no spaces) between the letters and the scores. Letters may be entered as lower case or upper case, but should always be printed as lower case. The scores should integers, greater than or equal to 0 and less than or equal to 100.
If the input is incorrect, the program should exit with the error message. You should print all error messages to the standard error stream.
Error in input
~cs1911/bin/CWords
Enter 25 tiles: i 2 h 2 s 1 r 1 v 4 b 1 l 5 k 1 e 2 m 2 n 5 o 4 i 3 l 5 t 5 a 1 e 2 f 2 r 4 n 3a 2 h 3 g 2 s 5 r 3
Tiles: i/2 h/2 s/1 r/1 v/4 b/1 l/5 k/1 e/2 m/2 n/5 o/4 i/3 l/5 t/5 a/1 e/2 f/2 r/4 n/3 a/2 h/3 g/2 s/5 r/3
Stage 1: Placing Tiles on the Grid
Once you have implemented Stage 0, you must build on your program and present each letter/value to the user and prompt them to enter the row and column in which to place the tile. At each turn, the current state of the game board is printed to the screen. Once all 25 letter/value pairs are placed on the game board, the game ends. Here is a sample behaviour for your program at the end of this stage.
~cs1911/bin/CWords
Enter 25 tiles: i 2 h 2 s 1 r 1 v 4 b 1 l 5 k 1 e 2 m 2 n 5 o 4 i 3 l 5 t 5 a 1 e 2 f 2 r 4 n 3a 2 h 3 g 2 s 5 r 3
Tiles: i/2 h/2 s/1 r/1 v/4 b/1 l/5 k/1 e/2 m/2 n/5 o/4 i/3 l/5 t/5 a/1 e/2 f/2 r/4 n/3 a/2 h/3 g/2 s/5 r/3
Enter row and column for each tile …
Tile #1: i/2? 0 1
0 1 2 3 4
0: ./. i/2 ./. ./. ./.
1: ./. ./. ./. ./. ./.
2: ./. ./. ./. ./. ./.
3: ./. ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #2: h/2? 0 0
0 1 2 3 4
0: h/2 i/2 ./. ./. ./.
1: ./. ./. ./. ./. ./.
2: ./. ./. ./. ./. ./.
3: ./. ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #3: s/1? 0 2
0 1 2 3 4
0: h/2 i/2 s/1 ./. ./.
1: ./. ./. ./. ./. ./.
2: ./. ./. ./. ./. ./.
3: ./. ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #4: r/1? 0 3
0 1 2 3 4
0: h/2 i/2 s/1 r/1 ./.
1: ./. ./. ./. ./. ./.
2: ./. ./. ./. ./. ./.
3: ./. ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #5: v/4? 1 0
0 1 2 3 4
0: h/2 i/2 s/1 r/1 ./.
1: v/4 ./. ./. ./. ./.
2: ./. ./. ./. ./. ./.
3: ./. ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #6: b/1? 2 0
0 1 2 3 4
0: h/2 i/2 s/1 r/1 ./.
1: v/4 ./. ./. ./. ./.
2: b/1 ./. ./. ./. ./.
3: ./. ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #7: l/5? 0 4
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 ./. ./. ./. ./.
2: b/1 ./. ./. ./. ./.
3: ./. ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #8: k/1? 3 0
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 ./. ./. ./. ./.
2: b/1 ./. ./. ./. ./.
3: k/1 ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #9: e/2? 4 0
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 ./. ./. ./. ./.
2: b/1 ./. ./. ./. ./.
3: k/1 ./. ./. ./. ./.
4: e/2 ./. ./. ./. ./.
Tile #10: m/2? 1 1
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 ./. ./. ./.
2: b/1 ./. ./. ./. ./.
3: k/1 ./. ./. ./. ./.
4: e/2 ./. ./. ./. ./.
Tile #11: n/5? 4 1
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 ./. ./. ./.
2: b/1 ./. ./. ./. ./.
3: k/1 ./. ./. ./. ./.
4: e/2 n/5 ./. ./. ./.
Tile #12: o/4? 2 1
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 ./. ./. ./.
2: b/1 o/4 ./. ./. ./.
3: k/1 ./. ./. ./. ./.
4: e/2 n/5 ./. ./. ./.
Tile #13: i/3? 1 2
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 ./. ./.
2: b/1 o/4 ./. ./. ./.
3: k/1 ./. ./. ./. ./.
4: e/2 n/5 ./. ./. ./.
Tile #14: l/5? 1 3
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 ./.
2: b/1 o/4 ./. ./. ./.
3: k/1 ./. ./. ./. ./.
4: e/2 n/5 ./. ./. ./.
Tile #15: t/5? 3 4
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 ./.
2: b/1 o/4 ./. ./. ./.
3: k/1 ./. ./. ./. t/5
4: e/2 n/5 ./. ./. ./.
Tile #16: a/1? 2 2
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 ./.
2: b/1 o/4 a/1 ./. ./.
3: k/1 ./. ./. ./. t/5
4: e/2 n/5 ./. ./. ./.
Tile #17: e/2? 1 4
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 ./. ./.
3: k/1 ./. ./. ./. t/5
4: e/2 n/5 ./. ./. ./.
Tile #18: f/2? 3 2
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 ./. ./.
3: k/1 ./. f/2 ./. t/5
4: e/2 n/5 ./. ./. ./.
Tile #19: r/4? 2 3
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 r/4 ./.
3: k/1 ./. f/2 ./. t/5
4: e/2 n/5 ./. ./. ./.
Tile #20: n/3? 4 2
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 r/4 ./.
3: k/1 ./. f/2 ./. t/5
4: e/2 n/5 n/3 ./. ./.
Tile #21: a/2? 3 1
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 r/4 ./.
3: k/1 a/2 f/2 ./. t/5
4: e/2 n/5 n/3 ./. ./.
Tile #22: h/3? 4 4
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 r/4 ./.
3: k/1 a/2 f/2 ./. t/5
4: e/2 n/5 n/3 ./. h/3
Tile #23: g/2? 3 3
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 r/4 ./.
3: k/1 a/2 f/2 g/2 t/5
4: e/2 n/5 n/3 ./. h/3
Tile #24: s/5? 2 4
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 r/4 s/5
3: k/1 a/2 f/2 g/2 t/5
4: e/2 n/5 n/3 ./. h/3
Tile #25: r/3? 4 3
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 r/4 s/5
3: k/1 a/2 f/2 g/2 t/5
4: e/2 n/5 n/3 r/3 h/3
As each tile is presented, the user must enter the row and column number in which to place the tile (these are both numbered from 0). If the grid square is already occupied, the user is prompted again for the same tile. If the grid square does not exist or the input is otherwise incorrect, the program should exit with the error message printed to the standard error stream.
Error in input
Stage 2: Calculating the Score
Extend your program from Stage 1 so that it tallies the score for all 3, 4 and 5 letter words running left-to-right and top-to-bottom when all 25 letter/value pairs have been placed on the game board. Furthermore, on the last line of output your program should print a list of letter/value pairs from left-to-right and top-to-bottom representing the final state of the game board.
~cs1911/bin/CWords
Enter 25 tiles: i 2 h 2 s 1 r 1 v 4 b 1 l 5 k 1 e 2 m 2 n 5 o 4 i 3 l 5 t 5 a 1 e 2 f 2 r 4 n 3a 2 h 3 g 2 s 5 r 3
Tiles: i/2 h/2 s/1 r/1 v/4 b/1 l/5 k/1 e/2 m/2 n/5 o/4 i/3 l/5 t/5 a/1 e/2 f/2 r/4 n/3 a/2 h/3 g/2 s/5 r/3
Enter row and column for each tile …
Tile #1: i/2? 0 1
0 1 2 3 4
0: ./. i/2 ./. ./. ./.
1: ./. ./. ./. ./. ./.
2: ./. ./. ./. ./. ./.
3: ./. ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #2: h/2? 0 0
0 1 2 3 4
0: h/2 i/2 ./. ./. ./.
1: ./. ./. ./. ./. ./.
2: ./. ./. ./. ./. ./.
3: ./. ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #3: s/1? 0 2
0 1 2 3 4
0: h/2 i/2 s/1 ./. ./.
1: ./. ./. ./. ./. ./.
2: ./. ./. ./. ./. ./.
3: ./. ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #4: r/1? 0 3
0 1 2 3 4
0: h/2 i/2 s/1 r/1 ./.
1: ./. ./. ./. ./. ./.
2: ./. ./. ./. ./. ./.
3: ./. ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #5: v/4? 1 0
0 1 2 3 4
0: h/2 i/2 s/1 r/1 ./.
1: v/4 ./. ./. ./. ./.
2: ./. ./. ./. ./. ./.
3: ./. ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #6: b/1? 2 0
0 1 2 3 4
0: h/2 i/2 s/1 r/1 ./.
1: v/4 ./. ./. ./. ./.
2: b/1 ./. ./. ./. ./.
3: ./. ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #7: l/5? 0 4
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 ./. ./. ./. ./.
2: b/1 ./. ./. ./. ./.
3: ./. ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #8: k/1? 3 0
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 ./. ./. ./. ./.
2: b/1 ./. ./. ./. ./.
3: k/1 ./. ./. ./. ./.
4: ./. ./. ./. ./. ./.
Tile #9: e/2? 4 0
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 ./. ./. ./. ./.
2: b/1 ./. ./. ./. ./.
3: k/1 ./. ./. ./. ./.
4: e/2 ./. ./. ./. ./.
Tile #10: m/2? 1 1
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 ./. ./. ./.
2: b/1 ./. ./. ./. ./.
3: k/1 ./. ./. ./. ./.
4: e/2 ./. ./. ./. ./.
Tile #11: n/5? 4 1
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 ./. ./. ./.
2: b/1 ./. ./. ./. ./.
3: k/1 ./. ./. ./. ./.
4: e/2 n/5 ./. ./. ./.
Tile #12: o/4? 2 1
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 ./. ./. ./.
2: b/1 o/4 ./. ./. ./.
3: k/1 ./. ./. ./. ./.
4: e/2 n/5 ./. ./. ./.
Tile #13: i/3? 1 2
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 ./. ./.
2: b/1 o/4 ./. ./. ./.
3: k/1 ./. ./. ./. ./.
4: e/2 n/5 ./. ./. ./.
Tile #14: l/5? 1 3
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 ./.
2: b/1 o/4 ./. ./. ./.
3: k/1 ./. ./. ./. ./.
4: e/2 n/5 ./. ./. ./.
Tile #15: t/5? 3 4
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 ./.
2: b/1 o/4 ./. ./. ./.
3: k/1 ./. ./. ./. t/5
4: e/2 n/5 ./. ./. ./.
Tile #16: a/1? 2 2
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 ./.
2: b/1 o/4 a/1 ./. ./.
3: k/1 ./. ./. ./. t/5
4: e/2 n/5 ./. ./. ./.
Tile #17: e/2? 1 4
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 ./. ./.
3: k/1 ./. ./. ./. t/5
4: e/2 n/5 ./. ./. ./.
Tile #18: f/2? 3 2
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 ./. ./.
3: k/1 ./. f/2 ./. t/5
4: e/2 n/5 ./. ./. ./.
Tile #19: r/4? 2 3
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 r/4 ./.
3: k/1 ./. f/2 ./. t/5
4: e/2 n/5 ./. ./. ./.
Tile #20: n/3? 4 2
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 r/4 ./.
3: k/1 ./. f/2 ./. t/5
4: e/2 n/5 n/3 ./. ./.
Tile #21: a/2? 3 1
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 r/4 ./.
3: k/1 a/2 f/2 ./. t/5
4: e/2 n/5 n/3 ./. ./.
Tile #22: h/3? 4 4
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 r/4 ./.
3: k/1 a/2 f/2 ./. t/5
4: e/2 n/5 n/3 ./. h/3
Tile #23: g/2? 3 3
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 r/4 ./.
3: k/1 a/2 f/2 g/2 t/5
4: e/2 n/5 n/3 ./. h/3
Tile #24: s/5? 2 4
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 r/4 s/5
3: k/1 a/2 f/2 g/2 t/5
4: e/2 n/5 n/3 ./. h/3
Tile #25: r/3? 4 3
0 1 2 3 4
0: h/2 i/2 s/1 r/1 l/5
1: v/4 m/2 i/3 l/5 e/2
2: b/1 o/4 a/1 r/4 s/5
3: k/1 a/2 f/2 g/2 t/5
4: e/2 n/5 n/3 r/3 h/3
Words:
his = 5
mil = 10
boa = 6
oar = 9
les = 12
Words of length 3 = 42
mile = 12
boar = 10
oars = 14
moan = 13
lest = 17
Words of length 4 = 66
boars = 15
Words of length 5 = 15
TOTAL = 123
h 2 i 2 s 1 r 1 l 5 v 4 m 2 i 3 l 5 e 2 b 1 o 4 a 1 r 4 s 5 k 1 a 2 f 2 g 2 t 5 e 2 n 5 n 3 r 3 h 3
Your program should assume that the dictionary files (words3.txt, words4.txt, words5.txt) are located in the same directory as your solution binary. You can assume each dictionary contains a maximum of 5000 words. You may assume only valid 3, 4 and 5 letter words respectively are in the files.
Stage 3 Bonus: Making an AI player
Extend your program further so that if it is run with the -a (for “automatic”) option specified, it does not ask the user to place the tiles but tries to determine the optimal placement of the tiless on the game board. Your program will be given a maximum of 1 minute of CPU time to output the state of the game board that it has determined. The final game board should be output as a list of letter value pairs from left-to-right and top-to-bottom on the game board (i.e., squares: (0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (1, 0), (1, 1), etc.). The following output gives an example of your program’s output for this stage.
~cs1911/bin/CWords -a
Enter 25 tiles: i 2 h 2 s 1 r 1 v 4 b 1 l 5 k 1 e 2 m 2 n 5 o 4 i 3 l 5 t 5 a 1 e 2 f 2 r 4 n 3a 2 h 3 g 2 s 5 r 3
h 2 i 2 s 1 r 1 l 5 v 4 m 2 i 3 l 5 e 2 b 1 o 4 a 1 r 4 s 5 k 1 a 2 f 2 g 2 t 5 e 2 n 5 n 3 r 3 h 3
Note that there is no unique answer to this stage. Your program is to output the best solution it has been capable of finding in the 1 minute CPU time limit.
Note: you should document in your blog the strategy that you have employed in the challenge. You will only be able to get a maximum of 0.5 if you fail to do this.
To obtain a mark for Stage 3 your program must be capable of producing a total score at least as good as the exhaustive search program within the 1 minute limit.
If your strategy involves using as much time as possible to compare different solutions to maximise you score, you may find the following code helpful. Don’t be alarmed if you do not understand it. You do not HAVE to use it or even look at it, unless you want to use it for this stage of the assignment. The code sets an alarm to go off when 60 seconds has been reached.
You can get a copy of the code by running
cp ~cs1911/public_html/17s1/assignments/ass2/signalHandler.c .
Word Lists
There are three word list files:
words3.txt - 3 letter words
words4.txt - 4 letter words
words5.txt - 5 letter words
You can download them or copy them into your current directory using the command
cp ~cs1911/public_html/17s1/assignments/ass2/words*.txt .
You could instead just create a symbolic link to them to save disk quota
ln -s ~cs1911/public_html/17s1/assignments/ass2/words3.txt
ln -s ~cs1911/public_html/17s1/assignments/ass2/words4.txt
ln -s ~cs1911/public_html/17s1/assignments/ass2/words5.txt
Sample Binaries
A sample binary is available at ~cs1911/bin/CWords on CSE machines.
You can use to determine the required behaviour for stages0-2. This program also takes two optional arguments -a as described in Stage 3 and -e to give the result of an exhaustive search within 1 minute of CPU time.
A program to generate data for you to test your solution will be provided at ~cs1911/bin/CWords-data. This program can be run in one of four ways:
~cs1911/bin/CWords-data
Generate test data. When run in this way it will first output two seed values (that can be used in checking your solution) and then 25 letter/value pairs that can be used as input.
~cs1911/bin/CWords-data shuffleSeed valueSeed
Where shuffleSeed and valueSeed are two integer seed values provided by the user. Generate test data using the two integer seed values provided.
~cs1911/bin/CWords-data -c
You will be prompted for 25 letter/value pairs which will be placed on the game board from left-to-right and top-to-bottom. The score for this game board will be output.
~cs1911/bin/CWords-data -c shuffleSeed valueSeed As in the previous option except that you supply two integer seed values. The 25 letter/value pairs will also be checked against the 25 letter/values pairs generated using these two seeds. We will use this option to check Stage 3.
Blog
You must keep notes on your blog every time you work on this assignment.
How to Blog
Go to the COMP1911 Home Page
Log in with your zid and zpass
Click on the speech bubble icon at the bottom of the side navigation panel near your name.
Click on “Create Post”
Your blog should include
The amount of time you spent
Whether you were reading and understanding, designing, coding, debugging or testing.
What you learnt or achieved
Mistakes you made and how you could try to avoid or minimise them next time
What kind of data structures you chose and why (ie what types did you use for your variables, to store your words and your tiles etc). What other choices did you consider?
If you do stage 3 Bonus, write about the strategy you used.
Hints:
Be specific and include concrete examples of what you did. Only tutors can read your blog so you can include code snippets
Don’t panic if English is your second language or if you are not a ‘great’ writer. We understand and we do not expect the next great novel of our time.
Assessment
Assignment 2 is worth 15 Marks. Your submission will be assessed in the following way:
Stage 0 (Automarking): 2 Marks
Stage 1 (Automarking): 4.5 Marks
Stage 2 (Automarking): 4.5 Marks
Stage 3 Bonus (Ranking): 1 Mark
Programming style. 3 Marks
Assignment blog: 1 Mark
Note: You can get 16/15 for this assignment if you do the bonus stage 3. You can get 15/15 without doing the bonus stage 3. Getting 16/15 can make up for lost marks in assignment 1 or labs, but not the final exam. We’ll test performance by running your program on a range of inputs (test cases). There will be separate tests for each of the stages of the assignment. Marks are awarded for each test case for which your program produces output identical to the output of the reference program. About half the marks will be for simple tests and about half for trickier ones.
Note: We do not just use the same tests as the submission autotests. We test on a whole batch of unknown test cases. Passing all the submission tests is a great start, but does not guarantee you will pass all of our test cases.
Originality of Work
The work you submit must be your own work. Submission of work partially or completely derived from any other person or jointly written with any other person is not permitted. The penalties for such an offence may include negative marks, automatic failure of the course and possibly other academic discipline. Assignment submissions will be examined both automatically and manually for such submissions.
Relevant scholarship authorities will be informed if students holding scholarships are involved in an incident of plagiarism or other misconduct.
Do not provide or show your assignment work to any other person - apart from the teaching staff of COMP1911. If you knowingly provide or show your assignment work to another person for any reason, and work derived from it is submitted you may be penalized, even if the work was submitted without your knowledge or consent. This may apply even if your work is submitted by a third party unknown to you.
Note, you will not be penalized if your work is taken without your consent or knowledge.
Submission
Stages 0 + 1 + 2 and stage 3 will be submitted separately to allow us to easily run the stage 3 “competitions”.
Remember your program is going to be automatically marked so be careful to follow the desired output to the letter ;)
Submit early so you can see the results of the submission autotests in case they reveal problems.
This assignment is due Friday 2nd June at 23:59:59 Submit the standard part of the assignment using this give command:
give cs1911 ass2 CWords.c
To just run the automarking tests without submission run
1911 autotest ass2
To submit for the stage 3 bonus competitions run
give cs1911 ass2Stage3 CWords.c
If your assignment is submitted after this date, each hour it is late reduces the maximum mark it can achieve by 1%. For example if an assignment worth 76% was submitted 5 hours late, the late submission would have no effect. If the same assignment was submitted 30 hours late it would be awarded 70%, the maximum mark it can achieve at that time.
Late submissions will not be considered for the Stage 3 Competition rounds