Here is one way to do this:
breed [ bulletins bulletin ]
to setup
ca
create-bulletins 1000 [ setxy random-xcor random-ycor ]
end
to color-bulletins
ask bulletins [
let used-colors [ color ] of other bulletins in-radius 2
let available-colors filter [ not member? ? used-colors ] base-colors
set color ifelse-value (length available-colors > 0)
[ one-of available-colors ]
[ one-of base-colors ]
]
end
, base-colors , " ", . , , .