On Sun, Feb 23, 2014 at 5:45 AM, Jan-Pieter Jacobs <janpieter.jac...@gmail.com> wrote: > Everybody likes games, right?
Yes and no. ;) If you like we can go into more detail on the chat forum. > mm=: =,&(+/)(~:#[)e.&~.~:#] Nice! > See http://codegolf.stackexchange.com/a/12497/665 for the explanation > > It uses quite a bit of concepts, but I think it is small enough to explain > in 5 minutes. > It would be even cooler to couple this to a GUI, which seems to be easy to > make, but I have no experience with in J. > Or an AI player... > > Thoughts, suggestions and GUI's from the guru's are welcome ;). If you want to put together a five minute presentation on this, that would be great - the more the merrier. Meanwhile, if you want to exhaustively test a variant implementation: testdata=: 'abcd'{~4 4 4 4#:4^4 That's 256 distinct cases, and $ mm"1/~ testdata 256 256 2 That's an exhaustive test of the algorithm. So let's say you had two other implementations: mma and mmb (mma"1/~ -: mm"1/~) testdata 1 (mmb"1/~ -: mm"1/~) testdata 0 mma would be an equivalent implementation, while mmb is not. Thanks, -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm