there is no function to the left of the left-most x to tell APL what to do with the result, it simply outputs it to the display (on a single line, separated by spaces) without needing any explicit instruction to do that. ? also has a monadic equivalent called roll, which simply returns one random integer between 1 and its sole operand [to the right of it], inclusive. Thus, a role-playing game program might use the expression ?20 to roll a twenty-sided die. Prime numbers The following expression finds all prime numbers from 1 to R. In both time and space, the calculation complexity is (in Big O notation). (~R∊R∘.×R)/R←1↓⍳R Executed from right to left, this means: Iota ⍳ creates a vector containing integers from 1 to R (if R= 6 at the start of the program, ⍳R is 1 2 3 4 5 6) Drop first element of this vector (↓ function), i.e., 1. So 1↓⍳R is 2 3 4 5 6 Set R to the new vector (←, assignment primitive), i.e., 2 3 4 5 6 The / replicate operator is dyadic (binary) and the interpreter first evaluates its left argument (fully in parentheses): Generate outer product of R multiplied by R, i.e., a matrix that is the multiplication table of R by R (°.× operator), i.e., Build a vector the same length as R with 1 in each place where the corresponding number in R is in the outer product matrix (∈, set inclusion or element of or Epsilon operator), i.e., 0 0 1 0 1 Logically negate (not) values in the vector (change zeros to ones and ones to zeros) (∼, logical not or Tilde operator), i.e., 1 1 0 1 0 Select the items in R for which the corresponding element is 1 (/ replicate operator), i.e., 2 3 5 (Note, this assumes the APL origin is 1, i.e., indices start with 1. APL can be set to use 0 as the origin, so that ι6 is 0 1 2 3 4 5, which is convenient for some calculations.) Sorting The following expression sorts a word list stored in matrix X according to word length: X[⍋X+.≠' ';] Game of Life The following function "life", written in Dyalog APL, takes a boolean matrix and calculates the new generation according to Conway's Game of Life. It demonstrates the power of APL to implement a complex algorithm in