troons_seq
: an executable of a correct sequential implementation for you to test your programMakefile
: makefile with basic recipes to build, build with debug symbols and cleanmain.cc
: skeleton code with input logictestcases/
: example testcases from the assignment brief to get you started. Inputs have the extension.in
, expected outputs have the extension.output
.gitignore
: a sensible gitignore template for C++
This starter code comes with a Makefile and a few recipes that can be run from the command line.
make submission # builds the project using g++ and C++17
make debug # builds the project with debug symbols and a symbol `DEBUG` defined
make clean # cleans your project directory
After building, run the code with ./troons <testcase_file>
. Your program should output to stdout
(the command line
usually), and you can then pipe the output to a file like so:
./troons testcases/sample1.in > sample1.out
.
One way to test is as follows:
- Run a testcase and save the output of your program to a file. E.g.
./troons testcases/sample1.in > sample1.out
- Run the correct implementation executable provided with the same test case and save the output of that to another
file. E.g.
./troons_seq testcases/sample1.in > sample1-correct.out
- Diff the outputs of the two files. E.g.
diff sample1.out sample1-correct.out
NOTE: *.out
files are ignored by the .gitignore
file so if you wish to push your output files to github, use another extension (e.g. .output
).
- Push your code and report to this repo
- Get the commit hash. A commit hash should look something like
2957684c4985684abd8b0cdea1501a8bc8fd7bb1
(do not submit the shorter version). A commit's hash can be found either:- From your github repo. Find the commit you want to submit and click into the commit details to see the hash.
- By running
git log
in a terminal. Each commit's hash should be fully displayed along with other info about the commit.
- Submit this commit hash on Canvas via the Assignment 1 text entry box before the assignment deadline.
IMPORTANT: You can use C or C++ (C++ recommended), and you can modify any file in the starter code. We only require
that when your code is cloned on a lab machine and make submission
is run, an executable named troons
is produced in
the same directory. We will autograde your submissions, and reserve the right to deduct any number of marks if your
project does not follow this requirement.
When you push to the repo, a Github Action will run that calls make submission
then checks if a file named troons
has been produced. This is just a preliminary check that the recipe works: it does not test any functionality of the file produced, and does not guarantee that make submission
will work on a lab machine because the Github Actions environment may be different from that of a lab machine environment.
There is no penalty for failing the Github Action; but if it is failing then it may indicate that the build will also fail on a lab machine (which will be penalised).
We highly recommend that you clone your repository on a few different lab machines, build your program and test its correctness and/or performance.