连接netlogo中的单词 [英] concatenate words in netlogo
本文介绍了连接netlogo中的单词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
NetLogo用户
我想列出连接列表的列表,例如
1:[0 1 4 6 8]
这里是list2 :(单词turtle)
那么我想列出哪个[龟0龟1龟4龟8]
我怎么可能做到这一点? (b)b
$ b
提前致谢
解决方案
只是龟,所以我不太清楚你想要什么,但这应该覆盖它。
to-report append-word [w xs]
report map [[x] - >(word wx)] xs
end
to-append-words [ws xs]
report map [w] - >附加词w xs] ws
结束
测试
让ws [turtlerabbit ]
let xs [0 1 4 8]
print append-word item 0 ws xs
print append-words ws xs
end
NetLogo users
I want to make a list which concatenates lists, for example
Here is list 1 : [ 0 1 4 6 8]
and here is list2 : (word "turtle")
then I'd like to make list which ["turtle 0" "turtle 1" "turtle 4" turtle 8"]
How could I possibily make this?
Thank you in advance
解决方案
Note that (word "turtle") is just "turtle", so I'm not quite sure what you want. But this should cover it.
to-report append-word [w xs]
report map [[x] -> (word w " " x)] xs
end
to-report append-words [ws xs]
report map [[w] -> append-word w xs] ws
end
to test
let ws ["turtle" "rabbit"]
let xs [0 1 4 8]
print append-word item 0 ws xs
print append-words ws xs
end
这篇关于连接netlogo中的单词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文