Skip to main content
Replace strings with symbols
Source Link
Winny
  • 1.1k
  • 9
  • 17

Racket, 125125 122 bytes

(for([x(range 1 101)])(define(m n)(=(modulo x n)0))(displayln(cond[(and(m 3)(m 5))"FizzBuzz"]['FizzBuzz][(m 3)"Fizz"]['Fizz][(m 5)"Buzz"][x]'Buzz][x])))

Simplest approach, took some work to get it lower than 130 bytes. Inspired by the Java example.

Pretty-printed code

(for ([x (range 1 101)])
  (define (m n)
    (= (modulo x n) 0))
  (displayln (cond
               [(and (m 3) (m 5)) "FizzBuzz"]'FizzBuzz]
               [(m 3) "Fizz"]'Fizz]
               [(m 5) "Buzz"]'Buzz]
               [x])))

Racket, 125 bytes

(for([x(range 1 101)])(define(m n)(=(modulo x n)0))(displayln(cond[(and(m 3)(m 5))"FizzBuzz"][(m 3)"Fizz"][(m 5)"Buzz"][x])))

Simplest approach, took some work to get it lower than 130 bytes. Inspired by the Java example.

Pretty-printed code

(for ([x (range 1 101)])
  (define (m n)
    (= (modulo x n) 0))
  (displayln (cond
               [(and (m 3) (m 5)) "FizzBuzz"]
               [(m 3) "Fizz"]
               [(m 5) "Buzz"]
               [x])))

Racket, 125 122 bytes

(for([x(range 1 101)])(define(m n)(=(modulo x n)0))(displayln(cond[(and(m 3)(m 5))'FizzBuzz][(m 3)'Fizz][(m 5)'Buzz][x])))

Simplest approach, took some work to get it lower than 130 bytes. Inspired by the Java example.

Pretty-printed code

(for ([x (range 1 101)])
  (define (m n)
    (= (modulo x n) 0))
  (displayln (cond
               [(and (m 3) (m 5)) 'FizzBuzz]
               [(m 3) 'Fizz]
               [(m 5) 'Buzz]
               [x])))
Source Link
Winny
  • 1.1k
  • 9
  • 17

Racket, 125 bytes

(for([x(range 1 101)])(define(m n)(=(modulo x n)0))(displayln(cond[(and(m 3)(m 5))"FizzBuzz"][(m 3)"Fizz"][(m 5)"Buzz"][x])))

Simplest approach, took some work to get it lower than 130 bytes. Inspired by the Java example.

Pretty-printed code

(for ([x (range 1 101)])
  (define (m n)
    (= (modulo x n) 0))
  (displayln (cond
               [(and (m 3) (m 5)) "FizzBuzz"]
               [(m 3) "Fizz"]
               [(m 5) "Buzz"]
               [x])))