It's at http://projecteuler.net/index.php?section=problems&id=161 .
Basically, given "triominos" like this:
]trioms=. ~.,(|:@:|. ; |: ; ] ; |."1) &> (>'X';'XX');,:'XXX'
+--+--+--+--+-+---+
|XX|XX|X | X|X|XXX|
|X | X|XX|XX|X| |
| | | | |X| |
+--+--+--+--+-+---+
there are 41 ways to tile (no gaps) a 2x9 grid, e.g.
,/,.&>/"1]3 2$4{trioms
XX
XX
XX
XX
XX
XX
XX
XX
XX
Others are hard to show simply because of how the pieces fit together, e.g.
(#7)
(4 4,0 4,:4 3){trioms
+--+--+
|X |X |
|X |X |
|X |X |
+--+--+
|XX|X |
|X |X |
| |X |
+--+--+
|X | X|
|X |XX|
|X | |
+--+--+
Once you've found the 41 ways to tile 2x9, figure how many ways to tile 9x12
- this number is the answer you give to Project Euler.
On Tue, Dec 15, 2009 at 8:57 AM, Dan Bron <[email protected]> wrote:
> meridian wrote:
> > Maybe someone can suggest how to re-implement in J.
> > (if possible without using a totally new algorithm)
> >
> > #!/usr/bin/env python
>
> Would you mind posting the problem spec?
>
> -Dan
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm