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 Racelet 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 indentslet 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 "";;