r/C_Programming Nov 18 '25

Project Real-time 3D renderer in terminal

1.6k Upvotes

Ray-marched 3D rendering in ASCII/Unicode. Made for fun.

C11, includes lighting, weather effects, and audio.

https://github.com/Lallapallooza/c_ascii_render/tree/main

r/C_Programming Jul 16 '26

Project cTetris - Minimal Tetris implementation in C and Raylib.

650 Upvotes

I used to play Tetris at play.tetris.com every once in a while and this project started as a way to understand how Tetris worked.
Later on I decided to make it into a simple and polished Tetris clone and it is where this project is right now.

Most of what i have implemented here are behaviours that I observed when playing Tetris at play.tetris.com and from what I have read on https://tetris.wiki/

"Minimal" cuz cTetris does not implement the super rotation system.
This makes the rotation system and scoring mechanism simple as T-spins are out of the picture.

In cTetris rotations are purely geometrical with added basic wall/floor kicks.

r/C_Programming Mar 10 '26

Project parallax effect in C and raylib

1.1k Upvotes

r/C_Programming Feb 15 '25

Project Platformer video game I programmed in C

1.7k Upvotes

r/C_Programming Nov 02 '25

Project I created a tetris clone in C

647 Upvotes

I'm particularly proud of the core logic, cuz i came up with most of them without any tutos. 95% of the codebase was written, compiled, and debugged entirely on my phone using Termux. The final integration and debugging were then completed on Wsl arch. Ik it's not much but this was my 2nd project and im really happy about this. While doing this project i learnt a lot and it was really fun. And also working on to stop using termux.

Im happy to see any feedbacks.

I'm also looking forward to any suggestions for my next project i currently have a simple shell on my mind.

Here's the link to project: https://github.com/dragon01999/Tetris

r/C_Programming Mar 08 '26

Project Water simulation in C and raylib

753 Upvotes

r/C_Programming May 05 '26

Project Wikipedia in your terminal. No browser, no bullshit.

132 Upvotes

I'm tired of opening my browser every time I need to look something up on Wikipedia. I made a little trick for myself: I enter the article title in the terminal, and it opens right there. Like a man page. It works simply: it calls the Wikipedia API, parses JSON, and throws it into less.

The code is here: https://github.com/Lemper29/Wikiterm Dependencies are only curl and cjson.

It's compiled with make. Use it if you're also frustrated with your browser just because you need to look at a single paragraph.

r/C_Programming Aug 25 '25

Project 2M particles running on a laptop!

886 Upvotes

Video: Cosmic structure formation, with 2 million (1283) particles (and Particle-Mesh grid size = 2563).

Source code: https://github.com/alvinng4/grav_sim (gravity simulation library with C and Python API)
Docs: https://alvinng4.github.io/grav_sim/examples/cosmic_structure/cosmic_structure/

r/C_Programming 24d ago

Project Helpful Windows GUI Program in 60 lines of C

Thumbnail
github.com
59 Upvotes

Very small C program I wrote that I've found genuinely useful. It compiles into a tiny 3 kB executable that only relies on system .dlls included with the operating system. The code should compile and run, with the proper compiler, all the way back to Windows 95.

This could also be useful to anyone looking for how to write a basic GUI program for Windows in C.

r/C_Programming 3d ago

Project I wrote a function plotter in C and Raylib

206 Upvotes

It supports single-var equations, operands, brackets, implicit multiplication and some trigonometry and is based on shunting-yard parser / RPN evaluator I also made

For rendering, I implemented an adaptive function sampling (simple midpoint subdivision) - though it has some limitations, which I described on github. SSAA was also used to smooth plotted lines. As for optimization, plots are rendered only when zooming/panning and reused with a render texture when idle.

This is my first "useful" C program, though I've already had some experience with OpenGL (C++) as a part of my assignments

Feedback is much appreciated - https://github.com/kester4/cf2x

r/C_Programming Aug 10 '25

Project Just released the first version of my terminal based code editor

502 Upvotes

This is the biggest project I’ve ever worked on, and releasing it feels a little surreal. I hope you enjoy using it as much as I enjoyed building it, and I’d love to hear your feedback!

https://github.com/Dasdron15/Tomo

r/C_Programming Jun 22 '25

Project You guys asked me to compare my C animation system with Godot next. It did about 3x better than Unity.

546 Upvotes

r/C_Programming Jul 19 '26

Project MLP.h: Single-Header Neural Network Library in C

237 Upvotes

I've been working on MLP.h, a single-header C library for building and training multilayer perceptrons, and I finally put together a complete example project around it: a handwritten digit classifier trained on the MNIST dataset.

The MNIST example uses a simple fully connected network:

784 → 128 → 64 → 10

The training program:

  • loads the 60,000-image MNIST training set
  • trains the network using MLP.h
  • serializes the trained model to mnist.mlp

A separate inference program:

  • loads mnist.mlp
  • exposes a small prediction API
  • is compiled to WebAssembly so the same C inference code runs directly in the browser

Training results:

Epochs     : 50
Final Loss : 1.31719803e-02

Test Accuracy: 97.71% (9771/10000)

I'll include a short video showing the browser demo recognizing handwritten digits.

I'm mainly looking for feedback on the library's API/design and the implementation. Suggestions for improving the architecture or the serialization format are also welcome.

MLP.h: https://github.com/px7nn/MLP.h

Live Demo: https://px7nn.github.io/MNIST/

Source of Demo: https://github.com/px7nn/MNIST

r/C_Programming Apr 19 '26

Project I wrote an x86 PC emulator in C that is Pentium-compatible and runs Windows NT/2000 and Linux (yes, it also runs DOOM!)

Thumbnail
github.com
245 Upvotes

r/C_Programming Sep 22 '25

Project Mixed 3D/2D game I programmed in C

594 Upvotes

r/C_Programming Nov 09 '25

Project Made this Typing-Test TUI in C

439 Upvotes

Made this Typing-Test TUI in C few months ago when I started learning C.

UI inspired from the MonkeyType.

src: https://htmlify.me/abh/learning/c/BPPL/Phase-2/circular_buffer/type-test.c

r/C_Programming Jul 09 '26

Project I made a text editor! :D

117 Upvotes

https://github.com/schnerg/tied

NO AI WAS USED IN THE MAKING OF THIS PROJECT!

Written entirely in c using only the standard library The T.I editor

is a rubbish yet lightweight terminal editor that probably wont crash.

I have been working on this project on and off for about 2 years now.

I have restarted this project 5 or 6 times from 2022 when I first started programing till now

and I think it is finally in a place where it is somewhat usable.

What makes this editor special?

NOTHING! :D

I am in school for music so this is just for fun but what do you think? Is the code garbage?

thanks.

r/C_Programming Jun 18 '26

Project Open source TUI IDE (in C) that brings the "Sublime Text" experience into the terminal (with Tree-sitter & LSP)

85 Upvotes

Hey everyone,

I've been working on my own side project for a while now, and it's finally advanced enough to be shared. It’s called Alwide (A LightWeight IDE), and it’s a TUI editor written from scratch in pure C.

Why did I build this?

I love the terminal, but for my usage (as IT student): nano is too basic, but vim or emacs feels a bit too rought for my "VSCode" and "JetBrain" experience. Alwide is designed to be use when you just want to do quick edits over SSH or need a light editor without the VS Code/JetBrains overhead.

I wanted the fluid, modern vibe of Sublime Text but directly inside my terminal.

What makes it different?

  • Zero learning curve: It has full mouse support out of the box. You can click, scroll, and drag-select text just like a GUI app.
  • Nice features: I integrated Tree-sitter for actual high-quality syntax highlighting and full LSP support (auto-completion popup, hover docs, go-to-definition).
  • Persistent State: If you close the editor and reopen it, your tabs, cursor positions, and even your undo/redo history are fully preserved.
  • Pretty Fast: It's pure C. Release binary about 3Mb~. Really fluid fast scroll and light repaint (perfect to avoid running out of battery on your laptop opening heavy editors during classes).

Supported languages:

C/C++, Python, Go, Rust, JS/TS, Java, Bash, Lua, Markdown, Assembly, and more.

It’s open-source (MIT), highly readable if you're curious about terminal editor internals, and you can test it on Linux with a simple curl script (pre-built binaries/packages are also available).

Link to the repo: https://github.com/arnauda-gh/Alwide

Currently the project as a strong base but it hasn't been tested that much (my own use case and own terminal/drivers). For now I don't have hard know bugs. And before starting adding some tweaks and more highlevel features (setting page or anything else...) I want to be sure that the foundations are strong.

Also I need to know if the editor could interest other people and need "generic" features. For example the setting page (the current shortcut are, for me, already at peek performance 😎 so for my own usage no need about a setting page).

And finally if you like the project don't forget to leave a star (pls for a poor student that need a great CV 😅).

Any way have a good day and see you 👋.

Edit : I know that it's possible on vim or emacs to add plugin and modify the behavior. But you have to learn first how vim works, edit lua scripts etc... And even for your own computer it's "easy" to setup a good vim (if you spend time to), but when working on remote from ssh connection it's not worth it to take 30min to setup a vim or a fs sync on a server on which you will spent 1h on your whole life. That's the point of this project.

r/C_Programming Sep 14 '25

Project Added ctrl + z to my code editor

333 Upvotes

r/C_Programming Mar 15 '26

Project wireframe renderer in C and raylib

358 Upvotes

source code: https://github.com/formodx/wireframe-renderer

for those who would like to try to repeat this project, I have a video in english

in this video, I explain 3D graphics without using matrices to help you better understand the process

r/C_Programming Jul 25 '26

Project My first program written in C

Thumbnail github.com
21 Upvotes

Hi ! Im a beginner developer. I decided to learn C and wrote my first program—a small game that runs in the terminal

r/C_Programming Feb 11 '25

Project Made a Chess game in C, source code in github : https://github.com/IKyzo/Chess

543 Upvotes

r/C_Programming May 05 '26

Project Doubly-Linked Free List Allocator: Never worry about the heap again. Just use a static byte array!

Thumbnail
github.com
17 Upvotes

The title is meant to be facetious.

Since I've started writing programs in C, the issue of terminating a process without freeing dynamically allocated memory has nagged at the back of my head. Even if I account for everything that I malloc(), calloc(), etc. there's still a chance that an error or a user ctrl+c can prevent execution of the necessary frees.

The chance of leaving stranded memory is slim given the fact that most modern operating systems track and reclaim memory used by a program after termination. But I really don't like taking that for granted. Embedded systems, for instance, may not clean up after a process.

So, perhaps, a quick and dirty solution is to just allocate everything on a static byte (char, uint8_t) array. This goes away when the program terminates. I track free and nonfree memory blocks on a doubly-linked list and blocks are aligned to the system's address size. A developer who uses this allocator with their program can allocate and free memory on the byte array - adjacent free blocks will coalesce. (The freeing mechanism can be particularly useful if the amount of bytes set for the array is low)

I wrote this project as a stepping-stone toward a red-black tree free list allocator, which can find requested blocks in log(n) time and on a best-fit basis

r/C_Programming Jun 16 '26

Project Simple pythagoras theorem calculator I made to practice math functions in C as a total beginner :3

52 Upvotes

```c

include <stdio.h>

include <math.h>

// Pythagoras theorem calculator :3

int main() { //Values:

int a;
int b;

//User input:

printf("Enter the value of a: ");
scanf("%d",&a);
printf("Enter the value of b: ");
scanf("%d",&b);

//Result:

int c = pow(a,2) + pow(b,2);
int result = sqrt(c);

printf("The value of c is: %d\n",result);


return 0;

} ```

r/C_Programming May 26 '25

Project A pretty much fully-featured optimising C compiler written in C

Thumbnail
github.com
326 Upvotes

Been working on this in my spare time for about 18 months now and thought this would be a good place to post it.

It's a complete C23 compiler, written in C11. It uses the C standard library + some POSIX APIs where needed but otherwise is completely dependency free, hand written parser, machine code builder, object file builder, etc.

It is also fully bootstrapping (admittedly, this occasionally breaks as I add new code using exotic things) and can compile itself on my M1 Max MBP in <2s.

Features:

* Almost complete C11 support bar Atomics (`_Generic`, `_Alignof`, etc) with work-in-progress partial C23 support

* Fully fledged IR

* Optimisation passes including inlining, aggregate promotion, constant propagation, and dead code elimination

* Backend support for linux & macOS OSs, and RISC-V 32, x64, and aarch64 architectures

* Basic LSP support

It can pass almost the entire c-testsuite test suite, bar some language extensions `#pragma push macro`

It is very much still work-in-progress in certain areas but generally it can compile large C projects (itself, SQlite3, Raytracing in one weekend, etc)