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

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