fork download
  1. #lang racket
  2.  
  3. (require 2htdp/universe 2htdp/image lang/posn)
  4.  
  5. (struct world (posn1 posn2 posn3 posn4))
  6.  
  7. (define *hoshida* .)
  8.  
  9. (define *background* (empty-scene 480 480))
  10.  
  11. (define (place-hoshida w)
  12. (place-images (make-list 4 *hoshida*)
  13. `(,(world-posn1 w) ,(world-posn2 w) ,(world-posn3 w) ,(world-posn4 w))
  14. *background*))
  15.  
  16. (define (place-hoshida-on-tick w)
  17. (let ((matrix `((,(cos 1/28) ,((compose - sin) 1/28))
  18. (,(sin 1/28) ,(cos 1/28))))
  19. (posns `(,(world-posn1 w) ,(world-posn2 w) ,(world-posn3 w),(world-posn4 w))))
  20. (apply world
  21. (map (lambda (k)
  22. (apply make-posn k))
  23. (map (lambda (i)
  24. (let ((x (posn-x i)) (y (posn-y i)))
  25. (map (lambda (j)
  26. (+ (* (car j) (- x 240)) (* (cadr j) (- y 240)) 240))
  27. matrix))) posns)))))
  28.  
  29. (big-bang (world (make-posn 360 240) ;; 座標初期値
  30. (make-posn 240 360)
  31. (make-posn 120 240)
  32. (make-posn 240 120))
  33. (on-tick place-hoshida-on-tick) ;; ここで単位時間毎に座標データを更新する
  34. (to-draw place-hoshida))
Runtime error #stdin #stdout #stderr 0.36s 61920KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.rkt:7:19: read-syntax: unexpected `)`
  context...:
   read-undotted
   read-one/not-eof
   loop
   [repeats 2 more times]
   read-unwrapped-sequence17
   read-undotted
   read-syntax
   /usr/share/racket/collects/syntax/module-reader.rkt:186:17: body
   /usr/share/racket/collects/syntax/module-reader.rkt:183:2: wrap-internal
   /usr/share/racket/collects/racket/../syntax/module-reader.rkt:65:9: lang:read-syntax
   read-extension44
   read-syntax
   loop