PageRenderTime 42ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/examples/fizzbuzz.scala

https://github.com/behnam/sfntly-layout
Scala | 9 lines | 9 code | 0 blank | 0 comment | 0 complexity | cee4a2e80b416dd173eb55140d942cf7 MD5 | raw file
  1. import net.maniacchef.sfntly.layout.Gsub
  2. Gsub("ubuntu-mono.ttf").contextualAlternate {
  3. List.range(1, 101).map { i => ((i % 3), (i % 5)) match {
  4. case (0, 0) => (i.toString -> "FizzBuzz")
  5. case (0, _) => (i.toString -> "Fizz")
  6. case (_, 0) => (i.toString -> "Buzz")
  7. case _ => Unit
  8. }}
  9. }.done("ubuntu-mono-fizzbuzz.ttf")