The task for this month’s C programming Exercise is to code a filter that reverses single words. As a filter, the code deals with standard input and output, but it must store this input in word-sized chunks for the reversing process to work.
Continue reading
The Trouble with Array Decay
Array decay has nothing to do with too much sugar in your code or poor brushing habits. No, it’s a hot topic in C programming, and a source of confusion.
Continue reading
The Reversing Words Filter
Difficulty: ★ ★ ★ ☆
A few months back, this blog’s monthly Exercise was to write a filter to reverse all text input. No matter how much text floated in, the filter gobbled it all up and spewed it back in reverse order. This month’s challenge is similar, but on a smaller scale.
Continue reading
The Story of the Undefined Reference Error
Let me be blunt: If you haven’t yet seen an undefined reference error, you truly aren’t a C programmer. In fact, the more of these messages you see, the longer you’ve been coding in C. Undefined reference errors are a badge of honor.
Continue reading
Things That Bounce (Even More exp() Function Stuff)
It’s time to free yourself from the math-nerd aspect of the exp() function and put it to legitimate use by animating an asterisk bouncing across the screen. Such a feat may be considered unusual for a stream-oriented programming language like C, but I find animation more interesting than math.
Continue reading
Things That Fall (More exp() Function Stuff)
Text mode graphics were a Big Deal with computers for the longest time. C’s stream I/O didn’t stop various computer games from being developed throughout the 1970s and 1980s. And this limitation isn’t going to stop me from animating a falling ball, er, asterisk.
Continue reading
Fun with the exp() Function
Deep in the crevasse of oddball math functions is one that raises Euler’s number (e) to a given power. This calculation is vital enough in programming that it sports its own function, exp(). And I would ignore this function with exuberant glee were it not for a trick someone showed me a long time ago.
Continue reading
Your Name in Base 36 – Solution
My solution for this month’s Exercise didn’t require much work. What I did was to “stack overflow” the problem by pulling in functions from earlier Lessons. The only new portion of code deals with processing the input before sending the string off to the b36_decimal() function I’ve already written.
Continue reading
My “Dear Lord This Is So Boring” Dice-Rolling Game
Rolling seven dice over and over is how I passed time “playing” D&D. But I also played a game with the dice, one that I introduced in last week’s Lesson. That lesson’s code got things started. This Lesson finishes the project.
Continue reading
Your Name in Base 36
Difficulty: ★ ★ ☆ ☆
Last month, I completed my series on Base 36, which uses digits 0 through 9 and A through Z to represent values. The use of these digits means that common words can represent values in base 36. In fact, your name is a base 36 value. But what is it?
Continue reading