Everybody loves genetics, right? In this challenge, you will be given the genotypes of two parents. You must find each possible genotype of a child produced by the parents. You must account for dominant and recessive alleles as well as incomplete dominance and codominance.
An example input for the parents could be:
Parent one (on the left) has a incompletely dominant R allele and a dominant R allele. Parent two (on the right) has a dominant R allele and a recessive allele.
Each parent is separated from the other by an x. The input will not contain an x allele.
An incompletely dominant allele will be followed by an apostrophe ('). Codominant alleles just refers to multiple different types of alleles combined together (A and W for example).
- Shortest code wins (measured in bytes).
- Each possibly genotype must be separated from the other genotypes by a comma.
- Phenotypes don't matter.
- Any letter can be used in the input except for x (which differentiates the parents).
- Duplicate genotypes should only be printed once.
- Duplicates contain the exact same letters of the same case and type of allele. IF you have WY and YW in your answer, they are considered duplicates.
- No more than three different letters will be used in one input.
- The order of the letters in the output does not matter.
- Answer can be in the form of a string or an array.
Input 1 (the previous example):
Alternate output 1 (array):
RR,WR //Or an array, whichever you want
WY',Wy,YY',Yy //Once again, an array is fine