verseny[pelda_,pelda2_, abc__]:=Module[{l1=StringLength[pelda],l2=StringLength[pelda2],g={},f = {}, str1 = "",v=0, i =0,e=0,j=0,k=0,w=0},
str1 = StringJoin[RandomChoice[abc,(Length[abc])^l1]];
While[(StringPosition[str1,pelda]== {}) || (StringPosition[str1,pelda2]== {}) ,str1 = StringJoin[{str1,StringJoin[RandomChoice[abc,(Length[abc])^l1]]}];i = i + 1];
v=StringPosition[str1,pelda][[1,2]];
w=StringPosition[str1,pelda2][[1,2]];
If[v<w,e=1,e=0];
Append[Append[Append[{},v],w],e]
]

verseny["BAB","A",{"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"}]

szim[p1_,p2_,abc__]:=Module[{},
Sum[verseny[p1,p2,abc],{i,1000}]/1000
]

tigris[pelda_,pelda2_,szam__]:=Module[{q=0,r=0,s=0,eredmeny={},abc="",nagyabc={"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"}},
abc = Take[nagyabc,szam];
q=szim[pelda,pelda2,abc];
q[[3]]=q[[3]]*100;
Map[N,q]
]

ClearAll[d]
d=Timing[tigris["BAB","AB",26]]

FromCharacterCode[Range[65,90]]

Characters[%100]

FullForm[%]