I'm doing a punnett square and putting the output into a list.
I want to compare the output to the list and if exists; update the count in the list.
I'm new to C# and don't fully understand lists/collections.
pseudo code:
if (color) != (ColorList)
{append to list}
else {ColorList (ColorCount)++}
Code:
namespace Genetics
{
public class Colors{
public String Name { get; set; }
public int ColorCount { get; set; }
}
class Genetics
{
static void Main(string[] args)
{
int value;
var coloList = new List<Colors>();
// Sire & Dam & Offspring Geneotype single dimensional array
int[] sire;
int[] dam;
int[] offspring;
// columns fields: 0;1= Broken 2;3 = Agouti 4;5 = Brown 6;7 = Colour 8;9= Dilute 10;11 = Extension 12;13= Vienna
sire = new int[14];
dam = new int[14];
offspring = new int[14];
// mutiple dimension array
const int rows = 128 ;
const int columns = 7 ; // 0 = En 1 = A 2 = B 3 = C 4 = D 5 = E 6 = V //
int [,] siredata = new int[rows,columns];
int [,] damdata = new int[rows,columns];
void child_setup()
// populate offspring array //
{
damcounter=0;
sirecounter=0;
offspringcounter=0;
While (damcounter <= 119);
{
While (sirecounter <=119);
{
REW_setup();
Vienna_setup();
Extension_setup();
Dilute_setup();
Colour_setup();
Brown_setup();
Agout_setup();
Broken_setup();
offspring_colour();
offspringcounter++;
sirecounter++; }
damcounter++; }
// end loop
return;
}