Skip to content

Instantly share code, notes, and snippets.

@astail
Created November 9, 2015 06:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astail/678146dbfed9df91bbd4 to your computer and use it in GitHub Desktop.
Save astail/678146dbfed9df91bbd4 to your computer and use it in GitHub Desktop.
object Fibonacci {
def main(args: Array[String]): Unit = {
fibonacci
}
var x=0
var y=1
def fibonacci= {
var i = 0
while(i < 15) {
println(i + ":" + x)
x=x+y
y=x-y
i += 1
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment