>it says here that you can't do fizzbuzz without if else statements
>care to explain this?
>>56490928
kys?
10 print "fizz"
wait 4
beep
print "buzz"
goto 10
>>56490955
fortran?
>>56490928switch...
You mean like this one?
>>56490928
Easy, I lack experience.
That'S why I code in my free time, too.
So could you please leave me alone, so I can continue being a miserable pile of secrets?
./fizzbuzz.sh
>>56491012
Looks like basic desu senpai
i can tell from some of the pixels and the fact that print statements aren't formatted like that in fortran
>>56490928
How long has she been on HRT? I want to be a tech emo girl too.
>>56490928(defun shiggylicious (n)
(dotimes (i n)
(format t "~%~:[~d~:;~:*~{~c~^~}~]"
(append (and (zerop (rem i 3)) (coerce "fizz" 'list))
(and (zerop (rem i 5)) (coerce "buzz" 'list)))
i)))
>>56491449
>she
>girl
>>56491543
I'd totally cover her dick in hershey's and suck on that feminine penis
>>56490928# include <stdio.h>
int main ( ) {
int i=0;
A: ++i;
if (i - (i/3)*3 != 0)
{
goto B;}
printf("Fizz");
B: if (i-(i/5)*5 != 0)
{
goto C;}
printf("Buzz");
C:
if (i-(i/3)*3 !=0 && i-(i/5)*5!=0)
{
printf("%d", i);}
printf("\n");
if (i<100)
{
goto A;}
}
>>56490928
I can do it just with if statements.
>>56491563
You're using if else
>>56491661
Heh
x=cellstr(int2str((1:100)'));
x(3:3:end)=cellstr('Fizz');
x(5:5:end)=cellstr('Buzz');
x(15:15:end)=cellstr('FizzBuzz');
fprintf('%s\n',x{:});
>statement
EVRYTHING IS AN EPXPRESSSION YOU WHORE
public static void main(String[] args){
for(int i = 1; i <= 100; i++){
String test = "";
test += (i % 3) == 0 ? "fizz" : "";
test += (i % 5) == 0 ? "buzz" : "";
System.out.println(!test.isEmpty() ? test : i);
}
}
>>56492215
That's literally just a shorthand if else statement.
switch (i % 3) {
case 0: {
switch (i % 5) {
case 0: {
// Fizzbuzz
}
default: {
// Fizz
}
}
}
default: {
switch (i % 5) {
case 0: {
// Buzz
}
default: {
// Number
}
}
}
}
Just use a visitor design pattern.
#include <stdio.h>
static void num (int n) { printf("%d\n", n); }
static void fizz () { printf("Fizz\n"); }
static void buzz () { printf("Buzz\n"); }
static void fizzbuzz () { printf("Fizzbuzz\n"); }
int main (int argc, char *argv[]) {
void (*fp[4])(int n) = {num, fizz, buzz, fizzbuzz};
for (int i = 1; i <= 100; i++) {
fp[(!(i % 3)) + ((!(i % 5)) << 1)](i);
}
return 0;
}
>>56490928
How big is Pistol's pistol?
>>56491402
That's actually pretty cool. Forgot you could do that range selection in Python.
for i in xrange(1,100): print 'FizzBuzz'[4*(i%3>0):8-4*(i%5>0)] or i