Skip to content

Compute & print the Collatz conjecture.

License

Notifications You must be signed in to change notification settings

aminnairi/collatz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

collatz

Compilation CI

Command line interface to compute & print the Collatz conjecture.

Animated image showing an example usage of the program

📖 Requirements

✨ Initialization

$ git clone https://github.com/aminnairi/collatz.git
$ cd collatz

🔨 Compilation

$ make          # for the lazy ones
$ make compile  # alternative

⬇️ Installation

$ make install

Note: this will copy the program to the /usr/local/bin folder as well as copying the man page to the /usr/local/man/man1 folder, requiring superuser access.

🏃 Run

$ collatz 15
15 46 23 70 35 106 53 160 80 40 20 10 5 16 8 4 2 1
$ collatz 5
5 16 8 4 2 1

collatz only accepts one integer number greater or equal to one.

🤔 Help

$ man collatz

🔥 Uninstallation

$ make uninstall

Note: this will remove the copy of the program from the /usr/local/bin folder as well as removing the man page from the /usr/local/man/man1 folder, requiring superuser access.

♻️ Clean

$ make clean

This will remove the objects folder.

🗑️ Hard clean

$ make mrproper

This will remove the objects & binaries folder.

❓ FAQ

How can I change the compiler?

$ vim makefile
COMPILER=gcc

How can I change the compiler's options?

$ vim makefile
COMPILER_FLAGS=-Wall -Wextra -Wpedantic -O3 -std=c18

How can I change the linker?

$ vim makefile
LINKER=gcc

How can I change the linker's flags?

$ vim makefile
LINKER_FLAGS=