Write a fizzbuzz implementation in Scala
- User
Write a fizzbuzz implementation in Scala
Assistant
def fizzbuzz(n: Int): Unit = { for (i <- 1 to n) { val str = i % 3 match { case 0 => "Fizz" case _ => "" } val str2 = i % 5 match { case 0 => "Buzz" case _ => "" } println(str + str2 + i) } }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.