Okay Jow Forums how smart are you?

okay Jow Forums how smart are you?
do fizzbuzz for for 3 and 5.
rules: you cant use modulus operator and you cant use if/else statements or switch statements.

Attached: Screen Shot 2018-06-14 at 20.12.29.png (344x138, 10K)

10 3 fizz
20 5 buzz
30 goto 10

>20 year old boomer who doesn't know how to program
>thinks he'll seem smart to Jow Forums if he jumps on the whiteboard meme
>uhhhh do a fizzbuzz but don't actually do a fizzbuzz!

Attached: 20180614_151515.jpg (380x348, 41K)

triggered

Attached: 1528344709333.gif (640x360, 2.72M)

>you cant use modulus operator and you cant use if/else statements or switch statements.
Easy peasy

select = (a, b, c) => a + b || c

cycler = (v) => () => {
v.push(v.shift());
return v[v.length - 1];
};

fizz = cycler(['','','Fizz'])
buzz = cycler(['','','','','Buzz'])

Array.from({length: 100}, (_, i) => print(select(fizz(), buzz(), i + 1)))

for(int i = 1, three = 1, five = 1; i

sure

fn main() {
(0..5).for_each(|i| {
println!("{}", i*15+1);
println!("{}", i*15+2);
println!("fizz");
println!("{}", i*15+4);
println!("buzz");
println!("fizz");
println!("{}", i*15+7);
println!("{}", i*15+8);
println!("fizz");
println!("buzz");
println!("{}", i*15+11);
println!("fizz");
println!("{}", i*15+13);
println!("{}", i*15+14);
println!("fizzbuzz");
});
}

Attached: shrug01.jpg (255x256, 19K)

fizz = cycle ["fizz", "", ""]
buzz = cycle ["buzz", "", "", "", ""]
nums = map show [1..]
z = zipWith
fb = z max nums (z (++) fizz buzz)

op = (fb !! 3, fb !! 5)

public class FizzBuzz {
public static void fizzBuzz(int n) {
fizzBuzz1(1, n);
}

private static void fizzBuzz1(int i, int n) {
System.out.println(i);
for (; i < n;) {
fizzBuzz2(++i, n);
break;
}
}

private static void fizzBuzz2(int i, int n) {
System.out.println(i);
for (; i < n;) {
fizzBuzz3(++i, n);
break;
}
}

private static void fizzBuzz3(int i, int n) {
System.out.println("Fizz");
for (; i < n;) {
fizzBuzz4(++i, n);
break;
}
}

private static void fizzBuzz4(int i, int n) {
System.out.println(i);
for (; i < n;) {
fizzBuzz5(++i, n);
break;
}
}

private static void fizzBuzz5(int i, int n) {
System.out.println("Buzz");
for (; i < n;) {
fizzBuzz6(++i, n);
break;
}
}

//...

private static void fizzBuzz15(int i, int n) {
System.out.println("FizzBuzz");
for (; i < n;) {
fizzBuzz1(++i, n);
break;
}
}
}

#!/bin/bash

fizzbuzz=({1..100})
for ((i=3;i

int i = 1;
while (true)
{
println(i);
println(i + 1);
println("Fizz");
println(i + 3);
println("Buzz");
println("Fizz");
println(i + 6);
println(i + 7);
println("Fizz");
println("Buzz");
println(i + 10);
println("Fizz");
println(i + 12);
println(i + 13);
println("Fizzbuzz");
}

lmao

fuck your rules
function fizzbuzz(number): any {
let cnt = 1;
const array: Array = [];
while (cnt

cute

cheeky

fuck forgot to increment i by 15

fizz = cycle ["","","Fizz"]
buzz = cycle ["","","","","Buzz"]
nums = map show [1..]
fb = zipWith3 ((max .) . (++)) fizz buzz nums

nice max trick

U MENA HASKAL?
import Data.Monoid (())
import Data.Maybe (fromMaybe)


mkStream :: Int -> a -> [Maybe a]
mkStream n x = cycle $ replicate (n - 1) Nothing ++ [Just x]

fizz :: [Maybe String]
fizz = mkStream 3 "Fizz"

buzz :: [Maybe String]
buzz = mkStream 5 "Buzz"


fizzbuzz :: [String]
fizzbuzz = zipWith fromMaybe numbers fbs
where
numbers = map show [1..]
fbs = zipWith () fizz buzz

oh that's a nice one.

But () is in Prelude now

Attached: file.png (268x106, 6K)

Posting from phone so enjoy shitty formatting:
#include
using namespace std;

int main() {
int end;
bool p;
coutend;

for(int i=1; i

>import Data.Maybe (fromMaybe)
>all those type annotations
>using $ instead of parens
All bloat.

fromMaybe n = maybe n id

Did you misquote? I used max here .

oh, I wasn't aware. I haven't touched HASKAL in a couple of years now, unfortunately

>all those type annotations
HASKAL surely has to deal with degenerates like yourself, by not making type annotations mandatory

tbqh, Haskell should make pointfree style mandatory.

Hindley-Milner exists though. The compiler literally does it even if I don't.

Attached: 1514920750407s.jpg (124x124, 3K)

>using $ instead of parens
$ is objectively better than parens, btw, because it resembles the AST better

sure, but the way haskell does it is sub-optimal

f x -> App (Name f) (Name x)
f $ x -> App (App (Name $) (Name f)) (Name x)

Hmmmmmmmm.

>f x
where are the parens? also, are you mentally retarded?

Fuck these threads.

what language is that?

english

Here's in infinite sequence of Fizz Buzz using none of your banned features.

(map #(or %1 %2)
(cycle [nil nil "Fizz" nil "Buzz" "Fizz" nil nil "Fizz" "Buzz" nil "Fizz" nil nil "FizzBuzz"])
(iterate inc 1))

oy vey the goyim knows shut him down

I'm tired so probably more complex than it needs to be.

(reduce (fn [_ x]
(println (clojure.string/join
(or (not-empty (filter identity [(and (integer? (/ x 3)) "fizz")
(and (integer? (/ x 5)) "buzz")]))
[x])))) [] (range 1 101))


Welp.

based

It's not necessary to enumerate all fifteen options by hand, and it's definitely weird to have side effects inside a reducing function.

Here's a slightly shorter version that has none of those quirks.

(map #(if (empty? %1) %2 %1)
(map str (cycle [nil nil "Fizz"]) (cycle [nil nil nil nil "Buzz"]))
(iterate inc 1))

#include

int main() {
unsigned int m = 0x30490610;
char* s = "%d\n\0 Fizz\n\0 Buzz\n\0 FizzBuzz\n";

for (int i = 1; i 2;
}

return 0;
}

meme_answer_replacing_if_else_with_while_loops.png

>30 goto 10
>103 fizz
>205 buzz

Undefined line error.

Well, it's easy to read and it respects the constraints.

Python

x = ["" for i in range(100)]
y = [3,5,15]
f = ["fizz","buzz","fizzbuzz"]
for i in range(3):
for j in range(100//y[i]):
x[(j+1)*y[i]-1] = f[i]

print(x)

why do boomers drink monster? ain’t they supposed to drink hard liquor or at least beer?

This is fucking obvious
just make a for loop with 15 print statements, and make 8 of the statements print 15*i + k, where i is the for loop variable, and k is based on the particular print statement, and make 4 of the print statements print "Fizz," make 2 of the print statements print "Buzz," and the last statement print "Fizz Buzz."

But if you're supposed to only run it until a certain value that's not divisible by 15, you're going to go past it. Aren't you supposed to check to make sure that you didn't exceed this limit value on every print statement with this method?

Attached: asdf.jpg (596x247, 43K)

Javascript
for(var i=0;i++