
The point of extracting data chunks from a grid is to obtain the average of their values. This approach is how I reduce the massive amount of data stored in an image for representation as ASCII text. (See the thumbnail above.)
Continue reading
Extracting Data Chunks

The next step in dividing a grid of data into chunks is to extract each of the chunks. Last week’s Lesson used color to visually identify the data chunks. This week’s update to the code pulls these chunks from the grid, using their values and colors to confirm that everything matches up properly.
Continue reading
C Blog 13th Anniversary

Today marks the 13th anniversary of this blog’s first post. The blog didn’t go live for a few months, specifically to ensure that I would A) keep up the posts (a fault with many blogs) and B) have plenty of material for visitors to peruse. It’s been going strong and consistently since that original post, April 13th, 2013.
Continue reading
Colorful Data Chunks

Continuing from last week’s Lesson, my goal for the grid is to split it into chunks which are then reduced based on the average value of each chunk. To best visualize this, I’d like to keep the byte patterns in the grid consistent and — as a bonus — color-code them.
Continue reading
A Little Bit Off the Sides – Solution
The C language woefully lacks a trim() or similar string manipulation function. Rather than let it flail in absent envy, your task for this month’s Exercise is to code such a function. The goal is to remove whitespace characters from either end of a string.
Continue reading
Working with Data Chunks

I recently embarked upon a programming project where I must reduce large chunks of data into more manageable pieces. The general topic is computer graphics, so a bit of data loss when reducing an image is expected. But before working with the graphical data itself, I decided to run a test on a random chunk of data to confirm whether I was on the right track.
Continue reading
A Little Bit Off the Sides
Difficulty: ★ ★ ★ ☆
As you might already know, the C language lacks plenty o’ functions readily available in other programming languages. Many of these functions, or “methods,” deal with strings. Though C includes a few basic string functions in its library, the C Lords have determined that when you need another such function, you must code it yourself.
Continue reading
From Decimal to Fraction
I was surprised to discover that I hadn’t written about this topic before: converting a decimal value into a fraction. Of course, the solution is really stupid — which I’ll show in a moment. But the goal is to reduce or simplify the stupid way and end up with a fraction instead of a decimal.
Continue reading
Bonus π Day 2026
The next time March 14 drops on a Saturday will be in 2037. Yes, I will be long retired by then. Or perhaps the C language will finally be retired. Who knows? Regardless, here’s another program that uses some obscure mathematical mumbo-jumbo to calculate the value of π.
Continue reading
π Day 2026
It’s been a few years since I’ve had π day here on the C blog. Because I schedule posts for Saturdays, only thrice has a post fallen on π day: In 2015, 2020, and now in 2026.
Continue reading