He cambiado el código a esto:
Código Delphi
[-]
procedure TForm1.Button10Click(Sender: TObject);
var
cad1:Int64;
i:integer;
begin
with per do
for i := 0 to Count -1 do
begin
ItemIndex := i;
list.delimitedText:=Items[i];
cad1:= ValorCombinacion(list);
buscarComunes(cad1);
end;
Buscar Comunes
Código Delphi
[-]procedure TForm1.buscarComunes(const Cad1:Int64);
var
cad2:Int64;
j:integer;
begin
with lista3 do
for j := 0 to Items.Count -1 do
begin
lista3.Selected:= items[j];
list.delimitedText:= items.Item[j].SubItems[0]+ ' '+
items.Item[j].SubItems[1]+ ' '+
items.Item[j].SubItems[2]+ ' '+
items.Item[j].SubItems[3]+ ' '+
items.Item[j].SubItems[4]+ ' '+
items.Item[j].SubItems[5];
cad2 := ValorCombinacion(list);
CompararCombinaciones(cad1, cad2);
end;
end;
Código Delphi
[-]procedure TForm1.CompararCombinaciones(const Cad1, cad2:Int64);
var
res:Int64;
comunes:string;
begin
label21.Caption:= IntToStr(cad1);
res:=cad1 and cad2;
if (cad1 = cad2) then begin
ShowMessage('Iguales');
exit;
end
end;
Parece que recorre la lista3 y lo compara con per pero incluso habiendo una combinación real de 5 aciertos sigue sin encontrarla, además el proceso es eterno, tarda como 1 seg. por cada comparacion y eso que solo son 120 permutaciones, cuando sean 720 y 50.000 combinaciones aleatorias... no sería factible creo.
Un saludo.