设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7517|回复: 4

[原创] 如何让海龟能够在移动的过程中辨识出不同的瓦片来!

  [复制链接]
发表于 2008-6-14 19:31:07 | 显示全部楼层 |阅读模式
例如:我想在让海龟移动的过程中有选择的移动,首先如果能够移动到红色的瓦片上去就先到红色的上面去,如果不能就移动到蓝色的瓦片上去,玩片分两种颜色,红色和蓝色!
发表于 2009-8-4 16:46:48 | 显示全部楼层
starlogo 是高手,赞一个!
发表于 2009-10-18 10:18:10 | 显示全部楼层
前面,还是用ifelse语句吧。先看是否有红色的瓦片,有的话就移到一个上面去,如果没有,就移到蓝色上面去,应该没问题。

评分

参与人数 1仿真币 +10 收起 理由
苘苘 + 10

查看全部评分

发表于 2010-5-9 20:07:31 | 显示全部楼层
to go
# ]  Z- W$ P% A4 d  [2 M( Wask turtles [if any? patches with [pcolor = red and not any? turltes-here]
6 y9 d3 e8 f' o; T/ Q, ]' r4 a. S) B  s7 V2 S8 {+ `
[move-to one-of patches with [pcolor = red and not any? turtles-here]]& e$ ?5 A. G' v+ G- Q
[move-to one-of patches with [pcolor = blue and not any? turtles-here]]+ ?& H6 m5 \4 ], w) @7 z
end

评分

参与人数 1仿真币 +10 收起 理由
苘苘 + 10

查看全部评分

发表于 2011-4-10 14:40:45 | 显示全部楼层
赞一下高手
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2025-9-5 05:55 , Processed in 0.015269 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表