title: Scala return boolean with if else
body: <p>So I have to following scenario:</p>
  
  <pre><code> def check(): Boolean = {
      for ((digit1,digit2,digit3) &lt;- SetOfDigits){
        if ((1,2,5) == (digit1,digit2,digit3))
          true
        else
          false
  }
    }
  
  val SetOfDigits = Set((0,2,3),(1,5,6),(7,10,2),(1,2,5))
  </code></pre>
  
  <p>Now the problem is that the function has to return a Boolean but it always tells me that the return type here is <code>Unit</code>? 
  The function should iterate over the <code>SetOfDigits</code> and if it finds something equal like <code>(1,2,5)</code> it should return true else false?
  Has anybody an answer to this problem and what I have to do in order to get it working?</p>