Repo with multiple small projects as I play around with C and learn low-level programming and manual memory management.
NOTICE: These are learning projects for my own benefit, and the code here is not meant to represent any best practices in C or manual memory management. That said, feel free to take a peek and use as inspiration! :)
bean/: Small CLI tool that parses a subset of Beancount plain-text accountingdodge/: Dodge the Blocks game using Raylibscratch/: Scratch project to try out various things that don't warrant their own project
The libs/ directory contains any shared libraries between projects:
libs/base/: Base utilities (arena and pool allocators, length-prefixed strings)
clangclangdclang-formatclang-tidycmaketask
On macOS:
xcode-select --install # libc
brew update
brew install llvm # clang, clangd, lldb, clang-format, clang-tidy
brew install cmake # to generate compile_commands.json for clangd
brew install go-task/tap/go-task # to run tasks in Taskfile.yaml
# use newer version of toolchain:
echo 'export PATH="$(brew --prefix)/opt/llvm/bin:$PATH"' >> ~/.zshrc
# for cmake to use newer version of compiler
echo 'export CC=clang' >> ~/.zshrc
echo 'export CXX=clang++' >> ~/.zshrcRun CMake configuration step (and generate compile_commands.json for clangd):
task configureBuild all projects:
task buildFormat using clang-format:
task formatLint using clang-tidy:
task lintRun tests:
task testFor all available commands see Taskfile.yaml or run task in the terminal.
See STYLE.md for C style conventions used in this repo.
I used AI in "teacher/tutor" mode to give me hints or review my code. It was explicitly instructed not to write code for me or give me answers (that would defeat the point of learning!).
AI was used to generate non-source code files (ex: CMake configuration files, data sample files, etc.), but every single line of C was (painstakingly) written by yours truly :)
Game assets (sound, art) from Kenny.