Contents

  1. Introduction
  2. Downloading Instructions
  3. Code Snippets
    1. Calendar event (JavaScript1.1)
    2. Copyright function (JavaScript)
    3. Date debug function (JavaScript)
    4. Date functions (JavaScript1.1)
    5. Last modified function (JavaScript)
    6. Outline style sheet (HTML)
    7. New flag function (JavaScript)
    8. Parse parameters passed via URL (JavaScript)
    9. Sequence object (JavaScript1.1)
    10. Work Week function (JavaScript)
    11. US Flag (HTML)
  4. Games
    1. Checkers - Play checkers against the computer (JavaScript 1.1)
    2. Guessing Game - Text based guessing game written in C
    3. Word Search - Text based word search puzzle generator written in C
    4. Yahtzee - Dice game written in C for MS DOS
  5. Utilities
    1. Calendar - A monthly calendar written in Java
    2. HTML notes  - convenient cheat sheets for HTML
    3. Meta Tag Generator - Create "Meta" tags for HTML files written in JavaScript
    4. Stopwatch - A stopwatch written in JavaScript

Introduction

This is a collection of freeware programs that I've written or found on the net.  These are a collection of useful or entertaining programs that are written in C, C++, Java or JavaScript/HTML.  The Java and JavaScript programs have a demo which can be run.  The source and executable are stored in an Zip archive.  (The web has adopted zip as a standard format, so it's not just for MS DOS any more.)

The demos run in their own browser window.  This way I can run the utilities and leave them up without them interfering with my browsing.

I've kept the reference to the original author; please do the same.

Many of the programs list the environments they were tested in.  The following abbreviations are used:

Downloading Instructions

To download JavaScript programs, start the demo then save the source file with your browser.  (With many browsers, it's in the "File" menu.)

To download C, C++ and Java programs, there will be a link to the zip file containing the program.  The Java programs also have a demo zip file.  This file is different than them demo because it contains additional files.  The zip file is also compressed which currently isn't allowed for programs to run from the server.
 

Code Snippets

Most of the code snippets are standalone and can be reached though the initial index.
 

Outline Style Sheet

This style sheet will cause ordered (or numbered) lists to be displayed as an outline.  This will work with the numbered lists created by HTML generation programs unless they over ride the style.
Code
<html>
<head>
<title>Example</title>
<link rel="STYLESHEET" type="text/css"href="./outline.css"> 
</head>
<body>
<ol>
    <li>Line #1</li>
    <ol>
        <li>Line #2</li>
        <li>Line #3</li>
    </ol>
    <li>Line #4</li>
</ol>

Example
  1. Line #1
    1. Line #2
    2. Line #3
  2. Line #4

outline.css
/* This style sheet causes ordered lists to be displayed as an outline
 *
 * To use save this file in the same directory as the html document then
 * include the following statement between <head> & </head>:
 *   <link rel="STYLESHEET" type="text/css" href="./outline.css">
 */
ol {list-style-type: upper-roman}
ol ol {list-style-type: upper-alpha}
ol ol ol {list-style-type: lower-roman}
ol ol ol ol {list-style-type: lower-alpha}
ol ol ol ol ol {list-style-type: decimal}

The styles written to be included in the header of the HTML file. 

<style type="text/css">
ol {list-style-type: upper-roman}
ol ol {list-style-type: upper-alpha}
ol ol ol {list-style-type: lower-roman}
ol ol ol ol {list-style-type: lower-alpha}
ol ol ol ol ol {list-style-type: decimal}
</style>

Games

Checkers

This game allows you to play checkers against the computer.

The author of the original script is unknown.  It can be found at http://www.zdnet.com/devhead/.  I improved the initial instructions.

You can play the checkers demo right here.  An archive is supplied because there are ten .gif files needed for the script to run.
 

Guessing Game

The computer guesses at what the user is thinking of by asking yes or no questions.  If it can't guess, it will ask for a question so I can guess the item next time.  The subjects states and animals are provided as examples.

This is a simple C program that takes input from stdin and sends output to stdout.  It should work in any command line environment.

I wrote this program years ago.  It's a C program.  It has been compiled on the Commodore 128 and Microsoft C.  These were all before ANSI C was available.  It should still compile, but it may generate warnings for old syntax.  The file port.h contains code to customize for different systems.

The archive includes the C source and MS DOS executable.

Word Search

This program creates a word search.  It allows you to make multiple puzzles with the same list of words.  It is interesting to see children's reaction because they expect all the puzzles to be the same.  (You can print some puzzles which are harder than others.  If you put the hard puzzles on the bottom, you can control which children get the harder puzzles by "dealing from the bottom of the deck".)

When entering the list of words, a blank line terminates the list.

The program runs from the command line.  It prints the puzzle to stdout.

I wrote this program years ago.  It's a C program.  It has been compiled on the Commodore 128, VAX, UNIX and Microsoft C.  These were all before ANSI C was available.  It should still compile, but it may generate warnings for old syntax.  The file port.h contains code to customize for different systems.

The archive includes the C source and MS DOS executable.

Tested: MS DOS 3.2, 3.3, 5, 6.2, 7.0, Win 3.1, Win 95, VMS, UNIX
 

Yahtzee

The classic dice game.  It only runs under MS DOS.  It contains the source code.  Some day I may convert it to run under Java.

The archive includes the C source and MS DOS executable.

Tested: MS DOS 3.2, 3.3, 5, 6.2, 7.0, Win 3.1, Win 95
 

Utilities

Calendar

Displays a monthly calendar.  It can display the current month or a specified month.  It has buttons for moving a month ahead or a month back.

If running as a program, it can be resized.  (This works correctly under Java 1.0.  Under Java 1.1, the window must be covered and uncovered after it is resized before the entire window is updated.)

Purpose:  Displays a month in a window.  The default is the current month and current year.
Usage: javaw CalendarApp -m=month -y=year
Classes: CalendarApp, AppletFrame, Calendar, Day, Format

Purpose:  Displays the specified month in an HTML document.  The default is the current month and current year.
Usage: <Applet code="Calendar.class" width=width height=height> <param name=m value=month> <param name=y value=year> </applet>
Classes: Calendar, Day, Format

Note: In the usage description, bold text is required. Underlined text is text is replaced by an actual value.

The calendar demo creates a calendar in a new window.  The calendar archive contains the source code and compiled Java classes.

Tested: Java 1.0, Java 1.1, NS 4.04/Win 95

Meta Tag Generator

This JavaScript generates "Meta" tags for HTML files.  These tags are used by search engines to index pages.

The original script was written by Roger Zeitel.  It can be found at http://www.zdnet.com/devhead/.  I modified it to also generate GeoCity tags.

The Meta Tag demo creates a form in a new window.

Browsers: NS 3+, IE 4+
 
 

Stopwatch

Stopwatch with start, stop, reset and memory buttons.  The time is based on the difference between the start time and the current time.  Once a second the display is updated, but being called regularly isn't used to keep the time accurate.  The stopwatch is written in JavaScript and HTML.

The stopwatch demo creates a stopwatch in a new window.

Tested:  NS 3.01/Win 95, NS 4.04/Win 95 


Last Updated: $Date: 2003/11/11 19:10:16 $ GMT