r/C_Programming • u/MrKrot1999 • Jul 16 '26
Project Numerical wave equation "solver" with TUI ncurses frontend
It took me about 3-4 days to write this program. I wrote it mainly to learn derivatives, and because it's quite fun to look at it. And I wrote it completely using my android phone + termux (using emacs, my beloved).
To change wave's initial parameters you need to modify the source code and recompile the program.
Controls are:
- h/j/k/l: Controlling scope's range
- arrows: Moving the scope around.
- x: Turn off/on the fast mode (which lets you move around quicker) (**it's turned on by default**, so be ware)
- n: recenter + reset scope's range.
- a: turn on/off anti-aliasing.
- space: pause/resume the simulation (it's paused by default).
- +/-/=: control simulation's speed.
Sorry, no github, the source code's on pastebin. I'll be extracting the scope functionality into a lightweight library, and then I'll turn it into a proper project. Until then:
To compile run:
```
cc -lncurses -lm -O2 main.c -o main
```
You may need to use pkg-config for ncurses.
Let me know if you have any issues!
4
u/MrKrot1999 Jul 16 '26
0 AI was used in development.
4
u/TheOtherBorgCube Jul 16 '26
Missing a couple of headers.
Other than that, looks good.