Code: Select all
for($i=1; $i < $array.length; $i++){
for($j=1; $j < $array1.length; $j++){
if($array[$i] && $array1[$j] == $dominant){
//code
}elseif($array[$i] == $dominant && $array[$j] == $recessive){
//code
}elseif($array[$i]==$recessive && $array[$j] == $dominant){
//code
}elseif($array[$i] && $array1[$j] == $recessive){
//code
}else{
die;
}
}
}Check to determine what kind of trait it is
Then add to something like $Trait1Final
Then take all of the "Final" vars and put them in to an array and use the maths to get the probability of drawing one?
Basically, I'm trying to make this
http://gyazo.com/eb9fcebd9557903f4c57da7e8f7b396c
Thanks for any help .