>he can't write FizzBuzz without using modular
He can't write FizzBuzz without using modular
>modular
>modulo
fuk, i had one job.
for (i = 1; i = 0 ) j -= 15;
if (j == 0) printf ("FizzBuzz")
}
I don't feel like typing the rest of it out, but this is sort of how I did it in Casio BASIC
here's the Casio basic implementation using mod, originally I used another loop to do the mod with subtraction and remainder checking
For 1→A To 100 Step 1↵
MOD(A,15)→B↵
MOD(A,3)→C↵
MOD(A,5)→D↵
↵
B=0⇒"FIZZBUZZ"↵
B=0⇒Goto 1↵
C=0⇒"BUZZ"↵
C=0⇒Goto 1↵
D=0⇒"FIZZ"↵
D=0⇒Goto 1↵
↵
A◢
Goto 1
↵
Lbl 1↵
Next
>he uses Boolean Logic
How the fuck can you program anything without using boolean logic?
Demonstrate in pseudocode please
a = list(map(str, range(0, 100)))
for i in range(0, 100, 3):
a[i] = "Fizz"
for i in range(0, 100, 5):
a[i] = "FizzBuzz" if a[i] == "Fizz" else "Buzz"
print("\n".join(a))
>being this much of a brainlet
kek
What's a fizzbuzz?
Brainlet networks student here.
The most complicated thing I have done is a bubble sort
google is not your enemy .. sort of
A basic CompSci exercise that gained fame because interviewers noticed that CompSci grads couldn’t figure out how to write a program that counts from 1-100 and replaces multiples of three, five and three and five with words.
int a = 1;
int b = 1;
for(int i = 1; i
Cheers
If startpage and etc weren't slow as fuck I'd use those. Either its duckduckgo Jew or silicon valley Jews I guess
T. guy with Jew blood aware of their magic
bool nbprint=false;
int fp=0;
for (int a=1;aUsing the FPU
I was asked to fizzbuzz in an interview and I'd forgotten that the modulo operator existed because I hadn't written a line of code in over a year.
I made a 100 element array, lopped over it three time replacing the numbers with words in appropriate increments.
I hope you didn't get the job...
I don't need to know how to write things in a dumber fashion.
>uses idiv
This is the same as modulus.
Though this is a relative clean replacement.
I read your post and imagined that STEM grad meme guy who holds a diploma
I don't know what meant but my guess is you could use predicate logic and write declarative programs like in prolog
var l3 = 0, l5 = 0;
for(var i = 1; i
...
could've written fizz == 0 as !fizz too, oh well
>yes
>no
>maybe
I have very little idea about programming, but maybe dividing by three and then checking if int(result) == result could work.
import fizzbuzz
fb = fizzbuzz.FizzBuzz()
fb.fizzbuzz(100)
Using IEEE 1164
You don't understand a single thing about programming. Who are you trying to kid, pajeet
It has a cycle of 15 so it's trivial to wrap 15 predefined prints in a loop.
Yeah, gotta unroll your loops for optimisation
>He still has to solve FizzBuzz in his interviews
Junior dev detected
you can replace modulo as check divisibility check with (n / d) * d == n
Won’t this just leave you with n = n?
fizz == 0 has better readability than !fizz in this case because fizz is not really a boolean. I'd also add an else after the first if so it skips checking the other ifs when fizz && buzz is true.
shouldn't if you make sure these are actual integers and not floats, floor(n/d)*d == d otherwise
>even needing a programming language to write it
p{counter-increment: item}p:not(:nth-of-type(5n)):before{content: counter(item)}p:nth-of-type(3n):before{content: "Fizz"}p:nth-of-type(5n):after{content: "Buzz"
>not just doing it in your text editor
i1qqyypq98@q3ggqqccFizz3jq32@q5ggqqccBuzz5jq19@q15ggqqccFizzBuzz15jq5@qZZ
#include
using namespace std;
int main(void) {
for(int i = 1; i
a diploma