   nim game
  hellohave someone manage to develop nim game in matlab?thanks a lot   
  This sounds like a homework assignment, so I won't say much.I had to look up what 'Nim' is.  It's a 2-player game about as complicated as tic tac toe (simpler, even).  You've got 4 rows of stones; the rows begin with 1,2,3, and 4 pieces respectively.  Each turn, a player can remove as many stones as he likes from a row.  The player to take the last stone loses.I have not implemented this game in MATLAB, but I estimate that it would only take a few minutes to do so.What exactly is the problem?   ;  i understand the meaning of the game but i have never use matlabi have manage to develop it in c++ so i would like to have a help in matlab;  I summarized the game mainly for the benefit of other forum-goers; I assumed you understood it...MATLAB syntax is very similar to C syntax.  A quick google turns up this tutorial which looks reasonable.  Also, when in doubt, type 'help [TOPIC]' in the MATLAB command prompt.  The documentation is very good.   ;  i see what you meani am going read itthe purpose of my post was if someone can quickly help meanyway thanks for answer   ;  Winning strategy:1) Bit-wise XOR all the numbers of stones together; call the result x.2) If x is 0, generate a random move.3) Look at the largest bit set in x and pick a row that also has it set.4) If that row had n stones, pick the move that leaves n XOR x stones in that row.For the initial configuration that Emergent described, the only winning move is taking all stones from the row that has 4.The more interesting problem is figuring out why this works.