[Haskell-cafe] How to devide matrix into small blocks
voigt at tcs.inf.tu-dresden.de
Thu Jun 14 03:42:38 EDT 2007
> I have wrote the target function like this, and tested.
> mkBlocks (w,h) = map concat . concat . transpose . chop h . map (chop w)
I don't understand how this relates to your original problem
description. But then, again, I probably did not understand that one too
> This is not a homework, though likely to be one.
No offense meant, of course.
Anyway, as a challenge to others on the list: write a one-liner that
splits an "image" like ["abcd","efgh","ijkl","mnop"], interpreted as
into the list of images:
for (w,h)=(2,2), into:
for (w,h)=(1,2), and so on.
(Where an image like
is represented as ["ab","ef"].)
Have fun, Janis.
Dr. Janis Voigtlaender
mailto:voigt at tcs.inf.tu-dresden.de
More information about the Haskell-Cafe