mager-bench
← all challenges

fizzbuzz

Classic FizzBuzz — tests basic correctness and code style

the prompt

$ cat fizzbuzz.prompt
Write a Python function `fizzbuzz(n: int) -> list[str]` that returns a list of strings for numbers 1 through n: 'Fizz' for multiples of 3, 'Buzz' for multiples of 5, 'FizzBuzz' for multiples of both, and the number as a string otherwise. Include a docstring and at least one usage example.

rubric

correctness

Does the function handle all four cases correctly? Does it return a list?

quality

Is the code clean, idiomatic Python? Good variable names? No unnecessary complexity?

documentation

Is there a clear docstring? Is there a usage example?

results

Claude Sonnet 4.6

9.7
correctness 10.0quality 9.0documentation 10.013689ms

# Correct, clean, idiomatic implementation with thorough docstring, doctest-style examples, sensible input validation, and helpful usage demos, though extra validation exceeds task scope slightly.

inspect full trace →

Claude Haiku 4.5

9.7
correctness 10.0quality 9.0documentation 10.06422ms

# Correct, clean, idiomatic implementation with clear docstring, doctest-style example, and extra usage demonstrations, though the docstring output formatting isn't a valid doctest due to line wrapping.

inspect full trace →

Llama 3.3 70B

9.7
correctness 10.0quality 9.0documentation 10.01262ms

# Correct, clean implementation with clear docstring, doctest example, and additional demo block.

inspect full trace →

Gemini 2.5 Flash

9.7
correctness 10.0quality 9.0documentation 10.04723ms

# Correct, clean, well-documented implementation with thorough examples and sensible edge-case handling, only minor nit being the added ValueError not explicitly required by the task.

inspect full trace →

GPT-OSS 120B

8.0
correctness 9.0quality 8.0documentation 7.01640ms

# Logic is correct and well-commented, but the docstring's multi-line example is not valid doctest syntax (missing continuation markers), which would break if run as a doctest.

inspect full trace →