THE CODING SEQUENCES

using System;
using System.Collections.Generic;
using System.Windows.Forms;

namespace Super_Duper_HIV_Pirahna
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
string HIV = System.IO.File.ReadAllText(@"C:\Users\Maxim\Desktop\Projets_2018_Nov\Projets_2018\Biologie\hiv\HIV2.txt");
string P42 = System.IO.File.ReadAllText(@"C:\Users\Maxim\Desktop\Projets_2018_Nov\Projets_2018\Biologie\hiv\p42.txt");

int div = P42.Length;

int coincidence = 0;
int codon = 0;
int maxFit = 0;
int maxLength = 0;
int position = 0;
List jump = new List();
int totalJump = 0;
bool lastone = true;


for (int i = 0; i < HIV.Length - P42.Length; i++)
{
//for (int k = 0; k < HIV.Length - i; k++)
{
int tmp = 0;
jump.Clear();

for (int j = 0; j < P42.Length + tmp; j++)
{
tmp = 0;
foreach (int inte in jump)
tmp += inte;

if (i + j + tmp >= HIV.Length) break;

if (HIV[i + j + tmp] == P42[j - tmp])
{
coincidence++;
lastone = true;
}
else
{
if (lastone == true)
{
totalJump++;
lastone = false;
}
if (totalJump > jump.Count)
{
jump.Add(1);
}
else
{
jump[totalJump-1]++;
if (jump[totalJump-1] > 20)
{
//MessageBox.Show(jump.Count.ToString());
break;
}
}
}
}

if (coincidence > maxFit)
{
maxFit = coincidence;
position = i;
maxLength = tmp + P42.Length;
}
coincidence = 0;
}