Monorepo containing my implementations to all assignments in the course
"Advanced Topics in Programming" (C++) at Tel Aviv University.
The main project for this semester was to develop a game, incrementally
improving it with each assignment. Each assignment is preserved in its own
branch, while the main branch contains the final version.
- CMake 3.26 or higher
- A C++20 compatible compiler (GCC, Clang, or MSVC)
- Python 3.7 or higher (optional, for the visualization script in Assignments 1 and 2)
cmake -S . -B build
cmake --build buildAfter building, you can run the tanks_game executable in the source directory.
Unit tests are built as the tanks_tests executable, using GTest (included as a
submodule).
This repository also contains a dynamically loaded Simulator used to run comparative and competition modes against shared libraries (algorithms and a game manager). It is self-contained and built with simple Makefiles.
Build all components:
make # builds Simulator, Algorithm, and GameManagerOr build individually:
make -C Algorithm
make -C GameManager
make -C SimulatorRun comparative mode (single map, all game managers in folder, two algorithms):
./Simulator/simulator_01 \
-comparative \
game_map=<game_map_filename> game_managers_folder=<game_managers_folder> \
algorithm1=<algorithm_so_filename> algorithm2=<algorithm_so_filename> \
[num_threads=<num>] [-verbose]Run competition mode (multiple maps, single game manager .so, all algorithms in folder):
./Simulator/simulator_01 \
-competition \
game_maps_folder=<game_maps_folder> game_manager=<game_manager_so_filename> \
algorithms_folder=<algorithms_folder> [num_threads=<num>] [-verbose]The tests are built using CMake, which automatically fetches GTest:
cmake -S tests -B tests/build
cmake --build tests/build -j$(nproc)To run the tests, use:
ctest --test-dir tests/build --output-on-failureThe tests run the simulator in the verbose mode, for debugging purposes. To
easily delete the output files, you can use the included clean_output.sh
script, or use the build_and_test.sh script, which builds the project, the
tests, and runs them.
To run the visualization script, first install the required Python packages:
pip install -r visualizer/requirements.txtThen, run the visualization script:
python visualizer/visualizer.py <log_file_name>Although the assignments have already been submitted, your feedback, bug reports, or improvements are most welcome.
This project is distributed under the MIT License. See the LICENSE file for more information.