*

: 3dup >r 2dup r@ -rot r> ;
: offset >r swap >r + r> r> + ;
: between >r swap dup >r <= r> r> < and ;
: hor >r .01 .09 between r> -.01 .01 between and ;
: ver >r -.01 .01 between r> .01 .09 between and ;
: off over <> r> and >r ;
: sega >r 0 -.2 offset hor r> 1 >r 1 off 4 off drop r> and ;
: segb >r -.1 -.1 offset ver r> 1 >r 5 off 6 off drop r> and ;
: segc >r -.1 0 offset ver r> 1 >r 2 off drop r> and ;
: segd >r hor r> 1 >r 1 off 4 off 7 off 9 off drop r> and ;
: sege >r ver r> 1 >r 1 off 3 off 4 off 5 off 7 off 9 off drop r> and ;
: segf >r 0 -.1 offset ver r> 1 >r 1 off 2 off 3 off 7 off drop r> and ;
: segg >r 0 -.1 offset hor r> 1 >r 0 off 1 off 7 off drop r> and ;
: digit 3dup sega >r 3dup segb r> or >r 3dup segc r> or >r 3dup segd r> or >r 3dup sege r> or >r 3dup segf r> or >r segg r> or ;
: 2digit 3dup >r >r >r 10 / floor digit r> .14 - r> r> 10 mod floor digit or ;
: sec t 60 mod floor ;
: r x .5 - 2 ** y .5 - 2 ** + .5 ** ;
\ r .3 < x .36 - y .4 - sec 2digit
x y 1 sega

Based on: timer - 陳爽


comments powered by Disqus