This mini-project uses Cmake to compile the source code. In case you haven't installed Cmake, I recommend that you search for the instruction to install it on Google.
I assume you are using a Unix-compliance OS, like Linux or macOS. If not, for example, you are running on Windows instead, then I don't know.
Execute
make all
then you will see a new file algorithm451.out
, an executable file.
Next, run
./algorithm451.out
You will see a prompt that asks you to input a specific choice (in other words, a character) to choose what to run.
==========
[1] HW01 - Stern Brocot Path
[2] HW02 - Sport Day
[3] HW03 - Tiling
[4] HW04 - Bambina
[5] TEST - Hack Test
[6] TEST2 - Pascal Triangle DP
[7] TEST3 - LCS
==========
Homework number:
For example, if you want to run HW01, then input 1
(it is between [
and
]
) and enter. It will then bring you to HW01.
echo "hw_no "$(cat input_sample/filename.txt) | ./algorithm451.out
For example,
echo "2 "$(cat input_sample/hw02_in02.txt) | ./algorithm451.out
In this case, hw_no
is 2.
Run a command in a form of
( cmd | ( cmd | ( diff /dev/fd/3 /dev/fd/4 ) 4<&0 ) 3<&0 )
This command compares outputs from two commands. In our case, for example
( (echo "2 "$(cat input_sample/hw02_in02.txt) | ./algorithm451.out --no-prompt)
| ( cat output_sample/hw02_out02.txt | ( diff /dev/fd/3 /dev/fd/4 ) 4<&0 ) 3<&0 )
The output
If you take a look carefully in the homework files, you will notice that
there are no main funcions (those declared using int main()
). This
is because of the compilation convenience. However, I already made a solution
for such a problem.
Go to the root directory of this project, and run
python make_submission_file.py src/*.cpp