Scheme playground.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
749 B

  1. ;;; defined in C code
  2. ;;; (define pixel-put (lambda (x y c) 0))
  3. (define pixel-hline (lambda (x1 x2 y color)
  4. (if (> x1 x2)
  5. #t
  6. (begin
  7. (pixel-put x1 y color)
  8. (pixel-hline (+ x1 1) x2 y color)))))
  9. (define pixel-vline (lambda (x y1 y2 color)
  10. (if (> y1 y2)
  11. #t
  12. (begin
  13. (pixel-put x y1 color)
  14. (pixel-vline x (+ y1 1) y2 color)))))
  15. (define pixel-rect (lambda (x1 y1 x2 y2 color)
  16. (begin
  17. (pixel-hline x1 x2 y1 color)
  18. (pixel-hline x1 x2 y2 color)
  19. (pixel-vline x1 y1 y2 color)
  20. (pixel-vline x2 y1 y2 color)
  21. )))
  22. (display "hello from scheme world!\n")
  23. (define main (lambda ()
  24. (begin
  25. (display "(main)\n")
  26. (pixel-rect 32 32 128 128 #xffffff))))