Skip to main content
added 269 characters in body
Source Link

Julia, 87 Bytes

for i in 1:100;println(i%3<1 ? "Fizz"*(i%5<1 ? "Buzz" : "") : (i%5<1 ? "Buzz" : i));end

More readable:

for i in 1:100
    if i%3 < 1
        print("Fizz")
        if i%5 < 1
            println("Buzz")
        else
            println()
        end
    elseif i%5 < 1
        println("Buzz")
    else
        println(i)
    end
end

Not sure if there's already a Julia submission here. Also my first time golfing c:

Indirect thanks to @Najkin because I saw their reply to a C# submission saying that you can use <1 instead of ==0 and that helped me save 3 bytes over my previous 90-byte solution!

BTW if you see any "unnecessary" spaces, they're actually necessary as Julia would throw a syntax error without them. (Why?!)

Julia, 87 Bytes

for i in 1:100;println(i%3<1 ? "Fizz"*(i%5<1 ? "Buzz" : "") : (i%5<1 ? "Buzz" : i));end

Not sure if there's already a Julia submission here. Also my first time golfing c:

Indirect thanks to @Najkin because I saw their reply to a C# submission saying that you can use <1 instead of ==0 and that helped me save 3 bytes over my previous 90-byte solution!

BTW if you see any "unnecessary" spaces, they're actually necessary as Julia would throw a syntax error without them. (Why?!)

Julia, 87 Bytes

for i in 1:100;println(i%3<1 ? "Fizz"*(i%5<1 ? "Buzz" : "") : (i%5<1 ? "Buzz" : i));end

More readable:

for i in 1:100
    if i%3 < 1
        print("Fizz")
        if i%5 < 1
            println("Buzz")
        else
            println()
        end
    elseif i%5 < 1
        println("Buzz")
    else
        println(i)
    end
end

Not sure if there's already a Julia submission here. Also my first time golfing c:

Indirect thanks to @Najkin because I saw their reply to a C# submission saying that you can use <1 instead of ==0 and that helped me save 3 bytes over my previous 90-byte solution!

BTW if you see any "unnecessary" spaces, they're actually necessary as Julia would throw a syntax error without them. (Why?!)

Source Link

Julia, 87 Bytes

for i in 1:100;println(i%3<1 ? "Fizz"*(i%5<1 ? "Buzz" : "") : (i%5<1 ? "Buzz" : i));end

Not sure if there's already a Julia submission here. Also my first time golfing c:

Indirect thanks to @Najkin because I saw their reply to a C# submission saying that you can use <1 instead of ==0 and that helped me save 3 bytes over my previous 90-byte solution!

BTW if you see any "unnecessary" spaces, they're actually necessary as Julia would throw a syntax error without them. (Why?!)