[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 thread <?php foreach(range(1,100) as $number){ if($number

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: 16
Thread images: 1

File: fizzbizz.png (45KB, 916x916px) Image search: [Google]
fizzbizz.png
45KB, 916x916px
fizzbuzz thread

<?php
foreach(range(1,100) as $number){
if($number % 15 == 0){
echo("fizzbuzz<br/>");

}
elseif($number % 3 == 0){
echo("fizz<br/>");

}
elseif($number % 5 == 0){
echo("buzz<br/>");

}
else{
echo("$number<br/>");

}
}

>>
>>55494122
>>http://rosettacode.org/wiki/FizzBuzz
/thread
>>
>>55494122
 {⍵'Fizz' 'Buzz' 'FizzBuzz'[ +/1 2×0=3 5|⍵] }¨1+⍳100 


Most efficient language ever
>>
>>55494440
What in the everloving fuck is that
>>
>>55494459
APL my son.

The most efficient and powerful programming language you'll ever come across.

Able to control mainframe computational tasks in a few lines, and is able to come up with the most advanced algorithms in just 1 line.
>>
>>55494591
>sacrificing readability for functionality
>>
>>55494648
>implying it is unreadable
Only to those who are unworthy of possessing the knowledge of such a powerful language.
>>
>>55494591
how does unix's dc compare?
>>
>>55494686
life←{↑1 ⍵∨.∧3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵}
Explain this function then.
>>
>>55494705
Poorly.
The ability to produce many numatic functions is highly effective in producing algorithms. This has many real-world uses.
>>
OCaml Master Race

let rec f n s =
if n = 100 then print_string s
else f (n+1) (s ^ "\n" ^ (
(fun x -> if x = "" then string_of_int n else x)
(List.fold_left
(fun x y -> x ^
if (n mod (fst y) = 0) then (snd y)
else "" )
"" [3,"fizz";5,"buzz"] )
)) in f 0 ""

https://ocsigen.github.io/js_of_ocaml/
>>
>>55494705
By overcomplicating staff. We are all gonna be on a wheelchair pushed by a nurse by the time we reach 80 years. What's the point of making our life hard and not enjoying a carefree existence? Sure go spend your life programing in weird languages, filling your pockets with money which you will never use at the end of your days. Program your own destiny anon. Do it the hard way if you will
>>
>>55494761
APL programs are read from right to left.

So first off, we can see there will be a function(within the {}) that will be stored in a variable called 'life'

It's actually fairly simple once you get the hang of it.

https://en.wikipedia.org/wiki/APL_syntax_and_symbols
>>
>>55494776
That's actually really beautiful anon.
>>
>>55494772
wtf!
>>
>>55494772
>>55494834
Better indents
let rec f n s =
if n = 101
then print_string s
else f (n+1) (s ^ "\n" ^ (
(fun x ->
if x = ""
then string_of_int n
else x)
(List.fold_left
(fun x y -> x ^
if (n mod (fst y) = 0)
then (snd y)
else "" )
""
[3,"fizz";5,"buzz"] )
))
in f 1 "";;
Thread posts: 16
Thread images: 1


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