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 ((r (exp (* 0+i 1/28)))
  18. (posns `(,(world-posn1 w) ,(world-posn2 w) ,(world-posn3 w) ,(world-posn4 w)))
  19. (convert 240+240i))
  20. (let ((z (map (lambda (i)
  21. (+ (* r (- (+ (posn-x i) (* 0+i (posn-y i))) convert)) convert))
  22. posns)))
  23. (apply world
  24. (map (lambda (x)
  25. (make-posn (real-part x) (imag-part x))) z)))))
  26.  
  27.  
  28. (big-bang (world (make-posn 360 240) ;; 座標初期値
  29. (make-posn 240 360)
  30. (make-posn 120 240)
  31. (make-posn 240 120))
  32. (on-tick place-hoshida-on-tick) ;; ここで単位時間毎に座標データを更新する
  33. (to-draw place-hoshida))
Runtime error #stdin #stdout #stderr 0.59s 62760KB
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