[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

FIZZBUZZ GENERAL

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 11
Thread images: 2

File: PIC-fizzbuzz[1].png (7KB, 200x200px) Image search: [Google]
PIC-fizzbuzz[1].png
7KB, 200x200px
I'll start; here's fizzbuzz in powershell

foreach ($i in 1..103) {
$fizzarray = @($i,"fizz","buzz","fizzbuzz")
$o = 0
if ($i % 3 -eq 0) {$o += 1}
if ($i % 5 -eq 0) {$o += 2}
write-host $fizzarray[$o]
}


Post your own fizzbuzz implementations!
>>
File: fbos.webm (135KB, 720x420px) Image search: [Google]
fbos.webm
135KB, 720x420px
>>57966154
the actual fizzbuzz itself is pretty standard though
void fizzbuzz(void)
{
int i;

for (i = 1; i <= 100; i++) {
if (i % 15 == 0) {
writesln("Fizzbuzz");
} else if (i % 3 == 0) {
writesln("Fizz");
} else if (i % 5 == 0) {
writesln("Buzz");
} else {
writeiln(i);
}
delay();
}
}
>>
>>57967409
post assembly pics pls
>>
>>57966154
>>57967409
>
"fizzbuzz"


>how to not get hired

What do you retards do when your interviewer asks you to add pop, wuzz, etc for multiples of new numbers?
>>
>>57968272
Bumping for this
>>
for x in range(100):print "fizz"*(x%3==2)+"buzz"*(x%5==4)or x+1
>>
>>57968469
Alternate implementation for you enterprise folks :^)

foreach ($i in 1..$args[0]) 
{
if ($i % 3 -eq 0) {write-host "Fizz" -NoNewline}
if ($i % 5 -eq 0) {write-host "Buzz" -NoNewline}
if ($i % 7 -eq 0) {write-host "Pop" -NoNewline}
if ($i %11 -eq 0) {write-host "Whack" -NoNewline}
if ($i % 3 -ne 0 -and
$i % 5 -ne 0 -and
$i % 7 -ne 0 -and
$i %11 -ne 0)
{write-host $i -NoNewline}
write-host
}
>>
>job interview today
>There's a test
>It's à fizzbuzz
I
And I thought it was a meme...
>>
>>57968272
they don't have to be pics

a simple pastebin will do
>>
void fizzbuzz(int start, int end) {
for (int i = start; i <= end; ++i) {
int div3 = (i % 3 == 0);
int div5 = (i % 5 == 0);
if (div3 || div5) {
if (div3) printf("fizz");
if (div5) printf("buzz");
printf("\n");
} else {
printf("%d\n", i);
}
}
}
>>
>>57968469
fb = lambda x: "".join([v for k, v in {3:"fizz", 5:"buzz", 7:"pop", 11:"whack"}.items() if not x%k])
[print(fb(x) if fb(x) != "" else x) for x in range(1,100)]

desu
Thread posts: 11
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.