In Scala, you often use an iterator to do a for loop in an increasing order like:
for
for(i <- 1 to 10){ code }
How would you d
Having programmed in Pascal, I find this definition nice to use:
implicit class RichInt(val value: Int) extends AnyVal { def downto (n: Int) = value to n by -1 def downtil (n: Int) = value until n by -1 }
Used this way:
for (i <- 10 downto 0) println(i)