« first day (1872 days earlier)      last day (789 days later) » 

5:37 AM
@Adám yeahh it does give 2 for some reason
on the integer null it gives 0
 
 
11 hours later…
4:44 PM
Hi there, I just started to get curious about APL. I learned some other languages (Python, C, C++, Clojure, Java, Go, and Prolog) and it was always very easy to find resources because these are fairly big (maybe not Prolog). One thing that always helped me to keep my interest while learning was coding challenges with an interactive look and feel to gamify my learning (like codewars and hackerrank) and courses that guide me along the way (like exercism).
Are there any such resources for APL? I have seen books and other non-interactive websites and I know I could just use project-euler or adv
 
i made this really lovely, and dare i say, efficient fizzbuzz function:
100{⍺⍴0=(⊂⍵)|⍳(∧/⍵)}4 5 7
but the issue is that i have no idea how to map this to being text. I've tried many, many, many attempts but can't seem to find a neat way to map words to this
like... all i was thinking of was having a function, where on the right it would recive the input from the function above, and on the left it would have diffrent words, each mapping to a number
it would also concatinate the text...
wait maybe i can make it myself
 
@dzaima the closest you'll get to anything like that for APL. But that's just a problem set. (taken from the various years from dyalogaplcompetition.com, which, though, is proper competition with prizes)
 
actually i have a few more things to try, dont help me yet
 
5:00 PM
@dzaima thanks, I have not seen the problems part of that. Will try it.
 
5:56 PM
ok so i still have issues but let me rephraze my question.

'one' 'two' 'three' f 100⍴0 3 1 2
lets say i have this array and i want to replace all numbers that aren't 0 with a word on the left side... what's a way i could aproche this? i can't figure out how to use the @ operator if the left arg can be any size, with right side being able to have any number(max number≤≢left arg)
 
you probably want replacementWords ⊣@{0≠⍵} ⍵ or something like that
 
but that doesn't distinguish between the numbers
 
you didn't specify how you want to distinguish things based on numbers
does 'one' 'two' 'three' {⍺ {⍺[⍵]}@{0≠⍵} ⍵} 100⍴0 3 1 2 do what you want?
 
yes! wow nice
my bad btw. sorry i didnt spesify
thanks
 
6:42 PM
(1 2 'Fizz' 4 'Buzz' 'Fizz' 7 8 'Fizz' 'Buzz' 11 'Fizz' 13 14 'FizzBuzz'⍴⍨⊢)
NOW THAT is a fast fizzbuzz solution
 
7:40 PM
solution←{(1⊃⍵)⍴(3⊃⍵){⍺{⍺[⍵]}@{0≠⍵}2⊥¨(∧/⍵)⍴0=(⊂⍵)|⍳(∧/⍵)}2⊃⍵}

solution 10 (3 5 7) ('buzz' 'fizz' 'fizzbuzz' 'bazz' 'fizzbazz' 'buzzbazz' 'fizzbuzzbazz')
length, (devisors) (words)
too amazing. i can't not share it!
 
 
1 hour later…
9:07 PM
@BrianBED The left one is the ravel (of the argument), the right one concatenates the result of 0∩⍴
@vaeng Maybe you'll like aplcart.info/quiz
 
OOoooo i should code a speedtest script that can test how well you write apl code
 

« first day (1872 days earlier)      last day (789 days later) »