Skip to content
Adam Bliss edited this page Oct 25, 2013 · 1 revision

Implementation

++  mat                                                 ::  length-encode
  ~/  %mat
  |=  a=@
  ^-  [p=@ q=@]
  ?:  =(0 a)
    [1 1]
  =+  b=(met 0 a)
  =+  c=(met 0 b)
  :-  (add (add c c) b)
  (cat 0 (bex c) (mix (end 0 (dec c) b) (lsh 0 (dec c) a)))

Comments



Parts of this document are generated automatically. Edits within the comments section will be preserved.

Clone this wiki locally