给出图8:从prologue.html着陆火箭(版本6)
(require 2htdp/image)
; properties of the “world”
(define WIDTH 100)
(define HEIGHT 100)
; properties of the descending rocket
(define A 1)
; various other constants
(define MTSCN (empty-scene WIDTH HEIGHT))
(define ROCKET .)
(define ROCKET-CENTER-TO-BOTTOM
(- HEIGHT (/ (image-height ROCKET) 2)))
(define X 50)
; functions
(define (create-rocket-scene.v6 t)
(cond
[(<= (distance t) ROCKET-CENTER-TO-BOTTOM)
(place-image ROCKET X (distance t) MTSCN)]
[(> (distance t) ROCKET-CENTER-TO-BOTTOM)
(place-image ROCKET X ROCKET-CENTER-TO-BOTTOM MTSCN)]))
(define (distance t)
(* 1/2 A (sqr t)))当我跑步时:
(animate create-rocket-scene.v6)按照书中的要求:
与往常一样,您可以使用动画运行此程序: (动画创建-火箭-scene.v)
得到以下错误:
创建火箭-scene.v:期望函数调用,但在此函数之前没有开括号。
发布于 2016-02-03 15:15:39
您需要将这一行添加到您的程序(定义区域):
(require 2htdp/universe)使animate可用于您的程序。

https://stackoverflow.com/questions/35180722
复制相似问题