/triforce-c

Make a triforce in console in clang

Primary LanguageC

Contributors Forks Stargazers Issues MIT License


triforce-c

Make a triforce in a console in clang

Report Bug · Request Feature


Table of Contents
  1. About The Project
  2. Prerequisites
  3. Usage

About The Project

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!

(back to top)

Prerequisites

macOS

Avec Homebrew

  1. Install Homebrew :
    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Install GCC :
    brew install gcc

Avec Xcode

  1. Install Xcode from l'App Store.
  2. Install command line tools :
xcode-select --install

Windows

Avec MinGW

  1. Download MinGW from mingw.org.
  2. Follow installation instruction.
  3. Add C:\MinGW\bin to the environment variable PATH.

Avec MSYS2

  1. Download MSYS2 from msys2.org.
  2. Follow installation instruction.
  3. Open the console MSYS2 and install GCC :
pacman -Syu
pacman -S mingw-w64-x86_64-gcc
  1. Add C:\msys64\mingw64\bin to the environment variable PATH.

Linux

Debian/Ubuntu

  1. Open Terminal and install development tools :
sudo apt update
sudo apt install build-essential

Fedora

  1. Open Terminal and install development tools :
sudo dnf groupinstall "Development Tools"

Arch Linux

  1. Open Terminal and install development tools :
sudo pacman -S base-devel

Usage

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

Compilation

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.

Exécution

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.

(back to top)