Fizzbuzz

get in here fellas!

#include

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

Attached: fizzbuzz.jpg (1600x1000, 142K)

Other urls found in this thread:

github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
css-tricks.com/tales-of-a-non-unicorn-a-story-about-the-trouble-with-job-titles-and-descriptions/
pastebin.com/raw/Cgj5sF2s
repl.it/repls/RecklessTotalBrackets
twitter.com/NSFWRedditGif

1 to: 100 do: [:n|
(n \\ 15 == 0) ifTrue: [
'FizzBuzz' printNl.
] ifFalse: [
(n \\ 5 == 0) ifTrue: [
'Buzz' printNl.
] ifFalse: [
(n \\ 3 == 0) ifTrue: [
'Fizz' printNl.
] ifFalse: [
n printNl.
]
]
]
].

what language is that?

Smalltalk

Alright lets do this in python

from fizzbuzz import fizzbuzz

fizzbuzz()

/**
* 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 gaujing a software
* engineer's expertise and methodological rigor.
* @author Ganesh Satya
* @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)

Shit function. Why doesn't it take a positive integer to indicate the maximum number? You'll never get a job like this.

Its a meme you dip.

def fizzbuzz_sieve(n):
s = [num for num in range(n)]
for i in range(0,n,3):
s[i] = 'fizz'
for i in range(0,n,5):
if isinstance(s[i], int):
s[i] = 'buzz'
else:
s[i] = 'fizzbuzz'
for x in s:
yield x

print([n for n in fizzbuzz_sieve(100)])


So do I get the job?

Is fizzbuzz a normal thing or a meme based on that one pasta?