// JavaScript Document if (ls_s[1, 1] != "" && ls_d[1, 1] != "") // enkel rekenen als vader en moeder ingevuld zijn { for (li_v = 1; li_v <= 6; li_v++) { for (li_y = 1; li_y <= 32; li_y++) { if (ls_s[li_v, li_y] != "") { for (li_w = 1; li_w <= 6; li_w++) { for (li_z = 1; li_z <= 32; li_z++) { if (ls_s[li_v, li_y] == ls_d[li_w, li_z]) { li_ret = inteelt_controle(li_v, li_y, li_w, li_z); if (li_ret == 1) { li_coef = 1 + li_v - 1 + li_w - 1; ld_hulp = Math.Pow(2, li_coef); ld_inbreeding = ld_inbreeding + ((1 / ld_hulp) * 100); } } } } } } } } public int inteelt_controle(int al_x1, int al_y1, int al_x2, int al_y2) { string ls_links1, ls_links2; decimal ld_hulp, ld_hulp2; int li_getal; if (al_x1 == 1) { ls_links1 = ""; } else { // probleem bij afronden 0.5 moet 1 worden, 3.5 moet 4 worden ect... ld_hulp2 = Convert.ToDecimal(al_y1); ld_hulp = (ld_hulp2 / 2); ld_hulp = Math.Round(ld_hulp, MidpointRounding.AwayFromZero); li_getal = Convert.ToInt32(ld_hulp); ls_links1 = ls_s[al_x1 - 1, li_getal]; } if (al_x2 == 1) { ls_links2 = ""; } else { ld_hulp2 = Convert.ToDecimal(al_y2); ld_hulp = (ld_hulp2 / 2); ld_hulp = Math.Round(ld_hulp, MidpointRounding.AwayFromZero); li_getal = Convert.ToInt32(ld_hulp); ls_links2 = ls_d[al_x2 - 1, li_getal]; } if (ls_links1 == ls_links2 && (ls_links1 != "" || ls_links2 != "")) { return 0; } else { return 1; } }