<div>Hi All,</div>
<div>        I&#39;m attempting to write a program for the game nim.(The game of Nim is played with two players and several piles of stones. On each move a player removes as many stones as they would like but form only one pile. The player who takes the last stone wins) It not as simple as I first thought. Here is my basic starting points. Any comments would be greatly appreciated. I not well versed in Haskell yet so simple(basic) Haskell rather than well written haskell if you understand what I mean. Complicated monads are way out of my league.</div>

<div> </div>
<div> </div>
<div>1) I first get the program to give me three random piles by doing <br>    nim = do<br>  x &lt;- getStdRandom $ randomR (1,10)<br>  y &lt;- getStdRandom $ randomR (1,10)<br>  z &lt;- getStdRandom $ randomR (1,10)<br>
  return [x,y,z]<br> Cant get this to work!<br>2) Now I need to get the program to ask for a number and which pile to remove the number  from. This is tricky I thought about asking to find the  elementAt<br>elementAt :: [a] -&gt; Int -&gt; a<br>
elementAt list i = list !! (i-1) put this in a variable<br>then asking the palyer how many to take away.<br> and then subtracting the number from and then putting it back into the list but this seem impossible.<br>Then the second player would do the same.<br>
3) Finally we would end up with a case statement like<br>f x = in case of x<br>[0,0,1]-&gt; You win<br>[0,1,0]-&gt; You win<br>[0,0,1]-&gt; You win<br>[_,_,_]-&gt; keep playing.<br> <br>Lets know what you think please, getting confused.<br>
 </div>
<div>John</div>