title: Generate a sequence of Fibonacci number in Scala
body: <pre>
  <code>
    def fibSeq(n: Int): List[Int] = {
      var ret = scala.collection.mutable.ListBuffer[Int](1, 2)
      while (ret(ret.length - 1) &lt; n) {
        val temp = ret(ret.length - 1) + ret(ret.length - 2)
        if (temp &gt;= n) {
          return ret.toList
        }
        ret += temp
      }
      ret.toList
    }
  </code>
  </pre>
  
  <p>So the above is my code to generate a Fibonacci sequence using Scala to a value <code>n</code>.  I am wondering if there is a more elegant way to do this in Scala?</p>