The Sierpinski Triangle

Do you remember when you first learned about recursion? The thought triggered a memory from an old CS101 Java course. The textbook had some fractal triangle thing made with only 20 lines of code. At the time, it was a confusing 20 lines of code. A quick search on Google for “fractal triangle recursion” led straight to the Sierpinski triangle1. A Sierpinski triangle generator with an ncurses visualization is a fun afternoon project....

February 7, 2024 · 6 min · Ivan Eduardo Guerra

The Game of Life

If you grind old Advent of Code1 problems, you might notice a particular style of problem crop up more than once. The people of Reddit refer to their solutions as a variation of Conway’s Game of Life2 (GoL). Wikipedia has a great article on GoL. The animations are eye catching. The Wiki serves as motivation for a terminal app that visualizes GoL simulations. Rules of the Game What are the GoL rules?...

December 1, 2023 · 5 min · Ivan Eduardo Guerra

ncube: A Cube in Your Terminal

You ever come across one of those ASMR programming videos? This video1 where the developer programs a terminal display with a couple of spinning cubes is neat. This video is the motivation for the development of a ncurses2 application that renders a user controlled 3D cube. Perspective Projection and Rotation Matrices So how do you take an object in 3D space and visualize it in 2D space? The answer is perspective projection....

November 16, 2023 · 7 min · Ivan Eduardo Guerra

Binary Rain

Most programmers young and old have seen the cyberpunk sci-fi film The Matrix1. One of the most outstanding parts of the movie is the closing scene where Neo sees the Matrix when battling the Agents: The visual effect with the code running along all the surfaces is iconic. Seems other people thought so too to the point that the effect has a name: Matrix Digital Rain2. Wouldn’t it be neat to create a terminal screensaver that mimicked the effect seen in the movie?...

July 23, 2023 · 6 min · Ivan Eduardo Guerra

Snake in the Terminal

Are you a text user interface enjoyer? Have you always wondered how difficult is it to write an ncurses UI? What better way to find out than to write a program of your own that explores ncurses’ API. Of course, you have to keep it interesting. Why not implement a scaled down version of a retro arcade game: snake. The Rules of Snake Step one of this project is to look up what the rules for a game of snake are....

June 17, 2023 · 14 min · Ivan Eduardo Guerra