Skip to primary content
Skip to secondary content

C For Dummies Blog

Main menu

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

Post navigation

← Older posts
Newer posts →

Suppressing a Terminal’s Character Echo

Posted on February 29, 2020 by dgookin
Reply

Back in the bad old days, you used a terminal connected to a mainframe to do your computer work. The terminal had a monitor and keyboard and just enough smarts to configure itself for communications with the mainframe. One of those configuration options was character echo.
Continue reading →

Posted in Lesson | Leave a reply

Input Minus the Echo

Posted on February 22, 2020 by dgookin
Reply

The prompt appears in the terminal window: Type your password. As you type the password, text doesn’t appear on the screen. Yes, the program is using stream I/O. So how do you code standard input that doesn’t output characters?
Continue reading →

Posted in Lesson | Tagged get pass, get password, input without echo, local echo | Leave a reply

Yet Another Oddball: Token Paste

Posted on February 15, 2020 by dgookin
Reply

I’m constantly on the prowl for obscure and seldom-used C language functions and techniques. One I just discovered — despite coding in C for decades — is the token paste operator. It’s a weirdo.
Continue reading →

Posted in Lesson | Leave a reply

Hunt the Wumpus Code

Posted on February 8, 2020 by dgookin
Reply

Original Wumpus artwork
I had a great time coding Hunt the Wumpus. Like most programming challenges, it was fun, exciting, and frustrating all at once. Some code ran beautifully the first time. Other code contained silly mistakes that bogged me down. And solutions unveiled themselves magically like a sugar cube dissolving in water.
Continue reading →

Posted in Lesson | Leave a reply

Automated Guessing Game – Solution

Posted on February 8, 2020 by dgookin
Reply

In the climatic scene of the movie Wargames, the WOPR computer plays Tic-Tac-Toe. A question is asked, “Can the computer play itself?” This postulation forms the basis of all computer learning, but that wasn’t the puzzle for this month’s Exercise.
Continue reading →

Posted in Solution | Leave a reply

Implementing Hunt the Wumpus in C

Posted on February 1, 2020 by dgookin
2

Original Wumpus artwork
In last week’s Lesson, I described the history and gameplay for the classic text mode game, Hunt the Wumpus. The task of coding the game took considerably longer than writing the blog post.
Continue reading →

Posted in Lesson | 2 Replies

Automated Guessing Game

Posted on February 1, 2020 by dgookin
Reply

Last month, I published a post of the classic programming chestnut, a number-guessing game. In the post, I wrote: “Variable tries is set equal to 6 because I read somewhere that it’s possible to guess a value between 1 and 100 in six or fewer tries (though I’m probably incorrect).” And, yes, I was wrong.
Continue reading →

Posted in Exercise | Leave a reply

Hunt the Wumpus

Posted on January 25, 2020 by dgookin
4

Original Wumpus artwork
The game Hunt the Wumpus isn’t difficult to code in C. In fact, all you need do is start with the basic number-guessing game presented in last week’s Lesson and you can build just about any text-mode game. That’s what I did when I started my own C language version of Hunt the Wumpus.
Continue reading →

Posted in Lesson | 4 Replies

The Essence of the Text Game

Posted on January 18, 2020 by dgookin
Reply

I was perusing Rosetta Code the other day, looking for more programming ideas to explore. One of the tasks provided, with examples in a variety of programming languages, was to code the old computer game Hunt the Wumpus.
Continue reading →

Posted in Lesson | Leave a reply

Fun with the asprintf() Function

Posted on January 11, 2020 by dgookin
Reply

If you desire to store formatted output in a buffer, the snprintf() function, covered in last week’s Lesson, is a safe alternative to the standard Library sprintf() function. An even better choice is the asprintf() function.
Continue reading →

Posted in Lesson | Leave a reply

Post navigation

← Older posts
Newer posts →

Recent Posts

  • Ctype Function: isxdigit()
  • Ctype Function: ispunct()
  • Ctype Functions: isascii() and iscntrl()
  • That Series That Lacks a Name but Equals 5e – Solution
  • Ctype Functions: isblank() and isspace()

Recent Comments

  • dgookin on That Series That Lacks a Name but Equals 5e – Solution
  • Chris Webb on That Series That Lacks a Name but Equals 5e – Solution
  • Chris Webb on That Series That Lacks a Name but Equals 5e – Solution
  • Chris Webb on That Series That Lacks a Name but Equals 5e – Solution
  • Chris Webb on Ctype Functions: isblank() and isspace()

Meta

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

Copyright © 1997-2026 by QPBC.
All rights reserved

Proudly powered by WordPress