Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!cs.utexas.edu!wupost!darwin.sura.net!jvnc.net!gmd.de!ira.uka.de!Sirius.dfn.de!tubsibr!infbssys!neitzel
From: neitzel@ips.cs.tu-bs.de (Martin Neitzel)
Subject: Please send me your J code
Message-ID: <1992Dec10.154228.8389@ips.cs.tu-bs.de>
Sender: neitzel@ips.cs.tu-bs.de (Martin Neitzel)
Reply-To: neitzel@ips.cs.tu-bs.de
Organization: Inst. f. Informatik, TU Braunschweig, FRG
Date: Thu, 10 Dec 1992 15:42:28 GMT
Lines: 37

When trying to lure other people into APL, I usually choose the
Mastermind(tm)/Moo(6) game as an effective example.  I thought it
would now be worth the effort to cook up a small paper (along the
lines of LJ.Dickeys "What_is_J") introducing J by using this nice
application example.

Now, while I was writing the necessary functions I began to wonder how
other people would do them.  And that it might be nice to have about
half a dozen different approaches in said introductionary paper.

So I'm soliciting you for J code for a "moo" program I human could
guess against.  Please send it by email, I will make a summary of all
collected items.  (Your program is all I need - I'll care for comments
and explanations aimed at the novices later; they wouldn't hurt,
though.)

						Martin Neitzel

PS: Here are the game's rules (they haven't changed since Unix Version 7)
PPS: speaking of versions: I just have docs for Version 5, so I
might get confused by v6 features.


NAME
     moo - guessing game

SYNOPSIS
     /usr/games/moo

DESCRIPTION
     moo is a guessing game imported from England.  The  computer
     picks  a  number consisting of four distinct decimal digits.
     The player guesses four distinct digits being scored on each
     guess.   A  ``cow'' is a correct digit in an incorrect posi-
     tion.  A ``bull'' is a correct digit in a correct  position.
     The  game  continues  until the player guesses the number (a
     score of four bulls).
