Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created January 30, 2015 14:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shigemk2/c34e08ee0e72a0009b88 to your computer and use it in GitHub Desktop.
Save shigemk2/c34e08ee0e72a0009b88 to your computer and use it in GitHub Desktop.
for (i <- 1 to 2; j <- 1 to 2) println(s"i = $i, j = $j")
for {
i <- 1 to 1
j <- 1 to 2
k <- 1 to 3
} println(s"i = $i, j = $j, k = $k")
val array = Array.ofDim[Int](2,2)
for {
i <- 0 to 1
j <- 0 to 1
} println(s"($i)($j) = ${array(i)(j)}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment