x ( -- n ) \ [0,1]
y ( -- n ) \ [0,1]
haiku ( -- r [g [b [a]]] )
: i 2dup z* log
; x .5 - y .5 -
i i i log over
t ( -- n) \ seconds since midnight
: d dup ;
: m 0.4 * 0.5 + - ;
: a * - y - abs 0.1 < x ;
: r t swap / d floor - 1.96 * 0.98 -
d 0 > 2 * 1 - * 0.01 + ;
: e 3 r 0.94 * 0.03 + ;
: p 5 r 0.9 * 0.05 + d t 3 * ;
e x - d * 5 r y - d * + sqrt 0.02 <
p sin m e a 0.03 < *
p cos m 1 e - a 0.97 > *
: l 2dup z* .019 t 5 / cos * .6328 z+ ;
: f l l l l l l l l l l ;
y .5 -
.5 x -
f f f f f f
.45 max
-.2 rot -
2dup + abs 2 **
audio ( n -- )
buttons ( -- n )
button ( n -- f )
mx ( -- n )
my ( -- n )
@ ( a -- n )
! ( n a -- )
dt ( -- n ) \ seconds since last frame
/inch { 72 mul } def
4 inch 1.75 inch rmoveto
8 inch 5.5 inch box
/step { key_owidth 0 rmoveto } def
/halfstep { key_owidth 2 div 0 rmoveto } def
/up { 0 key_oheight 2 div rmoveto } def
/down { 0 key_oheight 2 div neg rmoveto } def
/key {
key_width key_height box center step } def
currentpoint
(S) bigkey (K) key (W) key (R) key
(*) bigkey (R) key (B) key (G) key
(S) key (Z) key
moveto up up currentpoint
step (T) key (P) key (H) key
step (F) key (P) key (L) key
(T) key (D) key
moveto up up
chrome.runtime.onConnectExternal.addListener(
function(port) {
port.onMessage.addListener(function(msg) {
// send reply
port.sendMessage(...);
});
});
![]() |
↔ | ![]() |
↔ |
chrome.serial |
↕ | ||||
![]() |
↔ |
Message Passing |
↔ | ![]() |
Source and slides at: github.com/flagxor