how to put a random value to split component ?

12-19-2012 01:04 PM
New Contributor
now, my problem is to put a random value to a square and for each value, make a different action.... (actually just different color)


my random value is set (0,5) and as you can see, i thinking to use similar way as split.index, but it doesn't work.

dont know how i can make it
0 Kudos
1 Reply
Frequent Contributor
Hi !

the split() operation automatically tries to even out the values.

If you want to split in different sized parts, I usually use a recursion :

minSize = 5
relativeValue = rand (0.2,0.8)

Rule -->
    case > 2 * minSize :
        split(x) { 'relativeValue : Rule | 'relativeValue : Rule}
    else :

[I did not test this example.]

Hope this helps !
0 Kudos