Well. My dilemma is this: I'm trying to create something that displays all the different genetic outcomes that a mating between two animals would produce.
I have the code set the number of possibilities for each gene, and the different possibilities set in individual arrays (agene, bgene, cgene, etc.)
So if agene has 2 possibilities then it sets the different possibilities like: agene[1] = "AA" and agene[2] = "Aa" ... and so on. The number of possibilities are stored as a regular variable, not an array.
However, I need to have some sort of way to find all the combinations of these different genes and put all the results into multiple arrays - one array per possible gene sequence.
Such as:
1 -> AA
2 -> bb
3 -> Cc
etc. as one array, or possibly a multidimensional array.
However, each setting has to have only one A, one B, one C, etc., to form a proper genetic sequence that the code can analyze. The genes need to be seperate, as the code takes one gene at a time.
Hopefully I made sense ... I probably didn't.
I tried setting this with several nested for loops or while loops. All to no avail. I am sure there is an easier way to do this, but I just can't see it.
Anyone have any ideas?