早教吧 育儿知识 作业答案 考试题库 百科 知识分享

autolisp改错(defungeer(x0y0)(setqm(getreal"\npleaseinputm:")z(getint"\npleaseinputz:")b(getreal"\npleaseinputb:")d(getreal"\npleaseinputd:"))(setqd2(*mz))(setqd1(+d2m)d3(-d2m))(setqd22(/d22.0)d11(/d1

题目详情
autolisp改错
(defun geer(x0 y0)
(setq m (getreal "\n please input m:" )
z (getint "\n please input z:" )
b (getreal "\n please input b:" )
d (getreal "\n please input d:" )
)
(setq d2 ( * m z))
(setq d1 ( + d2 m) d3( - d2 m))
(setq d22 (/ d2 2.0) d11 (/ d1 2.0) d33 (/ d3 2.0) d00 (/ d 2.0))
(command "limits" (list 0 0) (list (+ x0 b 50) (+ y0 d11 50))
(command "zoom" "a")
(command "layer" "s" "3" " ")
(command "line"(list (- x0 10) y0) (list (+ x0 b 10) y0))
(command "layer" "s" "0" " ")
(command "line"(list x0 (+ y0 d00 8)) (list x0 (+ y0 d22)) (list (+ x0 b) (+ y0 d22))
(list (+ x0 b) (+ y0 d00 8)) "c")
(command "line"(list x0 (- y0 d00 2)) (list x0 (- y0 d22)) (list (+ x0 b) (- y0 d22))
(list (+ x0 b) (- y0 d00 2)) "c")
(command "layer" "s" "1" " ")
(command "hatch" "u" "45" "4" "n" "w"(list(- x0 2) (- y0 d22 2)) (list(+ x0 b 2) (+ y0 d22 2)) " ")
(command "layer" "s" "0" " ")
(command "line"(list x0 (+ y0 d00 8)) (list x0 (- y0 d00 2)))
(command "line"(list (+ x0 b) (+ y0 d00 8)) (list (+ x0 b) (- y0 d00 2)))
(command "line"(list x0 (+ y0 d00 2)) (list (+ x0 2) (+ y0 d00)) (list (- (+ x0 b) 2) (+ y0 d00))
(list (+ x0 b) (+ y0 d00 2)) )
(command "line"(list x0 (- y0 d00 2)) (list (+ x0 2) (- y0 d00)) (list (- (+ x0 b) 2) (- y0 d00)) (list (+ x0 b) (- y0 d00 2)) )
(command "line"(list (+ x0 2) (- y0 d00)) (list (+ x0 2) (+ y0 d00)) )
(command "line"(list (- (+ x0 b) 2) (- y0 d00)) (list (- (+ x0 b) 2) (+ y0 d00)) )
(command "line"(list x0 (+ y0 d22)) (list (+ x0 m) (+ y0 d11)) (list (- (+ x0 b) m) (+ y0 d11)) (list (+ x0 b) (+ y0 d22)) )
(command "line"(list x0 (- y0 d22)) (list (+ x0 m) (- y0 d11)) (list (- (+ x0 b) m) (- y0 d11)) (list (+ x0 b) (- y0 d22)) )
(command "layer" "s" "2" " ")
(setq a d)
(setq a1 d1)
(setq a2 d2)
(setq a3 (+ d 8))
(setq a4 b)
(setq d (itoa d) d1 (itoa d1) d2 (itoa d2) b (itoa b) c (itoa (+ d 8)))
(setq d (strcat "%%c" d) d1 (strcat "%%c" d1) d2 (strcat "%%c" d2) c (strcat "%%c" c))
(command "dim")
(command "dimtxt" "8")
(command "hor"(list x0 y0) (list (+ x0 b) y0) (list x0 (- y0 d11 14)) b)
(command "ver"(list x0 (- y0 d00)) (list x0 (+ y0 d00)) (list (+ x0 (/ a4 2.0)) y0) d)
(command "ver"(list x0 (- y0 d11)) (list x0 (+ y0 d11)) (list (+ x0 a4 30) y0) d1)
(command "ver"(list x0 (- y0 d22)) (list x0 (+ y0 d22)) (list (+ x0 a4 20) y0) d2)
(command "ver"(list x0 (- y0 d00)) (list x0 (+ y0 d00 8)) (list (+ x0 a4 10) y0) c)
(command "exit")
)
运行时总说“; 错误:输入的列表有缺陷”
▼优质解答
答案和解析
(command "limits" (list 0 0) (list (+ x0 b 50) (+ y0 d11 50))
有误
缺少括号
应为:(command "limits" (list 0 0) (list (+ x0 b 50) (+ y0 d11 50)))
而且你画直线的命令用的也不对,自己查书对照一下