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 →

O Christmas Tree

Posted on December 24, 2022 by dgookin
Reply


It’s Christmas time, nerds rejoice! Welcome this festive season with a bit of programming acumen to festoon your old CRT monitor with some yuletide cheer.
Continue reading →

Posted in Lesson | Leave a reply

Tick Separators

Posted on December 17, 2022 by dgookin
Reply

No, a tick separator isn’t something you use on your dog during the summer. Instead, you find it in the upcoming C23 standard. A tick separator helps visually split up a long number, making it easier to read your code.
Continue reading →

Posted in Lesson | Leave a reply

Which C Version?

Posted on December 10, 2022 by dgookin
4

One thing I take for granted is which C standard I’m using. The differences between the versions are subtle, and the compiler chooses its standard by default. But this choice can be altered for compatibility or historical reasons.
Continue reading →

Posted in Lesson | 4 Replies

Quick Sorting Structures – Solution

Posted on December 8, 2022 by dgookin
Reply

The task for this month’s Exercise is to extract a structure member from a void pointer for use in the quick-sort compare() function. This isn’t a solution you can readily find on the Interwebs.
Continue reading →

Posted in Solution | Leave a reply

The Knight’s Tour

Posted on December 3, 2022 by dgookin
Reply

The task is truly complex: Navigating a knight around a chessboard, visiting each square but never the same square twice. It took me a while to code, and I don’t think my solution is particularly elegant, but it works.
Continue reading →

Posted in Lesson | Leave a reply

Quick Sorting Structures

Posted on December 1, 2022 by dgookin
4

Difficulty: ★ ★ ★ ★

I’ve covered the miraculous qsort() function elsewhere in this blog. It’s nifty, allowing you to sort all kinds of data with your only job being to code a compare() function. Most coders these days just copy-paste this function and call it good. But for sorting an array of structures, more brain muscle is required.
Continue reading →

Posted in Exercise | 4 Replies

Setting Up the Knight’s Tour

Posted on November 26, 2022 by dgookin
Reply


I first read about the Knight’s Tour when I was a kid. My mom bought the Time Life series of books on computers. It it, the Knight’s Tour program is presented, which fascinated me. After all this time, I finally set out to code the tour myself.
Continue reading →

Posted in Lesson | Leave a reply

Plotting the Knight’s Next Move

Posted on November 19, 2022 by dgookin
Reply


The next step in hopping a knight around a chessboard is determining which squares from its current position represent valid moves. Code must be combined from last week’s lesson (setting the knight on the chessboard at a random spot) with the movement code presented a few lessons back.
Continue reading →

Posted in Lesson | Leave a reply

Why, There’s the Knight!

Posted on November 12, 2022 by dgookin
Reply


Continuing from last week’s Lesson, the task is now to combine the chessboard output from this month’s Exercise solution with the knight’s random location. This step is the next one leading to the result, which is to plot how a knight moves on a chessboard.
Continue reading →

Posted in Lesson | Leave a reply

Output a Colorful Chessboard – Solution

Posted on November 8, 2022 by dgookin
4

This month’s Exercise may not seem that difficult, especially given the variety of grid challenges and dimensional array lessons I’ve posted on this blog. Obviously, you need a nested loop. The tough part, however, is generating the grid of alternating colors.
Continue reading →

Posted in Solution | 4 Replies

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