[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-users] Using value from array to select elements in another array



Hi dear list ,  I have 2 arrays, both with numbers.  I need to select
randomly items from the first array but using the values in the second
array for making the selection, for example lets say  i have array A
and B,  I need to select randomy a value from array A  using  array B
in this way: :


	A = 	[14, 2, 9, 1, 11, 8, 12, 4, 4]
		            |                      |
	B = 	[1,  2,  3, 1,  2, 4,  1,  3, 4]


Select one random value in A that has 3 in B.

It should select 9 or 4 because both has 3  in the same position in B.

Which is the best approach for doing this in sc3?


any idea would be appreciated.



thanks


Xiao

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/