Free software
Images |
Text |
Meta |
NetHack |
Snippets
TI-83 |
Funge |
Pentominoes |
free-software/ |
nethack/
Here is where I store some programs that are free. If you like
something that you see here, please feel free to take it and make
it yours. But still free. Thanks.
Image processing
-
ImageFmtc.h
(.c), a very simple and I
think user-friendly interface to various flavors of the BMP, PBM, PGM,
and PPM image formats. Also converts between RGB and grayscale very
easily.
-
ImageGifc.h
(.c),
a simple implementation of a GIF image writer (no reader yet). After
public-domain code by Sverre Huseby, 1992.
-
ImagePalc.h
(.c), a few functions
designed to convert between various internal formats: 8-bit grayscale,
8-bit palettized, and 24-bit RGB formats. Includes an error-diffusion
dithering algorithm due to Victor Ostromoukhov.
-
simple_png.c, a pair of
functions demonstrating a simple interface for reading and writing PNG
images using the open-source libpng library.
-
UnionFind.h
(.c), a very simple
implementation of the classic union-find algorithm. It is not reentrant.
Text processing
-
Crossword utilities,
which I have used in creating crosswords for The Tartan. Includes
a crossword dictionary.
-
haiku-finder
(lib.c,
.h), a program
for locating "found haiku" in arbitrary text files, as described
here.
Uses the Carnegie Mellon Pronouncing Dictionary (available via
FTP).
-
pento, a program
to play "Capture Pentominoes," a board game of my own design.
-
rot13, a rot13 utility. It also
has support for rot-n, where n is any integer, and a
Caesar-cipher cracker that uses English letter frequencies.
-
split_get, a program for
splitting and reassembling binary files. (For example, for transporting
large files on multiple floppy disks.)
-
tea-example.c, an example
of how to use TEA, the Tiny Encryption Algorithm
(Wheeler & Needham, 1994).
Fixes several typos in Wheeler & Needham's
C implementation, and shows one way to give the routines generic
wrappers. This encryption algorithm is not adequately secure for
real purposes.
-
unitrans, a program that
converts files between ASCII, UTF-8, UCS-2, and other encodings,
including one that's supposed to be supported by the Omega extension of TeX.
Wrapper for the
uniformats.h
(.c) library.
Meta: Programs about programs
-
Befunge utilities, including
the Fungus virtual machine and its two-dimensional assembler.
-
detab, an entab/detab
utility.
-
Ocamlmerr,
a tool for generating nice syntax-error messages from parsers written
using the ocamlyacc
tool. Inspired by Merr.
-
quine, a little program that
tries to generate a "quining" function for any given C program. It isn't
very robust, in that it expects that all #include directives
will be placed first in the file, and that lines generally do not exceed
512 characters. Includes instructions for bootstrapping the
quine program's self-quining ability. Can generate 100% portable
ISO C quines, with the -c option. There's a less
complicated earlier version
here.
-
usenetify, a utility that
understands enough C and C++ to wrap long lines in a manner suitable for
Usenet postings or piping to a line printer. Should be used in series
with detab.
-
usenetify2, a utility that
understands C much better than the old usenetify. It also does
automatic detabbing. It does not wrap lines as aesthetically as
usenetify, but I believe it to be completely free of bugs
(unlike the former program).
NetHack patches
This section contains patches I've written for the computer game NetHack. All of these
patches are placed in the public domain by their author. If you don't
know what NetHack is, you have two options: Ignore this section, or
(recommended) follow that link and download the game! Source-diving
optional.
-
The "sitting" patch
combines four YANIs: Joshua Kwan's "pit-sitting" patch,
Mark Rae's idea
in which very heavy creatures shatter boxes and chests by sitting
on them, new interactions when sitting on eggs, and my own YAFM
for sitting on a cream pie.
-
The "splash"
patch causes thrown potions to have effects on objects. You can
now blank scrolls by throwing water at them. This patch is compatible
with Nephi's invisible
objects patch.
-
A quick fix for
this
apparent bug makes the player turn into a stone golem if he becomes
a flesh golem while wielding a cockatrice corpse, even if he became a
flesh golem by stone-to-fleshing himself.
-
The "jargon" patch
adds several minor enhancements to the parser. You can now genocide
"<foo> mindflayers" and wish for "helmets of <foo>,"
"royal jelly," and "rubber chickens." Suggestions for more additions
are welcomed.
-
The "monring"
patch allows monsters to use rings somewhat intelligently.
For a more complete and spoily rundown, go
here.
-
This patch implements Simon
Tatham's idea
that a successful brain-suck by a master mind flayer should cause the
castle tune to randomize again. Because, well, it's a Mastermind
flayer.
-
This patch
implements Clint Herron's idea
that there should be some way to create new candles for the ascension:
reading a non-cursed scroll of light while confused changes all your
royal jelly into wax candles. (Well, royal jelly is kind of like
wax.)
-
This patch
[237K, text] doesn't change any game behavior; it just
changes a lot of comments in the game's source code, to fix typos, spelling
mistakes, grammatical errors, and consistency (e.g., referring to "the Amulet"
versus "the amulet"). Totally pointless for anyone except source divers,
and pretty pointless for them, too, but now I can say I've read all the
comments in NetHack!
-
This patch
implements Joe Clark's idea
that "an emerald ring" be reported as "a green stone ring" until
emeralds are actually identified. I personally wouldn't use this
patch, though; it unbalances wizards without adding anything new
in the way of gameplay.
-
The "xorn" patch
fixes a few bugs that will undoubtedly get fixed in the next version
of NetHack: you can't engrave while embedded in rock; fixed message
for writing underwater; trying to dig messes up engravings; and
fixed messages for casting Protection in funny places.
-
The "wish" patch
allows the player to wish for "the gnome's aklys" and get it. (Wizards
can wish for
"Brad's
pit".) It also refactors the wishing code a little bit. This is
probably full of bugs.
Snippets
-
AlphaBeta.hh,
a C++ template class implementing depth-first search, alpha-beta
search, and breadth-first search on an arbitrary game tree.
-
ctemplates,
a demonstration of how to create a "template class" in standard C.
-
aplencode,
a program that reads an APL program in Jim Weigang's
"APL-ASCII" notation and writes it back out in UTF-8. Somewhat useful
for typesetting APL with TeX.
-
bitap, an implementation of
the bitap algorithm for fuzzy string searching.
-
cartouche,
a hack perpetrated for Shawn Knight's Egyptology class in 2004.
Self-documenting.
-
dance, a C implementation of Donald
Knuth's "Dancing Links"
algorithm. Includes an application to the solving of Sudoku puzzles.
-
greekana,
a program that produces all the words in a dictionary that are anagrams
of Greek letters, as described in this
rec.puzzles post.
-
imagetour,
a program that draws a visual representation of a Traveling Salesman tour.
I used it to make lena-tour.png,
after feeding the "Lena" image through randtsp
and a TSP solver.
-
pangram, a program
that generates self-inventorying sentences by Robinsonizing.
-
randtsp, a program
that generates input to the TSP solver according to a given grayscale
image. See imagetour.
-
A unit cell
[PNG] for simulating Rule 110 in
Wireworld.
[RLE
source]
-
sirds_hider,
a program that hides "secret messages" in SIRDS stereograms,
as described in sci.crypt in July 2004.
This page was last updated
26 June 2011
All original code, images and documentation on this page
are freely distributable.
Please keep them that way.