Skip to content

8. It Takes Two

In this problem, you’re asked to enter your own APL function, without giving it any arguments. Your function will be checked by the APL Challenge system using several tests to see whether it is correct.

In problem 7, you saw how to write a function that takes a right argument using . If you want to create a function that also takes a left argument, use (alpha; the left-most letter of the Greek alphabet). For example, a function that divides its left and right arguments and subtracts one could be written {(⍺÷⍵)-1}.


Using from problem 2 and what you learnt in problem 4, write a function that takes two numbers and gives half the difference between the left and right arguments, rounded up. For example:

      11 {answer} 4
4

      20 {answer} 7
7

      9 {answer} 2
4