https://github.com/program-in-chinese/Programming_in_Scala_study_notes_zh
节选
def 创建行序列(行: Int) =
for (列 <- 1 to 10) yield {
val 乘积 = (行 * 列).toString
val 缩进 = " " * (4 - 乘积.length)
缩进 + 乘积
}
def 创建行(行: Int) = 创建行序列(行).mkString
def 乘法表() = {
val 表序列 =
for (行 <- 1 to 10)
yield 创建行(行)
表序列.mkString("\n")
}