Skip to primary content
Skip to secondary content

C For Dummies Blog

Main menu

  • C For Dummies (home)
  • History
  • Series
  • Supplemental
  • Blog Miscellany

Author Archives: dgookin

Post navigation

← Older posts
Newer posts →

Clear the Screen – Solution

Posted on July 8, 2024 by dgookin
4

The task for this month’s Exercise is to clear the screen. I pray you didn’t arrive at a solution that outputs multiple blank lines. No, you must use the ANSI codes offered in the exercise post to manipulate the cursor and wipe clean the screen. Or you could cheat, which is what I did.
Continue reading →

Posted in Solution | 4 Replies

Erasing Text for Stream Output

Posted on July 6, 2024 by dgookin
Reply

One of my first programming obsessions was online communications. I wrote several modem programs for the TRS-80 (in Z80 Assembly) and then moved to the IBM PC/MS-DOS where I coded communications programs in both Assembly and C. I learned a few things.
Continue reading →

Posted in Lesson | Leave a reply

Clear the Screen

Posted on July 1, 2024 by dgookin
3

Difficulty: ★ ☆ ☆ ☆

If you’ve studied the terminal window at any length, you probably know about the clear command, which clears the screen. Under MS-DOS, and on my old TRS-80, the command is cls. Same thing.
Continue reading →

Posted in Exercise | 3 Replies

A Grid of Random Stars, Part VII

Posted on June 29, 2024 by dgookin
Reply

The final (and merciful) update to my Grid of Random Stars program involves two major changes. First, because I call the update_grid() function only once, it can be incorporated into the main() function, no program. Second, I remove pointer notation.
Continue reading →

Posted in Lesson | Leave a reply

A Grid of Random Stars, Part VI

Posted on June 22, 2024 by dgookin
Reply

The program may output what I want, but the code isn’t done yet. Continuing from last week’s Lesson, I’d like the program to output a single grid showing a summary of all the rectangles found. This update requires more changes to the existing code.
Continue reading →

Posted in Lesson | Leave a reply

A Grid of Random Stars, Part V

Posted on June 15, 2024 by dgookin
Reply

The two problems I recognized in the code from last week’s Lesson were that scan_column() and find_right() don’t need to be separate functions. Also, the code fails to find all the rectangles in the grid, which is bad. Time to fix the code!
Continue reading →

Posted in Lesson | Leave a reply

A Grid of Random Stars, Part IV

Posted on June 8, 2024 by dgookin
Reply

I was so excited with last week’s code that I didn’t bother to confirm that it worked properly. No, I was eager to see graphic output of the found rectangles.
Continue reading →

Posted in Lesson | Leave a reply

Adding Two Values – Solutions

Posted on June 8, 2024 by dgookin
Reply

This month’s Exercise is rather simple, though it doesn’t promise a simple solution. Instead, I offer three solutions. One of which is obvious and two are kind of out there. They all work, which is the point.
Continue reading →

Posted in Solution | Leave a reply

Adding Two Values

Posted on June 1, 2024 by dgookin
Reply

Difficulty: ★ ☆ ☆ ☆

Adding values is a basic programming concept: 4 + 5 = 9 But where do the values come from? They can be literals, variables, expressions, or values collected from the user.
Continue reading →

Posted in Exercise | Leave a reply

A Grid of Random Stars, Part III

Posted on June 1, 2024 by dgookin
Reply

The next update to my pattern-finding program is to hunt down and find a clutch of asterisks in the grid that form a rectangle. Figure 1 illustrates what I’m after.
Continue reading →

Posted in Lesson | Leave a reply

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Dumping the Screen in W-I-D-E Color
  • Which is Greatest? – Solution
  • Dumping the Screen in Color
  • Which is Greatest?
  • Consistently Constant

Recent Comments

  • dgookin on Dumping the Screen in W-I-D-E Color
  • M.Stumpfl on Dumping the Screen in Color
  • Chris Webb on Dumping the Screen in W-I-D-E Color
  • Chris Webb on Dumping the Screen in Color
  • M.Stumpfl on Dumping the Screen in Color

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Copyright © 1997-2025 by QPBC.
All rights reserved

Proudly powered by WordPress