-- http://c...content-available-to-author-only...e.com/questions/49050/tiling-a-2n-by-2n-grid-with-l-shaped-trominoes#59330 import Control.Applicative -- not needed in GHC 7.10 r=reverse g n s x y|n<1=[s]|x>k=r<$>g n s(2^n+1-x)y|y>k=r$g n s x$2^n+1-y|0<1=zipWith(++)(h s x y++h"-"k 1)$h"|"1 k++h"+"1 1 where m=n-1;k=2^m;h=g m f n x=unlines.g n"O"x main=putStr(f 5 10 15)