Well, Sup Forums?

Well, Sup Forums?

Good, efficient, optimized, non-pajeet code you got there user

PICK ONE, FAGET!

I have no idea, they're both just so fucking good

> javascript

>animu

>clean, structured, understandable and easily maintainable code
VS
>that fucking mess

>right
If someone gave me that obtuse, resource-intensive, "I'm so clever" shit I'd end the interview on the spot.

Is there a way to do fizzbuzz without modulus operation?

What color scheme is that?

Also, left.

std::to_string((double)a / 15).find(".") != std::string::npos

>modulo
neck yourself my man you don't belong here

this, a thousand times. Complex and compact code is just dick measuring without any real application in the real world. It's literally garbage.

By writing your own modulus operation.

>on an anime website
shit who would have thought

I would do it like this:

if statement with modulus % 3
-if true, then try modulus % 5
--if true print "FizzBuzz"
--else print "Fizz"
if statement with modulus % 5
-if true print "Buzz"
-else do nothing

Am I wrong for choosing this structure?

int fizz = 3;
int buzz = 5;
for(int i = 1; i < = N; ++i) {
fizz--;
buzz--;
if (fizz == 0 && buzz == 0)
{
outp = "FizzBuzz";
fizz = 3;
buzz = 5;
}
else if (fizz == 0)
{
outp = "Fizz";
fizz = 3;
}
else if (buzz == 0)
{
outp = "Buzz";
buzz = 5;
} else {
outp = i.ToString();
}
result += outp + ", ";
}

> using reduce on inherently sequential problem
> harder to read with no benefit to speed

No, it'lll work, but you can do it with fewer statements.

Bit masking is the better solution.

Even less? How so? I might be stupid but I don't see how one can further shorten this script.

var fb_base_arr = [1, 2, 'Fizz', 4, 'Buzz', 'Fizz', 7, 8, 'Fizz', 'Buzz', 11, 'Fizz', 13, 14, 'Fizz Buzz'];
var fb_arr = fb_base_arr;
for (let i = 15; i < N; i += 15)
fb_arr = fb_arr.concat(fb_base_arr.map((v, k) =>
(Number.isInteger(v))? v+i : v
));
fb_arr.join(', ');

>weeaboos actually believe this
Just stick to your containment boards, neckbeard.

whiles

>not knowing the site was founded on fucking anime
You need to go back

>tries to do functional fizzbuzz
>makes it more complex than the traditional solution somehow
>makes it stateful somehow

Absolutely disgusting.

Whats wrong with right? It seems most efficient.

it sucks
IT IS FUCKING 15 FFS, triggered every time :)
you do few unneeded checks when you do that, so pajeet tier if you ask me

also right one is much better, but could be optimized further

Just do
function FizzBuzz(n: Integer): String;
begin
Result := '';
while (n > 0) do
begin
if (n mod 3 = 0) then
if (n mod 5 = 0) then
Result := 'Fizz Buzz' + Result
else Result := 'Fizz' + Result
else if (n mod 5 = 0) then
Result := 'Buzz' + Result
else Result := IntToStr(n) + Result;

if n > 1 then Result := ', ' + Result;
Dec(n)
end
end;

...

...

...

readability > speed

almost always

I think the first one might even be faster