class Fly
{
char allheles[][] = new char[4][2];
private char sex, generation;
int cross;
public Fly(char g, char s, int c) {
sex = s;
generation = g;
cross = c;
//Assign sex
allheles[0][0] = 'X';
if (sex == 'F')
allheles[0][1] = 'X';
else if (sex == 'M')
allheles[0][1] = 'Y';
if (generation == 'P') {
switch(cross) {
case 1 : AssignCross1(); break;
case 2 : AssignCross2(); break;
case 3 : AssignCross3(); break;
case 4 : AssignCross4(); break;
}
}
if (generation == 'F') {
switch(cross) {
case 1 : AssignCross5(); break;
case 2 : AssignCross6(); break;
case 3 : AssignCross7(); break;
case 4 : AssignCross8(); break;
}
}
}
public void AssignCross1() {
if (sex == 'M') {
allheles[1][0] = 'R';
allheles[1][1] = 'R';
allheles[2][0] = 'W';
allheles[2][1] = 'W';
allheles[3][0] = 'B';
allheles[3][1] = 'B';
}
else if (sex == 'F') {
allheles[1][0] = 'r';
allheles[1][1] = 'r';
allheles[2][0] = 'W';
allheles[2][1] = 'W';
allheles[3][0] = 'B';
allheles[3][1] = 'B';
}
}
public void AssignCross2() {
if (sex == 'M') {
allheles[1][0] = 's';
allheles[1][1] = 's';
allheles[2][0] = 'W';
allheles[2][1] = 'W';
allheles[3][0] = 'B';
allheles[3][1] = 'B';
}
else if (sex == 'F') {
allheles[1][0] = 'R';
allheles[1][1] = 's';
allheles[2][0] = 'W';
allheles[2][1] = 'W';
allheles[3][0] = 'B';
allheles[3][1] = 'B';
}
}
public void AssignCross3() {
if (sex == 'M') {
allheles[1][0] = 'R';
allheles[1][1] = 'R';
allheles[2][0] = 'w';
allheles[2][1] = 'w';
allheles[3][0] = 'B';
allheles[3][1] = 'B';
}
else if (sex == 'F') {
allheles[1][0] = 'r';
allheles[1][1] = 'r';
allheles[2][0] = 'W';
allheles[2][1] = 'W';
allheles[3][0] = 'B';
allheles[3][1] = 'B';
}
}
public void AssignCross4() {
if (sex == 'M') {
allheles[1][0] = 'R';
allheles[1][1] = 'R';
allheles[2][0] = 'w';
allheles[2][1] = 'w';
allheles[3][0] = 'B';
allheles[3][1] = 'B';
}
else if (sex == 'F') {
allheles[1][0] = 'R';
allheles[1][1] = 'R';
allheles[2][0] = 'W';
allheles[2][1] = 'W';
allheles[3][0] = 'b';
allheles[3][1] = 'b';
}
}
public void AssignCross5() {
if (sex == 'M') {
allheles[1][0] = 'R';
allheles[1][1] = 'r';
allheles[2][0] = 'W';
allheles[2][1] = 'W';
allheles[3][0] = 'B';
allheles[3][1] = 'B';
}
else if (sex == 'F') {
allheles[1][0] = 'R';
allheles[1][1] = 'r';
allheles[2][0] = 'W';
allheles[2][1] = 'W';
allheles[3][0] = 'B';
allheles[3][1] = 'B';
}
}
public void AssignCross6() {
if (sex == 'M') {
allheles[1][0] = 's';
allheles[1][1] = 's';
allheles[2][0] = 'W';
allheles[2][1] = 'W';
allheles[3][0] = 'B';
allheles[3][1] = 'B';
}
else if (sex == 'F') {
allheles[1][0] = 'R';
allheles[1][1] = 's';
allheles[2][0] = 'W';
allheles[2][1] = 'W';
allheles[3][0] = 'B';
allheles[3][1] = 'B';
}
}
public void AssignCross7() {
if (sex == 'M') {
allheles[1][0] = 'R';
allheles[1][1] = 'r';
allheles[2][0] = 'W';
allheles[2][1] = 'w';
allheles[3][0] = 'B';
allheles[3][1] = 'B';
}
else if (sex == 'F') {
allheles[1][0] = 'R';
allheles[1][1] = 'r';
allheles[2][0] = 'W';
allheles[2][1] = 'w';
allheles[3][0] = 'B';
allheles[3][1] = 'B';
}
}
public void AssignCross8() {
if (sex == 'M') {
allheles[1][0] = 'R';
allheles[1][1] = 'R';
allheles[2][0] = 'W';
allheles[2][1] = 'w';
allheles[3][0] = 'B';
allheles[3][1] = 'b';
}
else if (sex == 'F') {
allheles[1][0] = 'R';
allheles[1][1] = 'R';
allheles[2][0] = 'W';
allheles[2][1] = 'w';
allheles[3][0] = 'B';
allheles[3][1] = 'b';
}
}