On 5/24/07, Terrence Brannon <[EMAIL PROTECTED]> wrote:
J'ers, if you have time and interest, there is a new thing on the shootout
called the Meteor Contest:

http://shootout.alioth.debian.org/gp4/benchmark.php?test=meteor&lang=all

The shootout moderators have said that this one has no restrictions on how it is
done.

The problem with interesting items like this is that they take time
and thought to solve.  (Something I haven't had enough of.)

I've managed to come up with a representation for the board, and
adjacency:

boardmask=: 10 10 {. 10 11$ 1 0
boardinds=: I.,boardmask
boardcoords=: 10 10#:boardinds
dirs=:_2+5 5#:2*3 4 7 9 8 5 NB. dirs' indices increase clockwise
neighbors=: dirs (+"1/~ e.&:(<"1) ]) boardcoords

But I haven't had enough time yet to think about the pieces.  I
was originally going to represent them as a sequence of direction
indices from the starting piece (allowing me to rotate the piece by
adding to these indices modulo 6, and flip the piece by reversing
the sequence), but piece 4 does not lend itself to this approach.

So, I need to think a bit more about transformations like rotation
for these coordinates...

And then there's the whole "solve the packing problem" issue.

Anyways, this would probably be fun, but it's definitely not the
sort of thing that I can solve in 5-10 minutes of free time.

--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to