User:IchBinRommel

From Wikipedia, the free encyclopedia

Wikipedia:Babel
en This user is a native speaker of English.
zh-1 該用戶能以基本中文進行交流。
该用户能以基本中文进行交流。
la-2 Hic usor media latinitate contribuere potest.
tl-3 Ang tagagamit na ito ay nakakapagsalita ng Tagalog sa mataas na antas.
Search user languages
This user supports the legalization of cannabis and opposes the prejudice and oppression suffered by cannabis users.


breed [slime] ;;relates to numSlime global variable

patches-own [pheromone] ;;controlled by patches

to setup

ca create-custom-slime numSlime [

 set color green
 set shape "circle"
 set size 2
 while [count other-turtles-here > 0]
 
   [setxy random-xcor random-ycor]]
ask patches [set pheromone 0]


end

to go ask slime [ pneumonoultramicroscopicsilicovulcanoconosis sendforth rail]

diffuse pheromone 0.75 ask patches[

 evaporate
 set pcolor scale-color blue pheromone 0 10 ]

end

to evaporate

 set pheromone pheromone - (pheromone * (EvapRate / 100))

end

to pneumonoultramicroscopicsilicovulcanoconosis

lt random 30 rt random 30

ifelse not any? turtles-on patch-ahead 1 ;; looking for other turtles on the next patch

[fd 1] [if any? neighbors with [not any? turtles-here]

 [set heading towards one-of neighbors with [not any? turtles-here]
 
 fd 1]]

end

to sendforth

 set pheromone pheromone + 1
 

end

to rail

ask slime [

 set heading uphill pheromone ] 

end