Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 15jan14abu
- # (c) Software Lab. Alexander Burger
- (load "@lib/http.l" "@lib/xhtml.l" "@lib/form.l" "@lib/canvas.l")
- (zero *PosX *PosY)
- (one *MovX *MovY)
- (de drawCanvas (Id Dly)
- (make
- (when (lt0 Dly)
- (csDef "lines" 1200 800
- (make
- (do 100
- (csStrokeLine
- (rand 10 1190)
- (rand 10 790)
- (rand 10 1190)
- (rand 10 790) ) ) ) )
- (csDef "hello" 36 18
- (make
- (csStrokeRect 0 0 36 18)
- (csFillText "hello" 6 12) ) )
- (csDef "world" 40 18
- (make
- (csStrokeRect 0 0 40 18)
- (csFillText "world" 6 12) ) ) )
- (csClearRect 0 0 600 400)
- (when (member (dec '*PosX *MovX) '(0 -600))
- (setq *MovX (- *MovX)) )
- (when (member (dec '*PosY *MovY) '(0 -400))
- (setq *MovY (- *MovY)) )
- (csDraw "lines" *PosX *PosY)
- (csDraw "hello" (rand 1 560) (rand 1 420))
- (csDraw "world" (rand 1 560) (rand 1 420)) ) )
- (de work ()
- (when (app)
- (seed (in "/dev/urandom" (rd 8))) )
- (action
- (html 0 "Canvas" '("@lib.css" . "canvas {border: 1px solid}") NIL
- (form NIL
- (<canvas> "$work" 600 400)
- (javascript NIL "onload=drawCanvas('$work', -9)")
- (gui '(+OnClick +Button)
- "return drawCanvas('$work', 40)"
- "Run" ) ) ) ) )
- (server 8080 "!work")
- # vi:et:ts=3:sw=3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement