Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Environment Setup and Dummy Exercise

There is no exercise for the programming paradigm part of the unit. However, this week you should follow the instructions below to set up a proper development environment to complete the formative programming exercises. You should also complete a dummy exercise to make sure you understand the usage of check50, the automarking tool used to validate your submissions for these exercises.

Environemnt Setup

Basic Environment Setup

You first need a Linux x86-64 (Intel/AMD CPU) environment, to that aim please follow these instructions.

Installing check50

Once your basic environment is up and running, you need to install check50. In a terminal:

pip3 install check50
echo "export PATH=$PATH:$HOME/.local/bin" >> ~/.bashrc
source ~/.bashrc

If the command fails with error: externally-managed-environment, try pip3 install --break-system-packages check50. If the command fails with pip3: command not found, you can install pip3 on a computer where you have admin access as follows:

sudo apt update
sudo apt install python3-pip git

You should now be able to run check50 from a terminal. Simply invoking it as follows should print a few guidelines about its usage:

check50

If you get a check50: command not found error, try adding pip3’s executable folder to your path. For the bash shell:

echo "export PATH=$PATH:$HOME/.local/bin" >> ~/.bashrc
source ~/.bashrc

For other shells (e.g. zsh), you’ll probably need to adapt this code.

Dummy Exercise

This is a dummy exercise asking you to create an empty C program. To succeed in this exercise, simply write the following program:

int main() {
    return 0;
}

To check the correctness of your program, use a suitable development environment with check50 installed and write your solution in a file named sample-exercise.c. In a terminal, with that file in the local directory, check with this command:

check50 -l --ansi-log olivierpierre/comp26020-problems/main/week1-intro/01-sample-exercise

If you are on a very recent (as of 2026) Ubuntu/Fedora distribution you may see the following error:

:| exists
    check50 ran into an error while running checks!
    TypeError: unsupported operand type(s) for /: 'NoneType' and 'str'
      File "/home/pierre/.local/lib/python3.14/site-packages/check50/runner.py", line 138, in wrapper
    internal.run_dir = run_root_dir / check.__name__
                       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~

This is a know check50 bug, if you encouter it, patch it by running the following command:

$ sed -i 's/if multiprocessing.get_start_method() != "spawn":/if multiprocessing.get_start_method() == "fork":/' ~/.local/lib/python3.14/site-packages/check50/runner.py

You may need to replace the last argument with proper the path to runner.py indicated by the error, and possibly to prefix that command with sudo if check50 is installed system-wide.

Submission: once your work is ready please submit it here.