99 bottles of beer on the wall



printf("%d bottles of beer on the wall!\n", x);
          printf("%d bottles of BEER!!\n", x);
          printf("Take one down, pass it around --\n");
          printf("%d bottles of beer on the wall!!\n", x);
          
          printf("Do you want another beer?\n");
          printf("\n\nPress Y for another, N to stop the madness:\n");


(more)

Kindness reporter

Then Carrie at last turned to Matthew. "And what happened today for you, Bear?"

He finished chewing his dinner and had a sip of milk. Jordan and Victor giggled about some private joke. He spread his arms as if to stop traffic. "Everyone has to listen to me."

Once it got quiet, I said, "Yes?"

"I am the Kindness Reporter."
(more)


A text adventure game for my kids

I pressed Ctrl-F10 to run it. The story is set in a haunted castle with many passages, bloodthirsty monsters at every turn and a healthy serving of skeletons, ghosts and large rats. The idea is to rescue a child monk who bears a remarkable resemblence to my five-year-old son.

"Cool. Which thing should I choose?"

"It's up to you," I said. "It's your game." Unfortunately, he chose an option which dropped him 40 feet in to a spike-filled pit where his body was feasted upon by rats and maggots.
(more)


How to build a list of lists

A long list of items, which often begins simply enough, will become totally unwieldly. On scraps of paper it may be fine, but transfer this list to a web page, and it is about as clear and exciting as a cold bowl of plain spaghetti.

Of course, a little JavaScript could turn this in to several drop down lists, but what if scripting isn't an option? With XHTML and a little bit of CSS, the list can be transformed a navigable menu.
(more)


Pointer to a string


#include <stdio.h>
#include <stdlib.h>

/* pointers and strings, a love story...
/* this shows how a string can be displayed
/* by using pointers to the characters in the string
/* to dance through the array and display it's contents. */

int main()
{
        /* declare a string */

        char string[] = "The name of the band is Grateful Dead.";


(more)