FizzBuzz obscure edition

Alright Sup Forums, FizzBuzz time!

"Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”."

Use your language of choice - extra points for obscure ones.

To start it off I give you Self.

x: 0.
[x < 100] whileTrue: [
x: x + 1.
((x % 3) = 0) ifTrue: ['Fizz' print].
((x % 5) = 0) ifTrue: ['Buzz' print].
(((x % 3) != 0) && ((x % 5) != 0)) ifTrue: [x print].
'\n' print.
]

What is "fizzbuzz"?

In action. This assumes your object has a mutable slot named 'x' and prints into the terminal that runs Self VM.

The "Fizz-Buzz test" is an interview question designed to help filter out the 99.5% of programming job candidates who can't seem to program their way out of a wet paper bag. The question is included in OP.

Bumping with Bash.

#!/bin/bash

for i in {1..100}; do
n=$( ((i%3==0)) && printf fizz )$( ((i%5==0)) && printf buzz )
[ -z "$n" ] && echo $i || echo $n
done

It's the end of all means in programming. In the end all of programming boils down into a fizzbuzz.

it's a Sup Forums meme and probably the only thing the 'programmers' here can code. welcome to Sup Forums, you'll see this thread multiple times a day. it's full of people circlejerking over the fact that they can write (or copy&paste) a simple program.

Less shaming, moar fizzbuzz.

C in one line

for(int i = 1; i

Ruby reporting in, is that obscure enough for you, OP?

# cheeky one-liner
p (1..100).map{|i| (i%15).zero?? "FizzBuzz":(i%3).zero?? "Fizz":(i%5).zero?? "Buzz": i}


# "obscure edition": with distinct rows
result = []
fizz = *(3..100).step(3)
buzz = *(5..100).step(5)
fizz_buzz = fizz & buzz

rest = Array(1..100) - fizz - buzz
fizz -= fizz_buzz
buzz -= fizz_buzz

f,b,fb,r = fizz.shift, buzz.shift, fizz_buzz.shift, rest.shift

until fizz.empty? and buzz.empty? and fizz_buzz.empty? and rest.empty?
case [f,b,fb,r].compact.min
when f then result

for (i in 1:100) {
print(
paste(rep("Fizz",((is.finite(sum(i%%3, 1/(i%%3), na.rm=TRUE) %% 1) == FALSE) * 1)),
rep("Buzz",((is.finite(sum(i%%5, 1/(i%%5), na.rm=TRUE) %% 1) == FALSE) * 1)),
rep(i,(((is.finite(sum(i%%3, 1/(i%%3), na.rm=TRUE) %% 1) == TRUE) &
(is.finite(sum(i%%5, 1/(i%%5), na.rm=TRUE) %% 1) == TRUE)) * 1)),
collapse='', sep=""),quote=FALSE)
}

Deliberately odd.

Madatory:

for i in range(1,101):
print("FizzBuzz"[i*i%3*4:8--i**4%5] or i)

Even if the language isn't, the way it's done sure is.

>bash
kek

What of it?

So this may not be the sexiest code, but what it does is pretty interesting imo. During compile time, it automatically generates the code to do a naive implementation of fizzbuzz. As a result, the solution binary technically uses no loops.
import std.stdio;
import std.conv;

string fizzbuzz()
{
auto code = "auto fizzbuzz = \"";
foreach (i; 1..101)
{
auto fizz = i % 3 == 0;
auto buzz = i % 5 == 0;
if (fizz && buzz) code ~= "fizzbuzz";
else if (fizz) code ~= "fizz";
else if (buzz) code ~= "buzz";
else code ~= to!string(i);
code ~= "\n";
}
code ~= "\";";
return code;
}

void main()
{
mixin(fizzbuzz());
writeln(fizzbuzz);
}

public void fizzBuzz(){
for(int i=1; i

Or rather, it generates the solution to fizzbuzz as a string during compile time, and the executable only prints the string.

Wrote this on my phone, it's just the method.

An elegant solution written in an elegant language:

for ((n=0; n

...

kek this wins.

nothing senpai :^)