Make a triforce in a console in clang
Report Bug
·
Request Feature
Table of Contents
This is a small personal project designed to train me to develop in C.
I started by making a triangle in console, then the same thing but using a matrix (and therefore pointers). And now I've just got to do the triforce!
- Install Homebrew :
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install GCC :
brew install gcc
- Install Xcode from l'App Store.
- Install command line tools :
xcode-select --install
- Download MinGW from mingw.org.
- Follow installation instruction.
- Add
C:\MinGW\bin
to the environment variablePATH
.
- Download MSYS2 from msys2.org.
- Follow installation instruction.
- Open the console MSYS2 and install GCC :
pacman -Syu
pacman -S mingw-w64-x86_64-gcc
- Add
C:\msys64\mingw64\bin
to the environment variablePATH
.
- Open Terminal and install development tools :
sudo apt update
sudo apt install build-essential
- Open Terminal and install development tools :
sudo dnf groupinstall "Development Tools"
- Open Terminal and install development tools :
sudo pacman -S base-devel
To execute a c file, you must first compile it, then execute it.
There are 3 files you can run: triangle.c, matrice.c and triforce.c
To compile a file, run the following command in the project directory :
gcc -o output_name source_file.c
Replace output_name
with the desired name for the executable and source_file.c
with the name of your source file.
To run the compiled program, use the following command:
./output_name triangle-width
Replace output_name
with the name of the executable generated during compilation and triangle-width
with the desired triangle size. For the triforce, this is the width of the entire triforce.