Scheme 使用大爆炸和滴答声

Scheme 使用大爆炸和滴答声,scheme,racket,Scheme,Racket,所以我正试图制作一个程序,用大爆炸来增加图像的“嗨”。我把它放在画布的中央。我希望文本大小从1开始,当大小达到80时停止增长。我已经添加了刻度,但它仍然不会从1开始增长。你知道我做错了什么吗 编辑- 有几件事。最重要的是在draw world 您可以在其中绘制大小为11的文本。如果改为绘制大小为world的文本,则文本的大小将与当前世界相同 (text word world "olive") 修复该错误后,您将立即发现下一个要修复的问题 更新: (define (stop? a-world)

所以我正试图制作一个程序,用大爆炸来增加图像的“嗨”。我把它放在画布的中央。我希望文本大小从1开始,当大小达到80时停止增长。我已经添加了刻度,但它仍然不会从1开始增长。你知道我做错了什么吗

编辑-


有几件事。最重要的是在
draw world
您可以在其中绘制大小为11的文本。如果改为绘制大小为
world
的文本,则文本的大小将与当前世界相同

(text word world "olive")
修复该错误后,您将立即发现下一个要修复的问题

更新:

(define (stop? a-world)
  (<= a-world 80))
(定义(停止?一个世界)

(您可以这样做:

(require 2htdp/image)
(require 2htdp/universe)

(define WORD "HELLO WORLD" )

(define (main x)
  (big-bang x
          (on-tick next)        ; World -> World
          (to-draw draw-world)  ; World -> Image
          (stop-when stop?)))   ; World -> Boolean


; World -> World
; Gives the next world
(define (next world)
  (cond [(>= world 80) world]
        [else (+ world 1)]))

; World -> Image
; Draw the current world
(define (draw-world world )
  (place-image (text WORD world  "olive")
               240 210
               (empty-scene 500 300)))

; World -> Boolean
; Check if this is the last world
(define (stop? world)
  (= world 80))

(main 1)

我让它工作起来了。我现在需要做的就是让它在达到80的文本大小时停止增长。我猜我需要改变《大爆炸》的最后一部分。有什么想法吗?你是不是碰巧在Fundies 1中@JerryLynch@JerryLynch:你知道为什么
有用时停止吗?dyoo,是的。我试了相反的方法。大爆炸80,sub1,零时停止?。然后它停了。现在让它停在80是困难的。@Jerrynch我添加了一个
stop?
函数,你可以试试。
(require 2htdp/image)
(require 2htdp/universe)

(define WORD "HELLO WORLD" )

(define (main x)
  (big-bang x
          (on-tick next)        ; World -> World
          (to-draw draw-world)  ; World -> Image
          (stop-when stop?)))   ; World -> Boolean


; World -> World
; Gives the next world
(define (next world)
  (cond [(>= world 80) world]
        [else (+ world 1)]))

; World -> Image
; Draw the current world
(define (draw-world world )
  (place-image (text WORD world  "olive")
               240 210
               (empty-scene 500 300)))

; World -> Boolean
; Check if this is the last world
(define (stop? world)
  (= world 80))

(main 1)