Skip to content

ZARK Newsletter Extracts

Vector 14:3, page 53

competitions and puzzles education

Transcribed from the printed issue; not yet reviewed. Read it in the PDF of the issue, page 53

The ZARK APL Tutor is a computer-based tutorial for learning APL for the PC. If you bought the tutorial package you would also receive free subscription to the ZARK APL newsletter for one year. This quarterly newsletter provided additional tutorial exercises and an excellent series of APL crosswords.

Vector has been granted permission to reproduce extracts from the ZARK APL newsletter and we have decided to run a series of re-prints in every issue. We currently have issues from 1989 to 1994 and we will reprint crosswords and exercises that are still relevant. We welcome letters with new solutions and comments to the problems presented (maybe in J?) and we will publish the solutions that ZARK published in subsequent issues.

The training package was an interactive tutorial, teaching you about all aspects of APL programming. One of the advantages of APL being interpreted is that it is effectively already an interactive environment for learning the language. ZARK took this a stage further by providing a number of tutorials explaining different parts of the language and then prompting for the trainees’ attempts at solving a number of simple problems. Often when the APL approach to a problem is non-intuitive ZARK would explain the APL solution by simulating the arguments that the APL creators would have had when designing the language. This is both enlightening and amusing (and more than likely involves a large slice of artistic licence).

Although the tutor was based around the APL*PLUS II interpreter it provided a good grounding for any APL dialect. When I worked at Nestlé, the tutor was used for training both mainframe and PC programmers and seemed to be reasonably well liked (I happened to just miss out — I was the last graduate to be trained by the more traditional "sit down and read Gilman and Rose" method). The newsletter was equally as popular, its arrival being greeted by something resembling enthusiasm (a reaction the arrival of Vector rarely received).

In this first reprint we present the Crossword from issue 1989:4

A 12 × 12 crossword grid with numbered squares 1 to 40 and black squares

Across

  1. The indices of the elements in the vector R containing integers between 1 and 9.
  2. MV is a matrix of monthly totals. Annualize them.
  3. The number of dimensions in TABLE.
  4. Identify the elements of the matrix N not found in the list L.
  5. Identify the elements of the integer matrix ME that match the elements of the corresponding matrix M, after scaling (dividing) M by the scalar N and truncating fractions.
  6. The available programs.
  7. It’s simpler than 2×A, and gives the same value.
  8. Identify the elements of D that are smaller than the corresponding elements of K.
  9. Return all or none of the columns of M, depending on whether BR is 1 or 0.
  10. The pointless inverse of the pointless expression -0.
  11. The rankings of the elements of the vector V, 1 for largest, 2 for next largest, and so on.
  12. (⍎'⍎''''''BT'''',⍕⍴''''BT''''''''),'~'
  13. The end-of-year balances of an investment amount A, given the annual interest rates in the vector I.
  14. The area of a circle having radius R.
  15. ,2 1⍴2 1⊖2 1⍉'TUVW',[.21]'1234'
  16. ¯2 ¯7 ¯12 ... ¯37 ¯42.
  17. Round each number in the matrix N to the nearest integer.
  18. Draw one card from a deck of playing cards and then put it back. Do this 100 times.
  19. ,⍉(25,⍴V)⍴V
  20. -/32 1 2 3
  21. Five fives

Down

  1. Are the elements of the vector A in ascending order?
  2. A is a non-negative scalar. Return 1 if A is positive, or an empty vector if A is zero.
  3. Throw it all away!
  4. The indices of the rows of a matrix with M rows.
  5. The number of elements of the vector V not in the matrix M.
  6. R is a Boolean matrix that flags the non-zero elements of D. Return the quotient N÷D, returning 0 whenever D is 0.
  7. 1 1⍉3 4 ⍴'MY 32NDBOLT'
  8. Are any of the elements of the matrix N negative?
  9. Multiply each element of V by 250, replicate them N times each and add the scalar T to the result.
  10. A logical name for a logical array of rank 2.
  11. Are there exactly E 1s in the logical vector BIT?
  12. The value to be subtracted from the scalar AMT to leave just its fractional portion.
  13. If BV1←V<100, what expression can you insert between the brackets in V[]←0 to zero out the elements of V less than 100?
  14. The indices that will re-order the vector V, moving the values above 10 to the front of the vector and the values below 10 to the end.
  15. The cosine of 45 degrees.
  16. All but the last two elements of the vector NV.
  17. Re-order ⍳3 randomly.
  18. The sign of zero.
  19. (5×2*3)++/⍳10
  20. 5×12-9*6≠6
  21. The total for each row of the matrix M.
  22. +/3 4*2