[Haskell-beginners] nim

John Moore john.moore54 at gmail.com
Mon Oct 26 07:51:47 EDT 2009


Hi All,
          In the game of nim I want to make a move such as take x from
pile A. This will then be subtracted from the starting list.Is this correct
in as much as I want to have a move Take 3 from pile  A: input would be A3 I
need it to return a list as I wish to take this result and use zipwith (-)
[starting list][result]. How do I use the result, do I store in a variable?

typeOfMove :: (a,b) -> [Int]
typeOfMove ax
  |ax = [x,0,0]
  |bx = [0,x,0]
  |cx = [0,0,x]

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20091026/457f503f/attachment.html


More information about the Beginners mailing list