设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 5311|回复: 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
+ |$ {6 t8 i6 W# c7 l% Q1 J% zask turtles [if any? patches with [pcolor = red and not any? turltes-here]
; B- K- r& ~% ]; a" a2 B; G# x7 ]+ k, `' d/ g0 u
[move-to one-of patches with [pcolor = red and not any? turtles-here]]! T+ T( E/ j! K) q5 _; l: {( @
[move-to one-of patches with [pcolor = blue and not any? turtles-here]], U  g# m  V( U4 ?
end

评分

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

查看全部评分

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

本版积分规则

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

GMT+8, 2024-6-1 08:44 , Processed in 0.013688 second(s), 15 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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