设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 7187|回复: 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
2 D) C: G4 J' L2 U# }6 aask turtles [if any? patches with [pcolor = red and not any? turltes-here]" Y7 A! U% n$ S# s

$ K/ d! `8 p" k; h5 d7 S[move-to one-of patches with [pcolor = red and not any? turtles-here]]
0 g) I9 ~; D, O+ B[move-to one-of patches with [pcolor = blue and not any? turtles-here]]
9 z. a" Y- L7 ]! b$ z8 qend

评分

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

查看全部评分

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

本版积分规则

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

GMT+8, 2025-7-6 15:26 , Processed in 2.300200 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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