Unless you're dealing with a board with millions of positions or more, sparse matrices don't matter. <div><br></div><div>The array package has support for 2d arrays. </div><div><br></div><div>I've my own pretty fancy multi dim array tooling in the works, but for your use case just use array package <span></span><br>
<br>On Friday, June 20, 2014, Chris Warburton <<a href="mailto:chriswarbo@googlemail.com">chriswarbo@googlemail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Corentin Dupont <<a href="javascript:;" onclick="_e(event, 'cvml', 'corentin.dupont@gmail.com')">corentin.dupont@gmail.com</a>> writes:<br>
<br>
> Instead of encoding the board, I would encode the position of the pieces:<br>
> there is usually much less pieces than squares.<br>
<br>
Possibly useful: <a href="http://en.wikipedia.org/wiki/Sparse_matrix" target="_blank">http://en.wikipedia.org/wiki/Sparse_matrix</a><br>
<br>
Cheers,<br>
Chris<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'Haskell-Cafe@haskell.org')">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div>