[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Fizzbuzz
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 8
Thread images: 3
File: cruz.jpg (1 MB, 3840x5760) Image search: [Google]
cruz.jpg
1 MB, 3840x5760
Show me your Fizzbuzz and what language its in!

Heres mine in Python:

def int_to_fizzbuzz(i):
entry = ''
if i%3 == 0:
entry += "fizz"
if i%5 == 0:
entry += "buzz"
if i%3 != 0 and i%5 != 0:
entry = i
return entry

fizzbuzz = [int_to_fizzbuzz(i) for i in range(1, 100)]

print(fizzbuzz)


rate & hate plz
>>
>>54917003

python:

import memes
memes.fizzbuzz(1, 100)
>>
>whitespace-determined language
>not using code blocks
cruz control 4 retarded, m8?
>>
>>54917003
python:
for i in range(1,101):
print("FizzBuzz"[i*i%3*4:8--i**4%5] or i)
>>
Rust
fn main() {
for x in 1..100 {
match (x % 3, x % 5) {
(0, 0) => println!("FizzBuzz"),
(0, _) => println!("Fizz"),
(_, 0) => println!("Buzz"),
(_, _) => println!("{}", x)
}
}
}
>>
ES6:
[...Array(100).keys()].map((i)=>(i+1)).map((i) => i%15 == 0 ? 'FizzBuzz' : i%3 == 0 ? 'Fizz' : i%5 == 0 ? 'Buzz' : i )
>>
File: 1464840525229.jpg (43 KB, 556x561) Image search: [Google]
1464840525229.jpg
43 KB, 556x561
>>54917003
>Using two logical tests instead of else
Your Fizzbuzz confirms you as retarded.
>>
File: 1367674314793.jpg (31 KB, 313x286) Image search: [Google]
1367674314793.jpg
31 KB, 313x286
fizz
buzz
fizzbuzz

>English
Thread replies: 8
Thread images: 3

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.