Netlogo 在同一行中打印值和文本

Netlogo print values and text in the same line

我知道如何打印变量和文本,但我想在同一行中打印,如果我使用:

print "text" MYVARIABLE 

我遇到了异常

Expected command

那么问题来了:有没有办法在同一行打印文本和变量? 谢谢

是的! word 原语就是您所追求的——参见 the dictionary definition here

简而言之,您可以遵循以下语法:

print word "Count turtles: " count turtles

或者

print ( word "There are " count turtles " turtles right now" )