how to put a random value to split component ?

475
1
12-19-2012 01:04 PM
anthonymagdelaine
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)

[ATTACH=CONFIG]20086[/ATTACH]

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
MatthiasBuehler1
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 scope.sx > 2 * minSize :
        split(x) { 'relativeValue : Rule | 'relativeValue : Rule}
    else :
        Done.


[I did not test this example.]

Hope this helps !
0 Kudos