Skip to content

airone01/ft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

242 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ft

Last commit License Stars Issues Repo Size
Bazel workflow status Norminette workflow status

ft is a monorepo of all my projects related to 42. It's mainly meant for personal archiving, but I also share some cool stuff.


Foreword

This is a monorepo, meaning these projects are tightly coupled and share dependencies to work properly.

Why Bazel instead of Make? The 42 curriculum relies heavily on GNU Make to teach students the fundamentals of compilation. However, maintaining 30+ nearly identical Makefiles in a monorepo quickly becomes tedious. Because I enjoy DevOps and reproducibility, I migrated this repository to Bazel. I now only generate a standard Makefile and clean the repo right before pushing a project for grading.

Caution

A natural side effect of this Bazel setup is that it makes it harder to blindly copy-paste my projects and submit them as your own. While deterring cheating wasn't my primary technical goal, I fully support the result. Copying defeats the core principles of 42 and goes against what I personally believe in. This repository is meant to serve as an example of what you can build at this school, not as a shortcut. It's called a school for a reason. Learn; Write your own tests; and "By Odin! By Thor! Use your brain!".

Projects

Projects statuses
Milestone Project Finished Grade
0 libft logo
(with bonuses)
125
1 born2beroot logo
(with bonuses)
125
ft_printf logo 100
get_next_line logo 100
2 pipex logo
(with bonuses)
125
push_swap logo 100
fdf logo
(with bonuses)
125
3 minishell logo
with @maximart
101
philosophers logo 100
4 cub3d logo
with @maximart

(with bonuses)
125
CPP logo
CPP 00-04
(various grades)
NetPractice logo
100
5 ft_irc logo
with @maximart & @nahamida
125
inception logo
90
CPP logo
CPP 05-09
(various grades)
6 ft_transcendence logo
with @vblanc, @enpassel & @scottene
125

Notable projects

fdf
cub3d (and its 3DS port)

Extra tools/projects

During a boring weekend, I set up a Bazel target to cross-compile a 3DS homebrew app. If you have a modded 3DS on hand, you can compile it and try yourself. It's very limited, laggy, and crashes on quit though. You have been warned.

A program to flex on your friends by visualizing your push_swap algorithm in Minecraft. It uses Valence to control the game packets and visualize the sorting algorithm on your 1.20.1 client.

In-game screenshot Minecraft push_swap visualizer in-game screenshot

A simple script to convert a BMP image into a fdf file. It currently only works for bitmap images smaller than 255 * 255, because I don't really know how to reliably get the width of the image in the header.

You can convert PNG images to BMP using convert using ImageMagick, or online with EzGIF.

Additional notes

Bazel

Note

Did you read the foreword?

You can build all of the projects in this monorepo using Bazel.

  • Run bazel query ... to list all projects.
  • Run bazel build //milestone-2/fdf:fdf to make fdf (or bazel build fdf, there are aliases).
  • Most importantly, run bazel build //... to make all projects at once (as well as the required external libs).

As per Bazel fashion, building the entirety of the repo at once is pretty fast.

LSPs and compile_commands.json

If you use an IDE or LSP server and the constant clangd type errors appearing when browsing this repo hurt your eyes, I might have a solution for you. The compile_commands.json file! It instructs your LSP server on where to locate the headers, and in which order, and how your compiling system (Bazel in this case) manages your compilation.

To compile this file for the whole project using Bazel:

bazel run //:refresh_compile_commands

Note

The compile_commands.json is gitignore'd for your inconvenience :-)

nix-direnv

This project's dev dependencies are managed using nix-direnv. There is a central flake.nix file whose main purpose is exposing devShells.

I might eventually package the projects of this repo into this flake when I find the time.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Monorepo of all my projects related to 42

Topics

Resources

License

Stars

Watchers

Forks

Contributors