Anyone who can write an APL function should be able to host it on the web.™
Rendered webpage |
APL code |
Direction (alpha): | ?? |
Front/Back (beta): | ?? |
Left/Right (gamma): | ?? |
:class GyroSimple : MiPageSample
⍝ Control:: _DC.Gyro
⍝ Description:: Simple accelerometer interaction (use it from a platform which responds to movement)
∇ Compose
:Access public
Add _.Table('Direction (alpha):' 'Front/Back (beta):' 'Left/Right (gamma):',⍪{⍵ New _.span'??'}¨'alpha' 'beta' 'gamma')
⍝ The default behaviour of Gyro is to call APLJax every 0.25 seconds:
(Add _.Gyro).NoAlert←∨/'-remote-debugging-port'⍷2⎕nq'.' 'GetCommandLine' ⍝ suppress the Alert if we're running in automated tests (very likely remote-debugging-port will be set then...)
∇
∇ r←APLJax;rep
:Access public
rep←{('#',⍵)Replace ¯1 Get ⍵}
r←⊃,/rep¨'alpha' 'beta' 'gamma'
∇
:endclass