Skip to content

6. O, Say Can You See?

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.

The product of a list of numbers is result of multiplying all the numbers in the list. APL uses the function × (Times) for multiplication. For example, the product of 3 1 4 1 5 is 3×1×4×1×5 which is 60.

I contrast to from problem 5, the Or function (an upside-down ) gives 1 if either or both arguments are 1, but 0 if both are 0. For example, 1 1 0 0 ∨ 0 1 0 1 gives 1 1 0 1, because:

  1. 1 yes: the 1 in the left argument is yes
  2. 1 yes: 1 and 1 are both yes
  3. 0 no: neither 0 nor 0 are yes
  4. 1 yes: the 1 in the right argument is yes

In APL, we can avoid writing the function between the numbers by using / (Slash). A function to the left of a / will be inserted between the numbers on the right of that /. For example, the above product can be found with ×/ 3 1 4 1 5.

All other basic functions of APL can be used with / in the same way.


Use comparison from problem 1 and with / to write an expression showing that the text 'DYALOG' contains the letter 'O'. The result should be 1 for yes.