<font face="'courier new', monospace"><span style="color:rgb(17,17,17);font-size:13px;line-height:21px;background-color:rgb(255,255,255)">a = [1,1,1,1] </span><br style="color:rgb(17,17,17);font-size:13px;line-height:21px;background-color:rgb(255,255,255)">
<span style="color:rgb(17,17,17);font-size:13px;line-height:21px;background-color:rgb(255,255,255)">b = [0,1,2,3] </span><br style="color:rgb(17,17,17);font-size:13px;line-height:21px;background-color:rgb(255,255,255)"><span style="color:rgb(17,17,17);font-size:13px;line-height:21px;background-color:rgb(255,255,255)">d = [0,0,0,0] </span><br style="color:rgb(17,17,17);font-size:13px;line-height:21px;background-color:rgb(255,255,255)">
<br style="color:rgb(17,17,17);font-size:13px;line-height:21px;background-color:rgb(255,255,255)"><span style="color:rgb(17,17,17);font-size:13px;line-height:21px;background-color:rgb(255,255,255)">for i in b: </span><br style="color:rgb(17,17,17);font-size:13px;line-height:21px;background-color:rgb(255,255,255)">
<span style="color:rgb(17,17,17);font-size:13px;line-height:21px;background-color:rgb(255,255,255)"> for j in c: </span><br style="color:rgb(17,17,17);font-size:13px;line-height:21px;background-color:rgb(255,255,255)"><span style="color:rgb(17,17,17);font-size:13px;line-height:21px;background-color:rgb(255,255,255)"> if (i+j)<3: </span><br style="color:rgb(17,17,17);font-size:13px;line-height:21px;background-color:rgb(255,255,255)">
<span style="color:rgb(17,17,17);font-size:13px;line-height:21px;background-color:rgb(255,255,255)"> d[i+j] += a[i] </span> </font><div><br>
</div><div>My just work implementation in Haskell</div><div><a href="http://hpaste.org/57452">http://hpaste.org/57452</a></div><div><br></div><div>Another people implementation in Haskell with Monad and it turns out complex and very imperatively.</div>
<div><a href="http://hpaste.org/57358">http://hpaste.org/57358</a></div><div><br></div><div>Do you have any cool solution in FP way?</div><div><br></div><div>Thanks.</div><div>-Simon</div>