-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
32 lines (22 loc) · 873 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
console.log("Bem vindo ao Alelos-gen")
const genInfos = {
possibleAlelos: ['A', 'a'], //Lista de alelos possiveis, para começar pequeno vamos começar com dois
genSimulation: 2, //Esse é o numeros de geraçoes que será simulado
gen1Family: ['AA', 'aa'], //Essa são os dois primeiros individuos da primeira geração
familySize : 2 //Esse é o tamanho maximo de filhos que uma familia pode ter
};
function SegregationAndMultiplication(father, mother){
const typesOfAlleles = father.length-1
const family = [];
for(let i = 0; i< typesOfAlleles*2; i++){
for(let j = 0; j<2; j++){
const child = father[j]+mother[i]
family.push(child)
}
}
return family
}
/*for(let i = 0; i < genInfos.genSimulation; i++){
}*/
console.log(SegregationAndMultiplication('Aa', 'aa'))
console.table(genInfos)