Category : C Source Code
Archive   : JUMBLEPZ.ZIP
Filename : JUMBLE.SHR

 
Output of file : JUMBLE.SHR contained in archive : JUMBLEPZ.ZIP
Path: uunet!seismo!lll-lcc!ames!ucbcad!ucbvax!decvax!tektronix!tekgen!tekred!games-request
From: [email protected]
Newsgroups: comp.sources.games
Subject: v01i096: jumble - de-jumble those infernal word puzzles
Message-ID: <[email protected]>
Date: 16 Jul 87 16:32:49 GMT
Sender: [email protected]
Lines: 144
Approved: [email protected]

Submitted by: Nick Flor
Comp.sources.games: Volume 1, Issue 96
Archive-name: jumble

[The package as I received it contained just the C source file.
I added a simple Makefile and the "guess" shell script. Maybe
now I'll start playing those word games in the paper 🙂 -br]

#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh # will see the following message at the end:
# "End of shell archive."
# Contents: README Makefile jumble.c guess.sh
# Wrapped by billr@tekred on Thu Jul 16 09:28:40 1987
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f README -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"README\"
else
echo shar: Extracting \"README\" \(218 characters\)
sed "s/^X//" >README <<'END_OF_README'
Xjumble: A jumble (TM) de-jumbler. The ultimate weapon to use
Xagainst the Jumble (tm) puzzle. This program helps solve the
Xpuzzle by listing all permutations of letters is a given word.
X
X Nick Flor
X hp-sdd!nick
END_OF_README
if test 218 -ne `wc -c echo shar: \"README\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f Makefile -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"Makefile\"
else
echo shar: Extracting \"Makefile\" \(85 characters\)
sed "s/^X//" >Makefile <<'END_OF_Makefile'
X# Makefile for jumble
XCFLAGS = -O
X
Xjumble: jumble.c
X cc $(CFLAGS) -o jumble jumble.c
END_OF_Makefile
if test 85 -ne `wc -c echo shar: \"Makefile\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f jumble.c -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"jumble.c\"
else
echo shar: Extracting \"jumble.c\" \(1127 characters\)
sed "s/^X//" >jumble.c <<'END_OF_jumble.c'
X/*
X * jumble.c:
X * A jumble (TM) de-jumbler.
X * The ultimate weapon to use against the Jumble (tm) puzzle.
X *
X * Copyright (C) 1987, Nick V. Flor
X *
X * Permission is granted to freely distribute this source.
X * Unless you try to make money off of it. (Not bloody likely)
X *
X * If you really enjoy this program, please send me Disneyland money.
X * (Or e-mail me a better version)
X *
X */
Xstatic char
X *bigword;
X
X#define swap(a, b, t) t = a; a = b; b = t;
X/*
X * jumble:
X * Solve those darn jumble thingamajiggies in the San Diego Union
X * and other newspapers across the world.
X *
X * entry:
X * word -- The word to be jumbled.
X *
X */
Xjumble(word)
Xchar
X *word;
X{
Xint
X i = 0;
Xchar
X ch;
X
X if (!*word) /* Printing at the end of the recursion */
X printf("%s\n", bigword);/* is sufficient */
X else while (word[i]) {
X swap(word[0], word[i], ch);
X jumble(&word[1]);
X swap(word[0], word[i], ch);
X i++;
X }
X}
X
X
Xmain(argc, argv)
Xint
X argc;
Xchar
X *argv[];
X{
X if (argc != 2) {
X puts("usage: jumble ");
X exit(0);
X }
X bigword = argv[1];
X jumble(argv[1]);
X}
END_OF_jumble.c
if test 1127 -ne `wc -c echo shar: \"jumble.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f guess.sh -a "${1}" != "-c" ; then
echo shar: Will not over-write existing file \"guess.sh\"
else
echo shar: Extracting \"guess.sh\" \(294 characters\)
sed "s/^X//" >guess.sh <<'END_OF_guess.sh'
X#! /bin/sh
X# shell script to make a reasonable first guess at a likely de-jumbled
X# word. The jumble program generates all permutations; this script
X# only prints ones that are in the dictionary.
X# Bill Randle ([email protected])
X#
XDict=/usr/dict/words
Xjumble $1 | sort | comm -12 - $Dict
END_OF_guess.sh
if test 294 -ne `wc -c echo shar: \"guess.sh\" unpacked with wrong size!
fi
chmod +x guess.sh
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0


  3 Responses to “Category : C Source Code
Archive   : JUMBLEPZ.ZIP
Filename : JUMBLE.SHR

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/