I also looked at the moo page on essays.
While figuring out what the script does, I found myself in a need of a verb
that does the opposite, namely calculates the number of bulls and cows for a
given entry.
This is much easier task and not very interesting in itself, however, one of
the iterations looked like this:
ans=:+/@:= ([ , -~) [: (>./ . +) =/
While not very efficient it features an unusual case of ".", which I thought
some of you may find interesting.
So the score verb woold look like this:
score=:[: ([ display) ] ; 'bc' #~ 1 2 3 4&ans
and the session
moo 4$10┌───────┬───┐│1 8 4 3│bcc│└───────┴───┘216 choices
left┌───────┬──┐│3 9 4 8│cc│└───────┴──┘80 choices left┌───────┬──┐│1 4 8
0│bc│└───────┴──┘16 choices left┌───────┬───┐│1 5 3 4│bbb│└───────┴───┘3
choices left┌───────┬────┐│1 2 3 4│bbbb│└───────┴────┘
_________________________________________________________________
Get thousands of games on your PC, your mobile phone, and the web with Windows®.
http://clk.atdmt.com/MRT/go/108588800/direct/01/
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm