The C library is teaming with string-searching functions. The most basic is strstr(), which I discussed in last week’s Lesson. That function has some brothers and sisters.
Continue reading
Author Archives: dgookin
Finding Text with strstr()
The programming universe is teaming with search algorithms. In fact, searching for stuff has become so commonplace computer users casually take it for granted. Things weren’t always that way, but the programming algorithms behind the search remains the same.
Continue reading
Number Crunching
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
Show Me a Bar Chart
Computers are notorious for spewing out rows and columns of meaningless numbers. Sure, they have significance, but often your audience is more energized when they view something other than a dull table filled with values.
Continue reading
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
A Million Ways to Code in the West
Actually, it doesn’t matter west, east, north, or south, as multiple solutions exist for any programming puzzle.
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