Skip to content

2. Literally

Note: In this problem, you’re asked to enter some APL code, including an APL symbol and the data (text or numbers) given to it. Your code will be tested by the APL Challenge system to check whether it gives the correct answer and uses the methods described below. spelling

In problem 1 we saw how you can compare two lists. You can also compare a single number to a list. For example, 1 2 3 4 5 ≥ 3 gives 0 0 1 1 1, because:

  1. 0: no, 1 is not higher than or equal to 3
  2. 0: no, 2 is not higher than or equal to 3
  3. 1: yes, 3 is (higher than or) equal to 3
  4. 1: yes, 4 is higher than (or equal to) 3
  5. 1: yes, 5 is higher than (or equal to) 3

In APL, a text is a list of letters and must be between single quotes (  '  ). For example, 'ABC' will give a result that looks like ABC.

A single letter like 'K' is not a list, just like a single number like 42 isn’t a list.

Letters are not higher or lower than each other; they are only equal or not equal to each other.


Write a single line of APL that one of the comparison symbols (<, , =, , >, ) to indicate where the 'A's are found in the text 'DYALOG APL'. The result should be 0 0 1 0 0 0 0 1 0 0.