Skip to content

Errata: Cyphers and At Play with J

Vector 13:4, page 110

programming techniques

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

In Ray Cannon’s article on cyphers (Vector 13.3 page 88) we unfortunately ran the three functions into one paragraph. Here they are again, done correctly:

   r←enc text;⎕IO
 ⍝Converts <text> string as encyphered numeric vector
  ⎕IO←0
  r←public modpower(,⍉16 16⊤⎕AV⍳text)
   r←dec num;⎕IO
 ⍝Converts numeric vector to deciphered text
  ⎕IO←0
  r←(⎕AV)[16⊥⍉(((⍴num)÷2),2)⍴private modpower num]
   r←k modpower c;s
 ⍝Returns mod|c*k
 ⍝without domain errors if k is large
  s←'mod|',(⍕c),'×'
  r←⍎(((⍴s)×k-1)⍴s),⍕c

Line-numbers may be unfashionable, but they do give the production team some clues where things begin and end! Authors are encouraged to use ⎕VR format where possible.

Stefano Lanzavecchia pointed out a crucial missing tilde in Gene McDonnell’s "At Play with J" on page 131 where we should have: w =. ~. ^ #/. ~.