Skip to content

Instantly share code, notes, and snippets.

View seamicole's full-sized avatar

Sean O'Leary seamicole

  • Singapore
View GitHub Profile
@seamicole
seamicole / 42-compile-run-c.md
Last active July 28, 2023 03:59
A handy tool to compile, run, and test C files locally.

The C Compile-Run-Delete Tedium

Now that we are into C proper of our journey here at 42, we will be writing, testing, and reviewing C coding assignments. We want this process to be as fast and efficient as possible which is why it is in our interest to automate whatever we can.

Some assignments we write are not expected to include a main function upon submission, even though it is impossible to compile and test C code locally without one. For those of us who use Vim, we can make this process a little less painful than the current process. Many of us have found ourselves needing to carry out the following mindless steps:

  • Uncomment an existing test main function (or create a new one)
  • Switch terminals or exit out of Vim so that you have the command line accessible
  • Run cc -Wall -Wextra -Werror <filename> (which outputs an a.out file by default)
  • Run the default a.out file ./a.out so that you can check the output
@seamicole
seamicole / 42-sg-rush00-cheat-sheet.md
Last active March 9, 2024 20:46
42 SG Rush00 Cheat Sheet

42 SG Rush00 Cheat Sheet

In a Nutshell

Each function defined for rush handles a separate concern:

rush         : Handles the creation of rows and columns
ft_assignchar: Handles the selection of characters for each row
ft_putchar : Handles the selection of characters for each column within a row.