2013-12-16 213 views

回答

3

你可以做到這一點很容易被「算海龜,這裏」

to setup 
    Clear-all 
    Create-turtles 50 [move-to patch random 30 random 30] 

    reset-ticks 
end 


to set-label 

    ask patches [ 
    ifelse count turtles-here > 0 
    [set plabel count turtles-here] 
    [set plabel ""] 
    ] 

end 

to go 
    ask turtles 
    [rt random 5 
    fd 0.3] 
    set-label 
    tick 
end 

我已經包含了一個工作的例子,但你的回答是「set plabel count turtles-here