Skip to content

5. Cards on the Table

In this problem, you’re asked to enter an APL expression (some APL code), including arguments (data given to APL symbols). Your code will be tested by the APL Challenge system to check whether it gives the correct answer and uses the methods described below.

If you put ∘. (jot dot, but sometimes called table) immediately to left of a function, then it produces a table for that function. It does this by inserting the function between all the combinations of numbers from the arguments. If the resulting table had row and column headings, the left argument would be used as the headings for the rows (down the left side) and the right argument would be used as the headings for the columns (across the top). Here’s a multiplication table (times table) in APL form – and as you might see it in a book (showing the row and column headings, even though they are not table data):

      2 3 4 ∘.× 2 3 4 5
4  6  8 10
6  9 12 15
8 12 16 20
×2345
246810
3691215
48121620

As in the above example, when we write APL code and its result together, we often write the code above the result, with six spaces to the left of the code.


Using ∘., create an addition table (plus table) for the numbers 3 1 4. The result should look like this:

6 4 7
4 2 5
7 5 8