Brainlet test

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

BUT, there's a catch: you are not allowed to use any of the banned operators listed below, and you are also not allowed to use any function invocations or macros (save for any function that writes to the output i.e. print(), console.log() etc.).

Banned operators:
+
+=
++preincrement
postincrement++
%
%=
<

Attached: 1520873495108.jpg (611x560, 60K)

Other urls found in this thread:

github.com/Kikebook/fbos
twitter.com/NSFWRedditVideo

Only brainlets post in fizzbuzz threads.

like you

Attached: ekrmit.jpg (511x513, 49K)

Attached: 1515431022619s.jpg (249x238, 10K)

1+3

print("1\n2\nFizz\n4\nBuzz\nFizz...");
... and so on. Do I win?

console.log(`1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
16
17
Fizz
19
Buzz
Fizz
22
23
Fizz
Buzz
26
Fizz
28
29
FizzBuzz
31
32
Fizz
34
Buzz
Fizz
37
38
Fizz
Buzz
41
Fizz
43
44
FizzBuzz
46
47
Fizz
49
Buzz
Fizz
52
53
Fizz
Buzz
56
Fizz
58
59
FizzBuzz
61
62
Fizz
64
Buzz
Fizz
67
68
Fizz
Buzz
71
Fizz
73
74
FizzBuzz
76
77
Fizz
79
Buzz
Fizz
82
83
Fizz
Buzz
86
Fizz
88
89
FizzBuzz
91
92
Fizz
94
Buzz
Fizz
97
98
Fizz`);

>you can't use any function that writes to output.
What did he mean by this?

Brainlet detected

this is easy with bit manipulation.

for each number 1-100
if (multiple of 3) print fizz
if (multiple of 5) print buzz
if (multiple of 3 and 5) print fizzbuzz
otherwise (just print number)

Are you mentally handicaped?

Perfect.

lmao

>print

module Main where

main :: IO ()
main = printAll $ map fizzBuzz [1..100]
where
printAll [] = return ()
printAll (x:xs) = putStrLn x >> printAll xs

fizzBuzz :: Integer -> String
fizzBuzz n | n `mod` 15 == 0 = "FizzBuzz"
| n `mod` 5 == 0 = "Fizz"
| n `mod` 3 == 0 = "Buzz"
| otherwise = show n


Learn a real language, brainlet

#include

int main(void)
{
int i;
int fizz_counter = 0;
int buzz_counter = 0;

for (i = 1; !(i > 100); i -= -1) {
int print_num = 1;

fizz_counter = fizz_counter - -1;
buzz_counter = buzz_counter - -1;

if (fizz_counter == 3) {
printf("Fizz");
fizz_counter = 0;
print_num = 0;
}

if (buzz_counter == 5) {
printf("Buzz");
buzz_counter = 0;
print_num = 0;
}

if (print_num) {
printf("%d", i);
}

putchar('\n');
}

return 0;
}

(for n 1 100
(prn:case (gcd n 15)
1 n
3 'Fizz
5 'Buzz
'FizzBuzz))

>hasklel

:(

var i = ~-1
while (-(i = -~i) > ~99) {
console.log((i - (i / 3 & 127) * 3 ? '' : 'Fizz') + (i - (i / 5 & 127) * 5 ? '' : 'Buzz') || i)
}

nice. heres my solution:
fn main() =
fizzbuzz(3, "fizz", 5, "buzz", 1, 100)

use
mapM_ (putStrLn . fizzBuzz) [1..100]

>not banning - or -=
>not banning > or >=
wow great challenge friend

from fizzbuzz import fizzbuzz
fizzbuzz(100)

Nice use of the + operator :^)

#!/bin/bash
for i in {1..100}
do
if ! (($i % 3))
then
echo $i "Fizz"
elif ! (($i % 5))
then
echo $i "Buzz"
else
echo $i
fi
done

unset i
for i in {1..100}
do
echo "OP is a faggot."
done

a = []
for(var b=0; b>-100; b=b-1) {
a.push(-b*3)
}
c = []
for(var d=0; d>-100; d=d-1) {
c.push(-d*5)
}
for(var h=-1; h>-101; h=h-1) {
if(a.indexOf(-h) > -1 && c.indexOf(-h) > -1)
{
console.log("FizzBuzz")
}
else if(a.indexOf(-h) > -1)
{
console.log("Fizz")
}
else if(c.indexOf(-h) > -1)
{
console.log("Buzz")
}
else console.log(-h)
}

To be fair I nicked that from some wiki somewhere. That's definitely a better way to start.

Maybe I'll post a nicer Haskell one when I get home.

#include
int main()
{
for(int i = 0; 101 > i; i -= -1){
bool fizz, buzz;
int tmp = i;
while(tmp > 0)
tmp -= 3;
fizz = tmp;
tmp = i;
while(tmp > 0)
tmp -= 5;
buzz = tmp;
if(!fizz)
std::cout

>freetard can't actually complete the challenge with his meme OS
color me surprised

run it faggot

If you're referring to the lack of code box, I never bothered to look it up.

>writes in visual basic
hurr durr, bash doesn't work

you're not supposed to use %

your brain doesn't work

```c
#include

int main()
{
int n = 100;
int k = 0;
while (n--)
{
k = 100 - n;
if ((float)k / 15 == (int)k / 15)
puts("FizzBuzz");
if ((float)k / 5 == (int)k / 5)
puts("Buzz");
if ((float)k / 3 == (int)k / 3)
puts("Fizz");
else
printf("%i\n", k);
}
}
```

This was fun.

root@server [~]# for i in {x..z}; do read -p 'Enter '$i': ' $i; done;[[ $x = 0 ]] && echo "true" || echo "false";[[ $y = 1 ]] && echo "true" || echo "false" ; [[ $z = 2 ]] && echo "true" || echo "tralse"
Enter x: 0
Enter y: 1
Enter z: 2
true
true
true

root@server [~]# for i in {x..z}; do read -p 'Enter '$i': ' $i; done;[[ $x = 0 ]] && echo "true" || echo "false";[[ $y = 1 ]] && echo "true" || echo "false" ; [[ $z = 2 ]] && echo "true" || echo "tralse"
Enter x: 0
Enter y: 2
Enter z: 3
true
false
tralse

Bash doesn't calculate anything other than integers without additional packages. % is the only way to do it.

>banned operators

Attached: 1477607938439.jpg (541x604, 61K)

fuck this shit I just wanna build pretty websites

No it's not. See

That's not bash dipshit.

That's just an example of a way of doing it which doesn't require % and doesn't require division, which you could easily implement in bash.

Easy.
#include
#include
#include
int main(void) {
char buf[414];
void* p = mmap(NULL, 209, PROT_EXEC | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
memcpy(p, (char[]) {
-71,1,0,0,0,69,49,-64,49,-10,65,-70,-51,-52,-52,-52,-21,83,102,15,31,68,0,0,
65,-125,-8,5,15,-124,-98,0,0,0,-119,-56,65,-119,-53,76,-115,79,1,65,-9,-30,-63,-22,
3,-115,4,-110,1,-64,65,41,-61,-123,-46,68,-119,-40,76,-115,95,2,116,108,-125,-62,48,72,
-125,-57,3,-120,87,-3,76,-119,-54,77,-119,-39,-125,-64,48,-120,2,-125,-63,1,65,-58,1,10,
-125,-7,101,116,59,-125,-58,1,65,-125,-64,1,-125,-2,3,117,-89,49,-10,65,-125,-8,5,-57,
7,70,105,122,122,72,-115,71,4,117,69,76,-115,72,4,-125,-63,1,69,49,-64,-125,-7,101,
-57,0,66,117,122,122,72,-115,120,5,65,-58,1,10,117,-59,65,-58,65,1,0,-61,102,46,
15,31,-124,0,0,0,0,0,72,-119,-6,76,-119,-33,-21,-100,15,31,-124,0,0,0,0,0,
72,-119,-8,-21,-66,15,31,0,72,-125,-57,5,73,-119,-63,-21,-120,
}, 209);
((void (*) (char*)) p)(buf);
fwrite(buf, 1, 413, stdout);
}

You have a point, but I'm entirely too lazy to implement such a thing.

>can't use modulus
Guess I'm going to be an eternal brainlet. This is a piece of cake with %.

public class FizzBuzz (String[] args){
int i = 1;
while (100 >= i) {
if ((i/3)*3 == i) {
if ((i/5)*5 == i)
System.out.println("FizzBuzz");
else
System.out.println("Fizz");
}
else if ((i/5)*5 == i)
System.out.println("Buzz");
else
System.out.println(i);
i = i+1;
}
}

/thread

Attached: 1511423305313.png (800x800, 84K)

>tralse
wtf?

Here you go
github.com/Kikebook/fbos

public class FizzBuzz (String[] args){
int i = 1;
while (100 >= i) {
if ((i/3)*3 == i) {
if ((i/5)*5 == i)
System.out.println("FizzBuzz");
else
System.out.println("Fizz");
}
else if ((i/5)*5 == i)
System.out.println("Buzz");
else
System.out.println(i);
i = i-(-1);
}
}

$ python3 -c "import fzzbzz; fzzbzz(100)"When do I start?

Am I a brainlet or are you guys the brainlets?

Just compute the module yourslef?

number%3 == number - ((number/3)*3)

>Java
>Requiring this much bloat for a mere FizzBuzz

Write a less bloated version in Java then nigger

>I said requiring this much bloat (Java) for me mere FizzBuzz.
>Continues to tell me to write less bloated version in java

OP hasn't banned any language

Besides I didn't continue to tell you to write a less bloated program, I only said it once retard, learn to read

Are you mentally handicapped? Did I ever claim he did? I said it's unsightly and disgusting, that's all.

>bans =
kek
written in poo:
for (int i = 0; i

Attached: azurew.png (1111x597, 520K)

fizz = ["","","Fizz","","Buzz","Fizz","","","Fizz","Buzz","","Fizz","","","FizzBuzz"]*7
for x in range(1,101):
print(fizz[x-1] or x)

Continue doesn't imply that you've said it before you mong.

>I said it's unsightly and disgusting
No you didn't, do you have Alzheimer's disease?

Are you actually incapable of interpreting language and comprehend the meaning and intention?

>for (int i = 0; i failed the no increment++
dropped

I did it only for an instant, so I didn't continue

Attached: Screenshot_2018-04-07-02-47-06-1.png (1440x655, 76K)

No

>Post crap unformatted poo code
>Gets answer
>Replies to answer
>Didn't continue anything

number == number/3*3

I didn't continue telling you to write a less bloated version

It's a saying you daft cunt
>Continues posting
>Continues on with his day and tell me ...

also failed no

t. 75 IQ lincuck

suuure

for i in {1..100}
do
multt[${i}]=$((3*$i))
done
for i in {1..100}
do
multf[${i}]=$((5*$i))
done
for i in {1..100}
do
is_fizz=false
is_buzz=false
for j in {1..100}
do
if [ $i -eq ${multt[$j]} ]
then
is_fizz=true
fi
done
for j in {1..100}
do
if [ $i -eq ${multf[$j]} ]
then
is_buzz=true
fi
done
if [[ "$is_fizz" = true ]] && [[ "$is_buzz" = true ]]
then
echo "FizzBuzz"
elif [ "$is_fizz" = true ]
then
echo "Fizz"
elif [ "$is_buzz" = true ]
then
echo "Buzz"
else
echo $i
fi
done

not even lintards know how to use their shitty 70s command line

Attached: 1512408850534.png (645x614, 89K)

The fact of the matter is that I didn't persist in telling you to write a less bloated version of my program so you're objectively wrong

>Write a less bloated version in Java then nigger

>for you
class Main {
public static void main(String[] args) {
boolean fizz=false;
boolean buzz=false;
for(int i = 100; i>0; i = i - 1){
int x = 101 - i;
double x3 = x/3.0;
double x5 = x/5.0;

fizz=false;
buzz=false;

if(x3==x/3)
fizz = true;
if(x5==x/5)
buzz = true;

if(fizz&&buzz)
print("FizzBuzz");
else if (fizz)
print("Fizz");
else if (buzz)
print("Buzz");
else
print(x);


}
}
public static void print(Object o){
System.out.println(o);
}
}

I did that only once, I didn't persist in doing it so I didn't continue

I'm convinced. You're actually retarded and can't retain information for more than 5 minutes.

>I was just pretending to be retarded XD

two lines

Attached: Screen Shot 2018-04-06 at 8.07.58 PM.png (1607x1062, 170K)

what's the point of using ternary operators like that when you aren't using the resulting values? Might as well just write out a bunch of regular ifs and squeeze them onto one line. Also you're using a bunch of the operators the OP says you aren't allowed to use.

Arithmetic operators are for losers

int main() {
const char digits[] = "0123456789";
const char* const words[] = {
0, 0, "Fizz", 0, "Buzz",
"Fizz", 0, 0, "Fizz", "Buzz",
0, "Fizz", 0, 0, "FizzBuzz",
};

const char* a = &digits[0];
const char* b = &digits[1];
const char* const* w = &words[0];

char buf[3];

while (a != &digits[10]) {
if (*w != 0) {
puts(*w);
} else if (a == &digits[0]) {
buf[0] = *b;
buf[1] = '\0';
puts(buf);
} else {
buf[0] = *a;
buf[1] = *b;
buf[2] = '\0';
puts(buf);
}

b = &b[1];
if (b == &digits[10]) {
b = &digits[0];
a = &a[1];
}

w = &w[1];
if (w == &words[15]) {
w = &words[0];
}
}

// Fuck it
puts("Buzz");
}

Terry is that you?

how the fuck does this work?

stack=[]
var peepee=_=>stack.pop()
var poopoo=_=>stack.push()
var dancing_lobster=_=>poopoo(peepee()-peepee())
var derp=_=>(var x=)
var bwus=_=>(poopoo(0), dancing_lobster())
var fuck=0
var diw=_=>(fuck=0,while(
//eh I give up I don't have time to finish writing the language but I beget you get the piture

By the next version of python this will work

It's equivalent to this simpler version:
int main() {
const char digits[] = "0123456789";
// Table of words. If words[number % 15] is
// not 0, then we should print that word
// instead of the number.
const char* const words[] = {
0, 0, "Fizz", 0, "Buzz",
"Fizz", 0, 0, "Fizz", "Buzz",
0, "Fizz", 0, 0, "FizzBuzz",
};

// Tens digit of the current number
int i = 0;
// Ones digit of the current number
int j = 1;
// Number % 15
int k = 0;

char buf[3];

// Loop until the tens digit overflows.
while (i != 10) {
if (words[k] != 0) {
// `number % 15` has a special word
// associated with it. Print it.
puts(words[k]);
} else if (i == 0) {
// Tens digit is zero, so print only
// the ones.
buf[0] = digits[j];
buf[1] = '\0';
puts(buf);
} else {
// Print both digits.
buf[0] = digits[i];
buf[1] = digits[j];
buf[2] = '\0';
puts(buf);
}

// Add 1 to the number. First increment
// the ones digit, then if it reaches
// 10, set it back to 0 and carry a 1 into
// the tens digit.
j = j + 1;
if (j == 10) {
j = 0;
i = i + 1;
}

// Adding 1 to the number also increases
// `number % 15`. If the counter reaches
// 15, then set it back to 0.
k = k + 1;
if (k == 15) {
k = 0;
}
}

// Fuck it
puts("Buzz");
}


But instead of storing i, j, k directly, the no-arith version stores a == &digits[i], b == &digits[j], and w == &words[k]. Since C allows array indexing on pointers, you can write x = &x[1] to make x point to the next entry in some array.

>tfw learning
>tfw didn't even know you can get away without curly brackets if you only have one thing after the if
>tfw learned about making it easily changeable
I-i'm going to make it!!!!!!!!

var a = 'Fizz'
var b = 'Buzz'
numA = 3
numB = 5

for(var i = 1; i < 101; i++) {
if(i % numA == 0 && i % numB == 0) console.log( a + b);
else if (i % numA == 0) console.log (a);
else if (i % numB == 0) console.log (b);
else console.log (i);
}

How can I improve my noob fizzbuzz user!!!!!!!!!!!!! OwO

>not programming it in the clearly superior programming language that is POSIX sed
truly brainlets
/^0*[1-9][0-9]*$/!{s/.*/Input must be a positive integer/
d
}
s/^0*//
s/$/,0,,/
: i
s/,/|,-/2
s/,/,-/3
: a
s/0|/1/
s/1|/2/
s/2|/3/
s/3|/4/
s/4|/5/
s/5|/6/
s/6|/7/
s/7|/8/
s/8|/9/
s/9|/|0/
s/,|/,1/
t a
x
g
s/.*---,-----$/FizzBuzz/p
s/.*[0-9],---.*$/Fizz/p
s/.*-----$/Buzz/p
s/.*,\([0-9]*\),.*/\1/p
x
s/\([0-9]\),---/\1,/
s/-----$//
/^\([0-9]*\),\1,/!b i
d

This is wrong. Sorry bud no job for you.

Does this count?

Attached: FizzBuzz.webm (1920x1080, 438K)

Attached: fizzbuzz.webm (512x368, 64K)

Kek

Attached: 1519171282207.jpg (229x221, 11K)

>le i will pretend i can do it so people will do my homework for me thread

>using +
Why are you even in this thread

Are you physically handicaped?

shit, the other stuff still applies though

I needed qsort, I hope that is okay.

#include
#include
#include

#define Oo 100ULL
#define __(oo,oO)\
for (o=(Oo*(oo)>>(oO));(float)Oo/o>1.0;o=o_(o,(Oo*(oo)>>(oO))),OO=o_(Oo/0140,OO))OO[O]
#define o6 uint64_t
o6 o_

(o6 u, o6 o){o6 oo;while(o)oo=u&o,u^=o,o=oo 48) > (o6)(*((char*)o_(6.0,(o6)O))) ;}

int main(void)
{
o6 oo, oO, o, O [Oo * 0x1bbbbbbbd4 >> 36], OO = 0;

__(0x3e0f83e1ull, 35) = (o > 060; oo =o;
while (!(oO^ (o [O])) && (o [O]&16711680))
printf("%s", (char*)&o[O]), o=o_(o,1);
printf(!(o ^oo) ? "%s\n" : "\n", (char*)&o [O]);
} return

0;
}

for(i = 1; !(i > 100); i -= -1) {
if(((i / 15) * 15) == i)
printf("FizzBuzz\n");
else if(((i / 5) * 5) == i)
printf("Buzz\n");
else if(((i / 3) * 3) == i)
printf("Fizz\n");
else
printf("%i\n", i);
}

Attached: smug-1.png (125x65, 857)