Ha, yeah it's kinda complicated!
OK, I just checked out the "c" file and I think this accomplishes what I outlined in option 2 above. So, when Railclone randomly "chooses" a green square, it follows with a random number of green squares before continuing on with another color. That works well enough. Thank you!
Just for the sake of explanation, my original idea-- option 1 above -- was that I was looking for a way to "see" what the previous segment was and allow it to inform what the current segment would be. For example, at the first segment, Railclone places a colored square. Then at the second segment Railclone "looks back" at the previous segment. If that previous segment was NOT green, then it places another randomly colored square of any of the colors (including green) - equal chances for all. If it was green, then I want there to be an x percent chance that this square will be green also. Then onto the third segment. It checks back on the 2nd segment. Was it green? If so, x percent chance this will be green too. If not, then any of the random colors (including green) - equal chances for all.
(Of course, you would want x to be less than 100, or the first time a green square was placed, all of the following squares would be green.)
The effect would be random colors, but blocks of green because the green squares were all "sticky" -- in other words, if a green is placed, there's a good chance the next one will be green again and again until it breaks the cycle by not choosing green.
But I don't think there's any way for Railclone to "see" what the last segment placed was. I thought I could use variables to look back on a segment. For example, if it chooses a green square then set GreenYes = 1. At the next segment, check if GreenYes = 1, and if true, then there's an x percent chance this current segment should be green too. Then railclone chooses the current segment using those weighted chances toward green. If it chooses green, then it places a green square and keeps GreenYes = 1. If not, then it set GreenYes = 0, and it put a randomly colored square in this segment (all equal chances). Then, onto the next segment. First, check GreenYes. If it's 1, then x percent chance this square will be green. If 0, then randomly choose another color, all equal chances.
I don't think variables work that way, though.
At any rate, I hope that makes sense!
Thanks for your help!
Tony