[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 upgrade

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: 10
Thread images: 3

File: Screenshot_2017-04-04_21-17-41.png (37KB, 716x331px) Image search: [Google]
Screenshot_2017-04-04_21-17-41.png
37KB, 716x331px
FizzBuzz is old news, make way for FizzBuzzPrime. So, /g/, are you up for it?
>>
All numbers below what?
The numbers that were divisible by 3 or 5 AND the primes?
Your requirements are not well formed.
>>
I actually don't know any programming languages but i've been reading these fizzbuzz and prime number threads for awhile. I've gotten pretty damn good at it. It'd be fun if make up some crap on a resume and I try to apply to some programming jobs with whiteboard interviews just to see what happens.
>>
>>59746716
They ask conceptual question. Fizzbuzz is a meme.
>>
>>59746669
It's pretty clear: sum of all numbers below number if number is prime, with numbers being 1-100.
>>
>>59746640
the point of fizzbuzz is to weed out idiots who can't into loops or if statements at all.
>>
>>59746640
>if a number is prime and divisible by 3 and/or 5
so just 3 and 5

List<int> primes = new List<int>();
for(int i = 1; i <= 100; i++)
{
if(primes.TrueForAll(j=>i%j != 0))
{
Console.WriteLine("Prime" + primes.Sum());
primes.Add(i);
}
else if(i%15)
Console.WriteLine("FizzBuzz");
else if(i%3)
Console.WriteLine("Fizz");
else if(i%5)
Console.WriteLine("Buzz");
}
>>
File: fizzbuzzmeme.webm (658KB, 470x1458px) Image search: [Google]
fizzbuzzmeme.webm
658KB, 470x1458px
SUM = 0
for i in range(1, 101):
SUM += i
fzz = ""
if i % 3 == 0:
fzz += 'Fizz'
if i % 5 == 0:
fzz += 'Buzz'
if i == 3 or i == 5:
fzz += 'Prime' + str(SUM - i)
elif i > 1:
if not any(i % ii == 0 for ii in range(2, int(i**0.5) + 1)):
fzz += 'Prime' + str(SUM - i)
print(fzz or i)
>>
File: 1466543584225.png (12KB, 640x640px) Image search: [Google]
1466543584225.png
12KB, 640x640px
%3 == 0
%5 == 0
just make a list of primes manully, append p(p+1)/2
>prime
>divisible by 3 and/or 5
>and/or
>or
>>
Good thing there's no primes less than 100
haha retards
Thread posts: 10
Thread images: 3


[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.