3 ms·
Try this one: (2=+⌿0=X∘.|X)/X←⍳20 :-) They're equivalent, but the second should give you a bit more intuition based on your understanding of the definition of
by arcfide 10y ago
Try this one:
(2=+⌿0=X∘.|X)/X←⍳20
:-) They're equivalent, but the second should give you a bit more intuition based on your understanding of the definition of prime numbers.
Use TryAPL.org to explore the code. Evaluation is right to left with parentheses being their standard meaning. Try seeing what the left and the right sides of the / expression give you, and then try removing pieces from the left of the left side expression of / incrementally to see how its built up.
If you need help seeing what the functions do, you can see help.dyalog.com "Language Reference" That will show you what the symbols do.
- arcfide 10y agoYou may also want to see "Game of Life in APL" on YouTube. https://www.youtube.com/watch?v=a9xAKttWgP4 https://www.youtube.com/watch?v=a9xAKttWgP4