title: Minimax algorithm in a game
body: <p>Im trying to create my first game using the minimax algorithm but i dont know how to implement this using a tree.</p>
  
  <p>The game rules are the following:</p>
  
  <ul>
  <li><p>On table there are M cubes(for example 40) and each player must take from the table 1 or L cubes (L is defined in program. for example L=5).</p></li>
  <li><p>The winner is the player who takes the last cube from table.</p></li>
  <li><p>The player who plays first is MAX(the computer) and second plays the MIN(human).</p></li>
  </ul>
  
  <p>Firstly we must run the minimax algorithm and then the player MAX plays with the best move.</p>
  
  <p>This is the game but i cant imagine how to implement this with tree. Can anyone help me and give me an idea?</p>