设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7599|回复: 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 go0 z! c  ~' ]0 T. O6 N& \! S3 _9 r
ask turtles [if any? patches with [pcolor = red and not any? turltes-here]
- Z. ~3 ]3 W# Z) m# k0 S( q1 j% b, E% t! T7 i, r" S$ n5 Y8 F6 K
[move-to one-of patches with [pcolor = red and not any? turtles-here]]% z7 C. m5 |! z% f- A5 E
[move-to one-of patches with [pcolor = blue and not any? turtles-here]]
& Z4 b" ?0 k# D. P3 Wend

评分

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

查看全部评分

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

本版积分规则

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

GMT+8, 2025-9-13 22:53 , Processed in 0.017059 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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