- 积分
- 69
- 明经币
- 个
- 注册时间
- 2012-12-13
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|

楼主 |
发表于 2013-5-7 15:19:01
|
显示全部楼层
(defun a()
(setvar "clayer" "0");设置图层为当前图层
(command "color" "1" "");图层颜色为红色
(command "rectang" "0,800" "800,0" "");0图层区域绘制矩形
(command "line" "0,200" "800,200" "");绘制图格
(command "line" "0,400" "800,400" "")
(command "line" "0,600" "800,600" "")
(command "line" "200,0" "200,800" "")
(command "line" "400,0" "400,800" "")
(command "line" "600,0" "600,800" "")
(command "layer" "Lo" "0" "");锁定0图层
(command "layer""make" "Game" "");创建游戏界面图层
(command "color" 3);设置游戏界面图层为绿色
(setq n (fix(rem (getvar "CPUTICKS") 6)));;产生一个0-5的随机数
(setq a0 (list 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8))
(setq a1 (list 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8))
(setq a2 (list 8 7 6 5 4 3 2 1 1 2 3 4 5 6 7 8))
(setq a3 (list 1 3 2 4 6 7 5 4 3 4 5 6 1 2 8 7))
(setq a4 (list 1 4 7 2 5 8 3 6 2 5 8 1 4 7 3 6))
(setq a5 (list 3 5 7 1 6 4 2 8 1 5 4 7 3 6 2 8))
(if (= n 0) (setq a a0))
(if (= n 1) (setq a a1))
(if (= n 2) (setq a a2))
(if (= n 3) (setq a a3))
(if (= n 4) (setq a a4))
(if (= n 5) (setq a a5))
(setq x (nth 0 a))
(command "rectang" "0,800" "200,600" "")
(command "text" "j" "mc" "100,700" "100" "0" x);一行一列
(setq x (nth 1 a))
(command "rectang" "200,800" "400,600" "")
(command "text" "j" "mc" "300,700" "100" "0" x);一行二列
(setq x (nth 2 a))
(command "rectang" "400,800" "600,600" "")
(command "text" "j" "mc" "500,700" "100" "0" x);一行三列
(setq x (nth 3 a))
(command "rectang" "600,800" "800,600" "")
(command "text" "j" "mc" "700,700" "100" "0" x);一行四列
(setq x (nth 4 a))
(command "rectang" "0,600" "200,400" "")
(command "text" "j" "mc" "100,500" "100" "0" x);二行一列
(setq x (nth 5 a))
(command "rectang" "200,600" "400,400" "")
(command "text" "j" "mc" "300,500" "100" "0" x);二行二列
(setq x (nth 6 a))
(command "rectang" "400,600" "600,400" "")
(command "text" "j" "mc" "500,500" "100" "0" x);二行三列
(setq x (nth 7 a))
(command "rectang" "600,600" "800,400" "")
(command "text" "j" "mc" "700,500" "100" "0" x);二行四列
(setq x (nth 8 a))
(command "rectang" "0,400" "200,200" "")
(command "text" "j" "mc" "100,300" "100" "0" x);三行一列
(setq x (nth 9 a))
(command "rectang" "200,400" "400,200" "")
(command "text" "j" "mc" "300,300" "100" "0" x);三行二列
(setq x (nth 10 a))
(command "rectang" "400,400" "600,200" "")
(command "text" "j" "mc" "500,300" "100" "0" x);三行三列
(setq x (nth 11 a))
(command "rectang" "600,400" "800,200" "")
(command "text" "j" "mc" "700,300" "100" "0" x);三行四列
(setq x (nth 12 a))
(command "rectang" "0,200" "200,0" "")
(command "text" "j" "mc" "100,100" "100" "0" x);四行一列
(setq x (nth 13 a))
(command "rectang" "200,200" "400,0" "")
(command "text" "j" "mc" "300,100" "100" "0" x);四行二列
(setq x (nth 14 a))
(command "rectang" "400,200" "600,0" "")
(command "text" "j" "mc" "500,100" "100" "0" x);四行三列
(setq x (nth 15 a))
(command "rectang" "600,200" "800,0" "")
(command "text" "j" "mc" "700,100" "100" "0" x);四行四列
(setq x 0)
(setq y 0)
(while(and(<= x 800)(<= y 800)(>= x 0)(>= y 0));选取游戏框图坐标点
(setq x 0)
(setq y 0)
(setq p1 (getpoint"/n请选择"))
(setq x (nth 0 p1))
(setq y (nth 1 p1))
(setq x (/ (+ x 50) 20))
(setq y (/ (+ y 50) 20))
(setq x1 (* 100 (fix x)))
(setq y1 (* 100 (fix y)))
(setq p1 (list x1 y1))
(setq x2 x1)
(setq y2 (+ 200 y1))
(setq p2 (list x2 y2))
(setq x3 (+ 200 x1))
(setq y3 y1)
(setq p3 (list x3 y3))
(setq x4 (+ 200 x1))
(setq y4 (+ 200 y1))
(setq p4 (list x4 y4))
(setq pt_list (list p2 p1 p3 p4))
(setq ss1(ssget "wp" pt_list))
(command "move" ss1 "1000,0" "2500,0" "")
)
)
|
|