Some Help

Place for questions and answers for all newcomers and new coders. This is a free for all forum, no question is too stupid and to noob.
Post Reply
User avatar
Xaos
Posts: 940
Joined: Wed Jan 11, 2012 4:01 am

Some Help

Post by Xaos »

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;
    }
    }
    }
Basically with this, I'm taking user input (From dropdown boxes, so no worries on if it'll screw up) , and putting it into array and array1. Then i'm running through these arrays, and checking if each value is dominant or recessive and comparing them. Basically now, i'm trying to figure out how to add to the probability of each thing getting pulled out. The only problem is, there may be more than one dominant or recessive for each subset, and they need to stay separate. Where it says //code, could I do something like :

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 .
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

Re: Some Help

Post by vitinho444 »

Ahh i learnt that in this year (12th grade) is Mendel's chess right?

Ok, since i know what you want i need to know something more, like what input will you be analyzing?
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
User avatar
Xaos
Posts: 940
Joined: Wed Jan 11, 2012 4:01 am

Re: Some Help

Post by Xaos »

vitinho444 wrote:Ahh i learnt that in this year (12th grade) is Mendel's chess right?

Ok, since i know what you want i need to know something more, like what input will you be analyzing?
The user's going to be able to select dropdown boxes and choose. They'll all be strings
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

Re: Some Help

Post by vitinho444 »

Yeah, but what will be in those dropboxs? It's the genotype?
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
User avatar
Xaos
Posts: 940
Joined: Wed Jan 11, 2012 4:01 am

Re: Some Help

Post by Xaos »

vitinho444 wrote:Yeah, but what will be in those dropboxs? It's the genotype?
Yeah itll be something like a characteristic....it'll be something like the user will have the option to choose say Hair and Eye color (there will be more, but for example purposes) then the dropdown will have one "mother" side and one "father" side and it'll have characteristics like Brown, Blonde, etc. (for hair).
User avatar
vitinho444
Posts: 2819
Joined: Mon Mar 21, 2011 4:54 pm

Re: Some Help

Post by vitinho444 »

Xaos wrote:
vitinho444 wrote:Yeah, but what will be in those dropboxs? It's the genotype?
Yeah itll be something like a characteristic....it'll be something like the user will have the option to choose say Hair and Eye color (there will be more, but for example purposes) then the dropdown will have one "mother" side and one "father" side and it'll have characteristics like Brown, Blonde, etc. (for hair).
Hum.. im really sorry but i was not thinking about that :S

I'm so ashamed right now for not helping you like i was thinking.. :( :oops: :x

Very Sorry..
My Company Website: http://www.oryzhon.com

Skype: vpegas1234
Post Reply

Return to “Beginner Help and Support”