Forget the graphics. Forget the fancy stuff, which amazingly includes text. At the root of all programming, and the foundations upon which modern computer science is erected, lies the ability to quickly and accurately calculate vast seas of numbers. The traditional title for this activity is Number Crunching.
Continue reading
Category Archives: Lesson
Plotting a Circle
Circles are easy to draw by hand, especially when you have a compass. On a computer, the Circle tool is common in graphics programs, although it’s really the Ellipse tool. And when programming, well, you’ll have to plot your own circle — especially when pulling a stunt like drawing graphics in text mode.
Continue reading
Graphing Curves in Text Mode
When it comes to plotting curves in the C language, you need to dust off your trigonometry. It’s not a scary thing: The C library offers a host of mathematical functions, many of which can help you plot a curve here or there. In fact, writing a function to draw a curve is a lot easier than plotting a straight line.
Continue reading
Graphing in Text Mode, Part III: Better Lines
After you create a point-plotting function, the next obvious graphical function to code is the line. Whether you’re graphing in text mode or using pixels, you’ll quickly find that two conditions exist where a line function just can’t draw a line.
Continue reading
Graphing in Text Mode, Part II: Lines
So far in my text mode graphics demonstration, I’ve shown you code that presents a graphical grid, plus the plot() function that “draws” pixels in the grid. These are the basic building blocks you need to do graphics in text mode. The next step is to craft functions that create basic geometric shapes. The most basic of those is the line.
Continue reading
Graphing in Text Mode, Part I
In text mode graphics, a char buffer serves as the drawing board, allowing you to plot x and y coordinates. Before any plotting takes place, however, you need a proper canvas.
Continue reading
The Big (Text Mode) Graphical Grid
To output graphics, you need a palette. That is, you need a buffer that’s so many pixels wide and rows high. Create the buffer, draw in the buffer, output the buffer. That’s how graphics works, both in graphics as well as text mode.
Continue reading
Text Mode Graphics
Graphics programming is entirely possible in the C language.
Continue reading
The Joy of Clang
If it were spelled Klang, then it might be a reference some Klingon character from Star Trek, but it’s not. Clang is one of those program names that’s a contraction. In this instance, it’s a portmanteau of C Language. It’s an über nifty command line compiler.
Continue reading
Word Wrap Filter Repair
As a programmer, always be thinking: What can go wrong? What would be an exception? Where have I made assumptions? You can’t avoid bugs by making such challenges, but you can diminish their possibilities.
Continue reading