title: SML - How to check if 2 parameters are the same in pattern matching?
body: <p>I have this piece of code which calulates the hanoi movement and returns them as a list. This works so far.</p>
  
  <pre><code>fun hanoi(0,start,ziel) = []
    | hanoi(1,start,ziel) = [(1,start,ziel)]
    | hanoi(anz,start,ziel) = hanoi(anz-1,start,hilf(start,ziel)) 
                     @ ((anz,start,ziel)::hanoi(anz-1,hilf(start,ziel),ziel))
  and hilf(start,ziel) = 6-(start+ziel);
  </code></pre>
  
  <p>Now my question is how can I check for the last pattern in which start and the goal (german: ziel) is the same? I tried something like this:</p>
  
  <pre><code>|hanoi(anz,start,ziel=start) = []
  </code></pre>
  
  <p>but it did not work. Seems like I am having problems understanding the concept of pattern matching fully. But I couldn't find much helpful ressources. </p>
  
  <p>Thanks in advance!</p>