/FIZZBUZZ/

FIZZ BUZZ TIME BOYS

BONUS POINTS FOR A REVERSE FIZZBUZZ

public class FizzBuzz {
public static void main(String[] args) {
System.out.println(FizzBuzz(1));
}
public static String FizzBuzz(int i) {
if (i == 101) {
return "END";
}
if (i % 15 == 0) {
System.out.println("FIZZBUZZ");
}
else if (i % 3 == 0) {
System.out.println("FIZZ");
}
else if (i % 5 == 0) {
System.out.println("BUZZ");
}
else {
System.out.println(i);
}
return FizzBuzz(i + 1);
}
}

Attached: FizzyBuzzy.jpg (1920x1080, 74K)

Other urls found in this thread:

play.rust-lang.org/?gist=6506f326a73fc602da97f8db6c0d3376&version=stable&mode=debug
twitter.com/NSFWRedditGif

>java

Attached: 7D62DB68-2220-4172-8037-C4CBE8BB47EB.jpg (600x337, 25K)

function fizzbuzz (n = 100) {

for (let i = 1; i

#include

int main()
{
int i;
for (i = 1; i

This better?

wtf is this?

function fizzbuz() {
for (let i = 0; i

>interviewer: So, do you enjoy programming? Been doing any practice to keep your skills sharp?
>user: I competitively fizzbuzz on a chinese cartoons chatroom and try to do things as dumb or obtuse as possible
>interviewer: Is 300k starting good enough?

program fizzbuzz;
var
i:integer;

begin
for i:=0 to 100 do
begin
if (i mod 15 = 0) then
writeln('FizzBuzz')
else if (i mod 3 = 0) then
writeln('Fizz')
else if (i mod 5 = 0) then
writeln('Buzz')
else
writeln(i);
end;
end.

>mfw no one read the problem description or solved the problem

for yeet in range(1,100):
if (yeet % 15 == 0):
print("{} Fizz-buzz".format(item))
elif (yeet % 5 == 0):
print("Buzz")
elif (yeet % 3 == 0):
print("Fizz")
else:
print(yeet)

#include
using namespace std;

void fizz(int);

int main ()
{
for (int x=1;x

#include
#include
#include

bool doYouWishToContinue() {
std::cout

#include
#define BUZZZ int
#define FIZZZ printf
#define FIZZ for
#define BUZZ if
#define BZZ "\n"
#define FUZZ return
#define FIZZBUZZZ main
#define FIZZZBUZZ "%d"
#define FIZZBUZZ else
#define BUZZFIZZ 3
#define FIZZFIZZ 5
#define BUZZBUZZ 100

BUZZZ FIZZBUZZZ(){BUZZZ fizzbuzz;FIZZ(fizzbuzz=BUZZFIZZ/BUZZFIZZ;fizzbuzz

noice

based

Quality.

public static void main(String[] args) {
System.out.print("1\n2\n3Fizz\n4\n5Buzz\n6Fizz\n7\n8\n9Fizz\n10Buzz\n11\n12Fizz\n13\n14\n15Fizz-Buzz\n16\n17\n18Fizz\n19\n20Buzz\n21Fizz\n22\n23\n24Fizz\n25Buzz\n26\n27Fizz\n28\n29\n30Fizz-Buzz\n31\n32\n33Fizz\n34\n35Buzz\n36Fizz\n37\n38\n39Fizz\n40Buzz\n41\n42Fizz\n43\n44\n45Fizz-Buzz\n46\n47\n48Fizz\n49\n50Buzz\n51Fizz\n52\n53\n54Fizz\n55Buzz\n56\n57Fizz\n58\n59\n60Fizz-Buzz\n61\n62\n63Fizz\n64\n65Buzz\n66Fizz\n67\n68\n69Fizz\n70Buzz\n71\n72Fizz\n73\n74\n75Fizz-Buzz\n76\n77\n78Fizz\n79\n80Buzz\n81Fizz\n82\n83\n84Fizz\n85Buzz\n86\n87Fizz\n88\n89\n90Fizz-Buzz\n91\n92\n93Fizz\n94\n95Buzz\n96Fizz\n97\n98\n99Fizz\n100Buzz");
}

#include

int main()
{
int i = 0, j;
const char *buzzer[] = {NULL, "Fizz", "Buzz", "Fizz-Buzz"};

while(i++ < 100)
(j = !(i%3)*1 + !(i%5)*2)?printf("%i %s\n", i, buzzer[j]):printf("%i\n", i);
}

#lang racket
(require srfi/1)
(define (fizzbuzz numbers results)
(cond
((null? numbers) (reverse results))
((zero? (modulo (car numbers) 15)) (fizzbuzz (cdr numbers) (cons "FizzBuzz" results)))
((zero? (modulo (car numbers) 3)) (fizzbuzz (cdr numbers) (cons "Fizz" results)))
((zero? (modulo (car numbers) 5)) (fizzbuzz (cdr numbers) (cons "Buzz" results)))
(else (fizzbuzz (cdr numbers) (cons (car numbers) results)))))

(fizzbuzz (iota 100 1) '())

Attached: cyberpepe.gif (640x636, 569K)

foreach($i in (1..100)){if(($i%5 -eq 0)-and($i%3 -eq 0)){write-host "Fizz-Buzz" -NoNewline}elseif($
i%5 -eq 0){Write-host "Buzz" -NoNewline}elseif($i%3 -eq 0){write-host "Fizz"-NoNewline }}

for i in reversed(range(1,101)):
fizzbuzz = ('fizz' if i%3 == 0 else '') + ('buzz' if i%5 == 0 else '')
print i if fizzbuzz == '' else fizzbuzz

Holy shit

Trait based generics is hard. I am completely stumped with this. I got a bunch of trait constraints in my function prototype and they're biting me. Anyone willing to help?
play.rust-lang.org/?gist=6506f326a73fc602da97f8db6c0d3376&version=stable&mode=debug

Attached: Screenshot from 2018-05-16 18-15-42.png (3220x1762, 324K)

/*
* fizzbuzz.cpp
*
* Created on: Apr 25, 2012
* Author: Brian Geffon
*
* fizzbuzz solved without looping or conditionals using only template recursion.
*/

#include
#include

template struct FizzBuzzPrinter {
static const int fizzBuzzed = 0;
template FizzBuzzPrinter(T t) {}
};

template struct FizzBuzzPrinter {
static const int fizzBuzzed = 1;
template FizzBuzzPrinter(T t) {
std::cout

def fizzbuzz(n):
if n == 1:
return [1]
return fizzbuzz(n-1) + (['fizzbuzz'] if n%15 == 0 else (['fizz'] if n%3 == 0 else (['buzz'] if n%5 == 0 else [n])))

I have lot experience with recurse algorithms and ternary operators sir. I will make you lot money sir!

>recurse algorithms
more like stackoverflow algorithms lmao

please sir i need this job

nvm fixed it
mod fib {
pub enum Term {
Number(T),
Text(&'static str),
}

impl ::std::fmt::Display for Term {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
match &self {
| Term::Number(n) => write!(f, "{}", n),
| Term::Text(s) => write!(f, "{}", s),
}
}
}

pub fn nth(i: T) -> Term
where T: Copy + ::std::ops::Rem + ::std::cmp::Ord + ::std::cmp::PartialEq + ::std::fmt::Display,
T: From
{
let zero: T = From::from(0);
match (i % From::from(15) == zero, i % From::from(10) == zero, i % From::from(3) == zero) {
(true, _, _) => Term::Text("FizzBuzz"),
(_, true, _) => Term::Text("Buzz"),
(_, _, true) => Term::Text("Fizz"),
_ => Term::Number(i)
}
}
}

fn main() {
for i in (1..=100i64).rev() {
println!("{}", fib::nth(i));
}
}

Attached: xocwbmo8eifz.png (1000x1000, 235K)

def fizzbuzz(n):
nums = [num for num in range(1,n,1)]
for i in range(0,len(nums)):
if nums[i] % 3 == 0:
nums[i] = 'fizz'
for j in range(0,i):
if nums[j] == 'fizz':
if (j+1) % 5 == 0:
nums[j] = 'fizzbuzz'
elif isinstance(nums[j],int) and nums[j] % 5 == 0:
nums[j] == 'buzz'
return nums

I fix my algo it not overflow stack now I have many childs sir please

module_script.py
#script_modded2x_print_fizzbuzz
# DESCRIPTION: fizzbuzz
#INPUT: input_size
#OUTPUT: none
("modded2x_print_fizzbuzz",
[
(store_script_param, ":input_size", 1),
(try_for_range, ":i", 1, ":input_size"),
(store_mod, reg0, ":i", 3),
(store_mod, reg1, ":i", 5),
(str_clear, s1),
(try_begin),
(eq, reg0,0),
(str_store_string, s1, "@{s1}Fizz"),
(try_end),
(try_begin),
(eq, reg1,0),
(str_store_string, s1, "@{s1}Buzz"),
(try_end),
(try_begin),
(neq, reg0,0),(neq, reg1,0),
(assign, reg0, ":i"),
(str_store_string, s1, "@{reg0}"),
(try_end),
(display_message, s1),
(try_end),

])

module_triggers.py
triggers = [
# Tutorial:
(0.1, 0, ti_once, [(map_free,0)], [
(dialog_box,"str_tutorial_map1"),
#Modded2x begin
(call_script, "script_modded2x_print_fizzbuzz", 70),
#Modded2x end
]),

Attached: 1526412784827.jpg (1920x1080, 477K)

for number in range(1, 101):
word = (("Fizz" if number % 3 == 0 else "") +
("-" if number % 3 == 0 and number % 5 == 0 else "") +
("Buzz" if number % 5 == 0 else ""))
print("{}{}{}".format(number, " " if word != "" else "", word))

This is epic

would you like to begin? N
*runs it anyways*

you missed a return false.

number should start at 0 if you're going to do $number++ at the start. It currently starts with 2.

#include
#include
#include
#include
#include

auto fizzbuzz(int x) -> std::string {
auto Kaluza_Klein_Fredholm_Operator =
[=](int n, std::string s, std::function f){
return x%n == 0? [=](std::string){return s + f("");} : f;
};

auto fuck = std::bind(Kaluza_Klein_Fredholm_Operator, 3, "fizz", std::placeholders::_1);
auto you = std::bind(Kaluza_Klein_Fredholm_Operator, 5, "buzz", std::placeholders::_1);
auto op = [](auto s){return s;};

return fuck(you(op))(std::to_string(x));
}

int main()
{
std::vector n(100);
std::iota(n.begin(), n.end(), 1);

for(auto const& i : n)
std::cout

nvm I'm retarded.

Is that fucking mount & blade?

Clean.

fb = [i for i in range(1, 101)]

for i in fb:
if i % 15 == 0:
print("fizz-buzz")
elif i % 3 == 0:
print("fizz")
elif i % 5 == 0:
print("buzz")
else:
print(i)

set lambda {{n} {join [list [lindex {Fizz {} {}} [expr {$n%3}]] [lindex {Buzz {} {} {} {}} [expr {$n%5}]]] {}}}
set fizzer {{str default} {expr {$str == {} ? $default : $str}}}
for {set i 1} {$i

Hired

yep

>not having your users do it

Attached: fizzbuzz.jpg (412x589, 52K)

Where's haskell?

lol meme language

fucking lol

What's your favorite functional programming language anonymous

/**
* Plays FizzBuzz up to an arbitrary high given integer.
* FizzBuzz is a game where the goal is to count up to an integer
* n while replacing the multiples of 3 with Fizz, the mutliples
* of 5 with Buzz and the multiples of both 3 and 5 with
* Fizzbuzz. It is a common entry-level problem for gauging a software
* engineer's expertise and methodological rigor.
* @author Dinesh Ratrikasha
* @version %I%
*/
public class FizzBuzz {
/**
* Checks whether an integer is a multiple of another.
* @param n the integer to be tested
* @param q the divisor to be tested
* @return {@code true} if {@code n} is a multiple of {@code q}, {@code false} otherwise
*/
private static boolean isMultiple(final int n, final int q) {
// The integer n is a multiple of q if and only if n = 0 (mod q)
return n % q == 0;
}

/**
* Prints the appropriate FizzBuzz message for a given integer.
* @param n the number of the message
*/
private static void printFizzBuzzMessage(final int n) {
// Since 3 and 5 are co-prime, (3 | n and 5 | n) iff 15 | n
if (isMultiple(n, 15))
System.out.println("Fizzbuzz");
else if (isMultiple(n, 3))
System.out.println("Fizz");
else if (isMultiple(n, 5))
System.out.println("Buzz");
else
System.out.println(n);
}

/**
* Program starting point.
* @param args command-line arguments. Expected to be of length 1.
* @throws SecurityException If a call to {@link System#exit} fails (unlikely)
*/
public static void main(String[] args) {
if (args.length == 1) {
try {
final int max = Integer.parseInt(args[0]);
for (int i = 1; i

Attached: Java.png (558x1023, 51K)

lisp

The real answer.

Made me chuckle.