The APL language uses a special character set (making APL code very short).

In ca 1996 I posted APL code as HTML in comp.lang.apl and was seriously flamed. Now, 20 years later, I'm finally fully recovered :-) and try again.

Afaik, Dyalog APL copies to clipboard as Unicode (I'm not 100 % sure), hence the code below might be readable code.

I'll include with this post a screenshot of what I see while constructing this post. Do you see the code as in that image?


 GPHDT iPort;a;check;int;p
⍝ Type 2: $GPHDT message: Heading, true (Gyro)

⍝ '$GPHDT,123.456,T*00',⎕TC[3 2]
⍝ 17.5 2015 Set heading to 1 decimal

⍝ Field:
⍝ 0     Message ID $GPHDT
⍝ 1     Heading in degrees
⍝ 2     T: Indicates heading relative to True North
⍝ 3     The checksum data, always begins with *

 p←'GPHDT'                                                                        ⍝ Skipped $ here, inserting later (since chechsum shall not invoke $)
 p,←',',1↓1⍕{360|360+⍵×57.29577951}#.GUI.valMain[3]                               ⍝ "COG", ToDo: Make accurate

 check←{a←≠⍀↑(⌽8,⍴⍵)⍴11 ⎕DR ⍵ ⋄ '0123456789ABCDEF'[1+,83 ⎕DR 2 ¯8↑2 4⍴a[⍴⍵;]]}p   ⍝ XOR checksum, into 2 hex chars

⍝ #.SERIAL.PORTS[iPort].Write'$',p,'*',check,⎕TC[3 2]
 {}#.SERIAL.STREAMS[iPort].WriteAsync(⊂83 ⎕DR a),0,⍴a←'$',p,'*',check,⎕TC[3 2]

It should look like this:

enter image description here

  • Looks fine to me... not certain what your question is, though... Certainly you could have used the sandbox to test whether the code is visible? Am I missing something? – Catija Apr 11 '16 at 23:49
  • Great! Sandbox would not imo work. As it would still be me viewing (i have the APL fonts installed in all machines, hence i'm "dirty"). Asking if the code looks identical to the picture. Typically, the APL glyphs could (became earlier) be replaced with something else. – Stormwind Apr 11 '16 at 23:55
  • 1
    Sandbox + browsershots or something similar would seem to be the better way to manage this. – Nathan Tuggy Apr 12 '16 at 2:37
  • 1
    Works fine. Lots of examples on codegolf.stackexchange.com too. – Mat Apr 12 '16 at 5:04
  • @Mat That indeed renders my post a doublette. But searches didn't point at codegolf (SE subdomain searches do not extend to other subdomains, it seems). Maybe let this one remain here, as meta is the place where others might search.. – Stormwind Apr 12 '16 at 10:37

You must log in to answer this question.

Browse other questions tagged .