Весьма актуален для лоу-уровней росвара, из-за того, что за блекджек дают попытку выиграть различные игровые ресурсы.
И выиграть там не просто. Десятка "счастливчиков" казино никогда не играет сама. Аякс-скрипт делает за них всю работу, выигрывая до 1000000 фишек и более. Ведь если играть без скрипта или бота, и за 1 минуту выигрывать 10 раз (например), то при максимально доступной ставке в 200 фишек, за 1 час удастся выиграть 60 х 10 х 400 = 240000 фишек. Очень сомнительно, что кто-то сидит по 3-4 часа кликая мышкой.
Мне неизвестно, каким образом настроен рандом в блекджеке. Но, по моим наблюдениям, он явно благоволит к дилерше, подбрасывая ей тузы с десятками гораздо чаще, чем игроку.
Я решил сымитировать игру, составив программу, использующую генератор случайных чисел. Правила игры взял из википедии, но с ограничением, что разбивать одинаковые пары карт (сплитовать) можно только один раз в одной сдаче карт. Также я посчитал лишним учить программу удваивать и страховать ставку.
Работает программа следующим образом. Вводятся исходные данные: количество колод по 52 карты, первоначальное количество фишек у игрока, ставка, до скольких фишек должен добирать дилер и игрок, парные карты какого достоинства нужно разбивать, количество повторных игр, условие возврата сыгранных карт обратно в колоды . После чего начинается "игра". Игра заканчивается после того, как игрок проигрывает все свои фишки. Если количество повторных игр было задано больше одной, то начинается следующая игра.
Исходные данные таковы:
В игре 6 колод карт, исходное количество фишек равно 5000, ставка - 50 фишек, дилер играет не меньше 17 очков, игрок вначале играет не менее 12 очков, проигрывая свои 5000 фишек по 1000 раз, затем - не менее 13 очков ещё 1000 раз, и так до 21 очка включительно.
Вот, что насчитала программа ("перемешивание после 2/3" означает, что после того как сыграно 2/3 от количества карт из машинки дилера, производится заполнение машинки заново):
Выводы (если бы дилерша играла по вышеуказанному алгоритму) :
1. Средний процент выигрыша блекджека от 4,6% до 6,4% , или один блекджек на 16...22 сдач карт. В абсолютных значениях это 70...85 блекджеков. В реальности, играя скриптом от Контры, я получаю немного меньшие цифры - около 50...60 блекджеков, и очень редко около 100 блекджеков.
2. Наибольшее количество блекджеков в среднем можно выиграть, если играть от 14 до 16 очков, с разбиванием парных тузов и десяток.
3. Количество блекджеков у дилерши и игрока в среднем одинаково, если игрок не разбивает парные карты. Количество блекджеков у игрока превышает количество блекджеков у дилерши почти на 50% , если игрок разбивает парные карты.
4. Количество 10 или тузов, выпадающих первой картой дилерше и игроку, почти одинаково.
ниже приводится текст программы на турбо паскале
program black;
uses crt;
var ft: text;
fileout: string[14];
i: longint;
a: array[1..416] of word;
pereb_igr, pobed_igr, t10_igr, t10_dil, perv10_igr, perv10_dil, sdachi: array[1..1000] of word;
srednee_t10_igr: array[1..1000] of real;
soxr_file: array[1..24, 12..21] of real;
igrok_mast, igrok_b_mast, diller_mast, igrok, igrok_b, diler: array[1..11] of byte;
mast, trig_t, kolod, trig, stavka, nkart_igrok, nkart_igrok_b, nkart_dil, kol_tuz: byte;
max_ochki_igroka, max_ochki_dilera, d, karta, sum_fishek_igr, sum_fishek_igr_b: byte;
sum_fishek_igr_b_tuz, sum_fishek_igr_tuz, sum_fishek_dil, sum_fishek_dil_tuz: byte;
pechfile, ag, ekr, itogekr, razbivka, t10_y_igroka, t10_y_igroka_b, t10_y_dillera: byte;
razbiv10t, razbiv99, razbiv88, razbiv77, razbiv66, razbiv55, razbiv44, razbiv33, razbiv22: byte;
tas, vse, fileinfo, p, r, povtor, vsego_kart, key: word;
fishki, fishki_change, c: word;
procedure vibor_kart(kto:byte; var card, masti:byte);
begin
repeat (* iskluchenie povtornogo vibora kart *)
c:=random(vsego_kart)+1;
if tas=2 then begin
if key>=vsego_kart-3 then
for i:=1 to vsego_kart do if a[i]=0 then c:=i;
if key>=vsego_kart then begin
key:=0; (* KOH4I/\ICb KAPTbI - HOBbIE KO/\ODbI *)
for i:=1 to vsego_kart do a[i]:=0;
end;
end;
if tas=1 then begin
if ((kolod=1) and (sum_fishek_dil=0)) or
((key>=69) and (vsego_kart=104)) or
((key>=104) and (vsego_kart=156)) or
((key>=139) and (vsego_kart=208)) or
((key>=174) and (vsego_kart=260)) or
((key>=208) and (vsego_kart=312)) or
((key>=243) and (vsego_kart=364)) or
((key>=277) and (vsego_kart=416)) then begin
key:=0; (* OCTA/\OCb 1/3 OT BCEX KAPT - HOBbIE KO/\ODbI *)
for i:=1 to vsego_kart do a[i]:=0;
end;
end;
if a[c]=0 then begin
a[c]:=1;
trig:=1;
inc(key);
end
else trig:=0;
until trig=1;
d:=0; {dlya opredeleniya masti }
if c>13 then repeat
c:=c-13;
inc(d);
until c<=13;
if d in [0,4,8,12,16,20] then mast:=1; {piki}
if d in [1,5,9,13,17,21] then mast:=2; {bub}
if d in [2,6,10,14,18,22] then mast:=3; {krest}
if d in [3,7,11,15,19,23] then mast:=4; {cherv}
card:=c+1; {formirovanie massiva kart igroka}
masti:=mast;
if kto=1 then begin
sum_fishek_igr:=0;
sum_fishek_igr_tuz:=0;
for i:=1 to nkart_igrok do begin
if igrok[i] in [2,3,4,5,6,7,8,9,10] then sum_fishek_igr:=sum_fishek_igr+igrok[i];
if igrok[i] in [11,12,13] then sum_fishek_igr:=sum_fishek_igr+10;
if igrok[i]=14 then sum_fishek_igr:=sum_fishek_igr+11;
if igrok[i] in [2,3,4,5,6,7,8,9,10] then sum_fishek_igr_tuz:=sum_fishek_igr_tuz+igrok[i];
if igrok[i] in [11,12,13] then sum_fishek_igr_tuz:=sum_fishek_igr_tuz+10;
if igrok[i]=14 then sum_fishek_igr_tuz:=sum_fishek_igr_tuz+1;
end;
kol_tuz:=0;
for i:=1 to nkart_igrok do begin
if igrok[i]=14 then inc(kol_tuz);
end;
if kol_tuz>1 then sum_fishek_igr:=sum_fishek_igr-((kol_tuz-1)*10);
if kol_tuz=0 then sum_fishek_igr_tuz:=0;
if (sum_fishek_igr_tuz<22) and (sum_fishek_igr_tuz>=max_ochki_igroka) then sum_fishek_igr:=sum_fishek_igr_tuz;
if (sum_fishek_igr>21) and (sum_fishek_igr_tuz<22) and (sum_fishek_igr_tuz>0) then sum_fishek_igr:=sum_fishek_igr_tuz;
if (sum_fishek_igr>21) and (sum_fishek_igr_tuz>21) then sum_fishek_igr:=sum_fishek_igr_tuz;
end;
if kto=2 then begin
sum_fishek_igr_b:=0;
sum_fishek_igr_b_tuz:=0;
for i:=1 to nkart_igrok_b do begin
if igrok_b[i] in [2,3,4,5,6,7,8,9,10] then sum_fishek_igr_b:=sum_fishek_igr_b+igrok_b[i];
if igrok_b[i] in [11,12,13] then sum_fishek_igr_b:=sum_fishek_igr_b+10;
if igrok_b[i]=14 then sum_fishek_igr_b:=sum_fishek_igr_b+11;
if igrok_b[i] in [2,3,4,5,6,7,8,9,10] then sum_fishek_igr_b_tuz:=sum_fishek_igr_b_tuz+igrok_b[i];
if igrok_b[i] in [11,12,13] then sum_fishek_igr_b_tuz:=sum_fishek_igr_b_tuz+10;
if igrok_b[i]=14 then sum_fishek_igr_b_tuz:=sum_fishek_igr_b_tuz+1;
end;
kol_tuz:=0;
for i:=1 to nkart_igrok_b do begin
if igrok_b[i]=14 then inc(kol_tuz);
end;
if kol_tuz>1 then sum_fishek_igr_b:=sum_fishek_igr_b-((kol_tuz-1)*10);
if kol_tuz=0 then sum_fishek_igr_b_tuz:=0;
if (sum_fishek_igr_b_tuz<22) and (sum_fishek_igr_b_tuz>=max_ochki_igroka) then sum_fishek_igr_b:=sum_fishek_igr_b_tuz;
if (sum_fishek_igr_b>21) and (sum_fishek_igr_b_tuz<22) and (sum_fishek_igr_b_tuz>0)
then sum_fishek_igr_b:=sum_fishek_igr_b_tuz;
if (sum_fishek_igr_b>21) and (sum_fishek_igr_b_tuz>21) then sum_fishek_igr_b:=sum_fishek_igr_b_tuz;
end;
if kto=0 then begin
sum_fishek_dil:=0;
sum_fishek_dil_tuz:=0;
for i:=1 to nkart_dil do begin
if diler[i] in [2,3,4,5,6,7,8,9,10] then sum_fishek_dil:=sum_fishek_dil+diler[i];
if diler[i] in [11,12,13] then sum_fishek_dil:=sum_fishek_dil+10;
if diler[i]=14 then sum_fishek_dil:=sum_fishek_dil+11;
if diler[i] in [2,3,4,5,6,7,8,9,10] then sum_fishek_dil_tuz:=sum_fishek_dil_tuz+diler[i];
if diler[i] in [11,12,13] then sum_fishek_dil_tuz:=sum_fishek_dil_tuz+10;
if diler[i]=14 then sum_fishek_dil_tuz:=sum_fishek_dil_tuz+1;
end;
kol_tuz:=0;
for i:=1 to nkart_dil do begin
if diler[i]=14 then inc(kol_tuz);
end;
if kol_tuz>1 then sum_fishek_dil:=sum_fishek_dil-((kol_tuz-1)*10);
if (sum_fishek_dil>21) and (sum_fishek_dil_tuz<22) and (sum_fishek_dil_tuz>0) then sum_fishek_dil:=sum_fishek_dil_tuz;
if kol_tuz=0 then sum_fishek_dil_tuz:=0;
if (sum_fishek_dil_tuz<22) and (sum_fishek_dil_tuz>=max_ochki_dilera) then sum_fishek_dil:=sum_fishek_dil_tuz;
if (sum_fishek_dil_tuz>21) and (sum_fishek_dil>21) then sum_fishek_dil:=sum_fishek_dil_tuz;
end;
end;
procedure pechat;
begin
clrscr;
write('DILER ');
for i:=1 to 11 do begin
if diler[i]=14 then write('T');
if diler[i]=13 then write('K');
if diler[i]=12 then write('D');
if diler[i]=11 then write('B');
if diler[i] in [2, 3, 4, 5, 6, 7, 8, 9, 10] then write(diler[i]);
if diler[i]=0 then write(' ');
if diller_mast[i]=1 then write('p ');
if diller_mast[i]=2 then write('b ');
if diller_mast[i]=3 then write('+ ');
if diller_mast[i]=4 then write('c ');
end;
if (sum_fishek_dil_tuz > 0) and (sum_fishek_dil < 22) and (sum_fishek_dil_tuz <> sum_fishek_dil)
then writeln(sum_fishek_dil_tuz,'/',sum_fishek_dil)
else writeln(sum_fishek_dil);
writeln;
write('IGROK ');
for i:=1 to 11 do begin
if igrok[i]=14 then write('T');
if igrok[i]=13 then write('K');
if igrok[i]=12 then write('D');
if igrok[i]=11 then write('B');
if igrok[i] in [2, 3, 4, 5, 6, 7, 8, 9, 10] then write(igrok[i]);
if igrok[i]=0 then write(' ');
if igrok_mast[i]=1 then write('p ');
if igrok_mast[i]=2 then write('b ');
if igrok_mast[i]=3 then write('+ ');
if igrok_mast[i]=4 then write('c ');
end;
if (sum_fishek_igr_tuz > 0) and (sum_fishek_igr < 22) and (sum_fishek_igr_tuz <> sum_fishek_igr)
then writeln(sum_fishek_igr_tuz,'/',sum_fishek_igr,' fishek OCTA/\OCb ',fishki_change )
else writeln(sum_fishek_igr,' fishek OCTA/\OCb ',fishki_change );
writeln;
write(' ');
for i:=1 to 11 do begin
if igrok_b[i]=14 then write('T');
if igrok_b[i]=13 then write('K');
if igrok_b[i]=12 then write('D');
if igrok_b[i]=11 then write('B');
if igrok_b[i] in [2, 3, 4, 5, 6, 7, 8, 9, 10] then write(igrok_b[i]);
if igrok_b[i]=0 then write(' ');
if igrok_b_mast[i]=1 then write('p ');
if igrok_b_mast[i]=2 then write('b ');
if igrok_b_mast[i]=3 then write('+ ');
if igrok_b_mast[i]=4 then write('c ');
end;
if igrok_b[1]>0 then begin
if (sum_fishek_igr_b_tuz > 0) and (sum_fishek_igr_b < 22) and (sum_fishek_igr_b_tuz <> sum_fishek_igr_b)
then writeln(sum_fishek_igr_b_tuz,'/',sum_fishek_igr_b)
else writeln(sum_fishek_igr_b );
end;
write('BCEGO BLACK_JACK ', t10_igr[p]);
write(' BCEGO CDA4 ',sdachi[p]);
delay(50000);delay(50000);delay(50000); delay(50000);
end;
begin
repeat;
clrscr;
repeat
write('CKO/\bKO B igre KO/\OD po 52 KAPT ? 1, 2, 3, 4, 5, 6, 7, 8 ? ');
readln(kolod);
until kolod in [1,2,3,4,5,6,7,8];
if kolod>1 then begin
repeat
writeln(' KOGDA TACOBATb KO/\ODbI ? ');
writeln(' 1 - KOGDA CbIGPAHO 2/3 OT BCEX KAPT, 2 - KOGDA CbIGPAHbI BCE KAPTbI ');
readln(tas);
until tas in [1,2];
end;
if kolod=1 then tas:=1;
vsego_kart:=kolod*52;
write('CKO/\bKO MEHjaTb fishek B HA4A/\E IGPbI ? 5000? (OT 200 DO 64000) ');
readln(fishki);
repeat
write('velichina CTABKi 10, 20, 30, 50, 100, 200 ? ');
readln(stavka);
until stavka in [10, 20, 30, 50, 100, 200];
repeat
writeln(' xotite proverjat vse podrjad ? ');
writeln(' ( kogda igrok posledovatelno igraet, dobiraja ot 12 do 21 ochkov )');
writeln(' ( 1 - da , 2 - net ) ');
write(' esli vibor "da", to zhelatelno rezyltati soxranit v fail ');
readln(vse);
until vse in [1, 2];
if vse=1 then max_ochki_igroka:=12;
if vse=2 then begin
repeat
write('DO CKO/\bKiX O4KOB MAKCI/IMA/\bHO HA6iPATb IGPOKY? ( OT 12 DO 21 ) ');
readln(max_ochki_igroka);
until max_ochki_igroka in [12, 13, 14, 15, 16, 17, 18, 19, 20, 21];
end;
repeat
write('DO CKO/\bKiX O4KOB MAKCI/IMA/\bHO HA6iPATb DI/\EPY ? ( OT 12 DO 21 ) ');
readln(max_ochki_dilera);
until max_ochki_dilera in [12, 13, 14, 15, 16, 17, 18, 19, 20, 21];
repeat
write('razbivat pari kart ? ( 1 - da, 2 - net ) ');
readln(razbivka);
until razbivka in [1, 2];
if razbivka=1 then begin
write('razbivat pari T-T i 10-10 ? ( 1 - da, 2 - net ) ');
readln(razbiv10t);
write('razbivat pari 9-9 ? ( 1 - da, 2 - net ) ');
readln(razbiv99);
write('razbivat pari 8-8 ? ( 1 - da, 2 - net ) ');
readln(razbiv88);
write('razbivat pari 7-7 ? ( 1 - da, 2 - net ) ');
readln(razbiv77);
write('razbivat pari 6-6 ? ( 1 - da, 2 - net ) ');
readln(razbiv66);
write('razbivat pari 5-5 ? ( 1 - da, 2 - net ) ');
readln(razbiv55);
write('razbivat pari 4-4 ? ( 1 - da, 2 - net ) ');
readln(razbiv44);
write('razbivat pari 3-3 ? ( 1 - da, 2 - net ) ');
readln(razbiv33);
write('razbivat pari 2-2 ? ( 1 - da, 2 - net ) ');
readln(razbiv22);
end;
repeat
write('CKO/\bKO PA3 POBTOPi/iTb (HE > 1000) ? ');
readln(povtor);
if (povtor < 1) or (povtor > 1000) then povtor:=0;
until povtor>0;
repeat
writeln('vivodit na ekran kazdyiy sdachy kart ? ( 1 - da, 2 - net ) ');
write('( vivod na ekran silno zamedljaet vichislenija ) ');
readln(ekr);
until ekr in [1, 2];
repeat
write(' vivodit na ekran obshie itogi :');
write(' maksimalnie, minimalnie i srednie znachenija ? ( 1 - da, 2- net ) ');
readln(itogekr);
until itogekr in [1, 2];
repeat
write(' soxranjat rezyltati v fail ? ( 1 - da, 2 - net ) ');
readln(pechfile);
until pechfile in [1, 2];
if pechfile=1 then begin
repeat
write(' chto soxranit v fail ? ( 1 - tolko obshie itogi , 2 - vse rezyltati ) ');
readln(fileinfo);
until fileinfo in [1, 2];
write(' vvedite imja faila (ne bolee 8 simvolov, rasshirenie .txt ) ');
readln(fileout);
end;
randomize;
if pechfile=1 then begin
assign(ft, fileout);
rewrite(ft);
end;
repeat
for p:=1 to povtor do begin
pereb_igr[p]:=0;
pobed_igr[p]:=0;
t10_igr[p]:=0;
t10_dil[p]:=0;
perv10_igr[p]:=0;
perv10_dil[p]:=0;
sdachi[p]:=0;
end;
for i:=1 to 416 do a[i]:=0;
key:=0;
for p:=1 to povtor do begin
fishki_change:=fishki;
while fishki_change>0 do begin {povtor poka ne konchatsya fishki}
sum_fishek_igr:=0; {summa fishek y igroka v tekyshei sdache}
sum_fishek_igr_b:=0;
sum_fishek_dil:=0; {summa fishek y dillera v tekyshei sdache}
sum_fishek_igr_tuz:=0; { summa fishek kogda est' tyz }
sum_fishek_igr_b_tuz:=0;
sum_fishek_dil_tuz:=0;
inc(sdachi[p]);
for i:=1 to 11 do begin
diler[i]:=0;
igrok[i]:=0;
igrok_b[i]:=0;
igrok_mast[i]:=0;
igrok_b_mast[i]:=0;
diller_mast[i]:=0;
end;
fishki_change:=fishki_change-stavka;
nkart_igrok:=1;
nkart_dil:=1;
vibor_kart(0,diler[1],diller_mast[1]); {pervaja sdacha dilery}
vibor_kart(1,igrok[1],igrok_mast[1]);
if diler[1] in [10, 11, 12, 13, 14] then inc(perv10_dil[p]);
if igrok[1] in [10, 11, 12, 13, 14] then inc(perv10_igr[p]);
if ekr=1 then pechat;
nkart_igrok:=2;
nkart_dil:=2;
vibor_kart(0,diler[2],diller_mast[2]);
vibor_kart(1,igrok[2],igrok_mast[2]);
{kogda pervie dve karti nado razbivat' }
if (razbivka=1) and (fishki_change>=stavka) and
( ((razbiv10t=1) and (igrok[1] in [10, 11, 12, 13]) and (igrok[2] in [10, 11, 12, 13])) or
((igrok[1]=igrok[2]) and (razbiv10t=1) and (igrok[1]=14)) or
((igrok[1]=igrok[2]) and (razbiv99=1) and (igrok[1]=9)) or
((igrok[1]=igrok[2]) and (razbiv88=1) and (igrok[1]=8)) or
((igrok[1]=igrok[2]) and (razbiv77=1) and (igrok[1]=7)) or
((igrok[1]=igrok[2]) and (razbiv66=1) and (igrok[1]=6)) or
((igrok[1]=igrok[2]) and (razbiv55=1) and (igrok[1]=5)) or
((igrok[1]=igrok[2]) and (razbiv44=1) and (igrok[1]=4)) or
((igrok[1]=igrok[2]) and (razbiv33=1) and (igrok[1]=3)) or
((igrok[1]=igrok[2]) and (razbiv22=1) and (igrok[1]=2)) )
then begin
nkart_igrok:=2;
nkart_igrok_b:=2;
igrok_b[1]:=igrok[2];
igrok_b_mast[1]:=igrok_mast[2];
fishki_change:=fishki_change-stavka;
vibor_kart(1,igrok[2],igrok_mast[2]);
vibor_kart(2,igrok_b[2],igrok_b_mast[2]);
end;
t10_y_dillera:=0;
if ((diler[1]=14) and (diler[2] in [10, 11, 12, 13])) or
((diler[2]=14) and (diler[1] in [10, 11, 12, 13]))
then begin
inc(t10_y_dillera);
sum_fishek_dil:=21;
sum_fishek_dil_tuz:=0;
inc(t10_dil[p]);
end;
t10_y_igroka:=0; {kogda pervie dve karti T + 10 }
if ((igrok[1]=14) and (igrok[2] in [10, 11, 12, 13])) or
((igrok[2]=14) and (igrok[1] in [10, 11, 12, 13]))
then begin
inc(t10_y_igroka);
sum_fishek_igr:=21;
sum_fishek_igr_tuz:=0;
if (t10_y_dillera=0) and (stavka=50) then fishki_change:=fishki_change+25; {priz za blackjack}
if (t10_y_dillera=0) and (stavka=100) then fishki_change:=fishki_change+50;
if (t10_y_dillera=0) and (stavka=200) then fishki_change:=fishki_change+100;
inc(t10_igr[p]);
end;
t10_y_igroka_b:=0; {kogda pervie dve karti T + 10 }
if ((igrok_b[1]=14) and (igrok_b[2] in [10, 11, 12, 13])) or
((igrok_b[2]=14) and (igrok_b[1] in [10, 11, 12, 13]))
then begin
inc(t10_y_igroka_b);
sum_fishek_igr_b:=21;
sum_fishek_igr_b_tuz:=0;
if (t10_y_dillera=0) and (stavka=50) then fishki_change:=fishki_change+25; {priz za blackjack}
if (t10_y_dillera=0) and (stavka=100) then fishki_change:=fishki_change+50;
if (t10_y_dillera=0) and (stavka=200) then fishki_change:=fishki_change+100;
inc(t10_igr[p]);
end;
if ekr=1 then pechat;
if ((razbivka=1) and (igrok_b[1]<>14)) or (razbivka=2) then begin
while sum_fishek_igr < max_ochki_igroka do
begin
inc(nkart_igrok);
vibor_kart(1,igrok[nkart_igrok],igrok_mast[nkart_igrok]);
if ekr=1 then pechat;
end; {prodolzhat nabor kart poka summa kart ne stanet >= maksimalnoi }
end;
if (razbivka=1) and (igrok_b[2]>0) and (igrok_b[1]<>14) then begin
while sum_fishek_igr_b < max_ochki_igroka do
begin
inc(nkart_igrok_b);
vibor_kart(2,igrok_b[nkart_igrok_b],igrok_b_mast[nkart_igrok_b]);
if ekr=1 then pechat;
end; {prodolzhat nabor kart poka summa kart ne stanet >= maksimalnoi }
end;
if (sum_fishek_igr <= 21) or ((sum_fishek_igr_b <= 21) and (igrok_b[1]>0))
then begin
while (sum_fishek_dil < max_ochki_dilera) do
begin
inc(nkart_dil);
vibor_kart(0,diler[nkart_dil],diller_mast[nkart_dil]);
if ekr=1 then pechat;
end;
end;
if sum_fishek_igr>21 then begin
inc(pereb_igr[p]);
if fishki_change<stavka then fishki_change:=0;
end;
if (sum_fishek_igr<=21) and ((sum_fishek_igr > sum_fishek_dil) or (sum_fishek_dil > 21)) then begin
fishki_change:=fishki_change+stavka+stavka;
inc(pobed_igr[p]);
end;
if (sum_fishek_igr = sum_fishek_dil) and (sum_fishek_igr<22) and (t10_y_igroka=0) and (t10_y_dillera=0)
then fishki_change:=fishki_change+stavka;
if (sum_fishek_igr_b = sum_fishek_dil) and (sum_fishek_dil<22) and (t10_y_igroka_b=0) and (t10_y_dillera=0)
then fishki_change:=fishki_change+stavka;
if (razbivka=1) and (sum_fishek_igr_b<=21) and (igrok_b[2]>0)
and ((sum_fishek_igr_b > sum_fishek_dil) or (sum_fishek_dil > 21))
then begin
fishki_change:=fishki_change+stavka+stavka;
inc(pobed_igr[p]);
end;
if (t10_y_igroka=1) and ((t10_y_dillera=0) and (sum_fishek_dil=21)) then begin
fishki_change:=fishki_change+stavka+stavka;
inc(pobed_igr[p]);
end;
if (t10_y_igroka_b=1) and ((t10_y_dillera=0) and (sum_fishek_dil=21)) then begin
fishki_change:=fishki_change+stavka+stavka;
inc(pobed_igr[p]);
end;
if fishki_change<stavka then fishki_change:=0;
if fishki_change> 64000 then begin
writeln('y igroka bolee 64000 fishek');
writeln('vozmozhni nekorrektnie rascheti.');
write(' to continie press ENTER key');
readln;
end;
end; {of while }
srednee_t10_igr[p]:=(t10_igr[p]/sdachi[p])*100;
clrscr;
writeln('igraem do ',max_ochki_igroka,' OCTA/\OCb CDA4 ', povtor-p);
end; {of for p:=1 }
if (itogekr=1) or (pechfile=1) then begin
for p:=1 to 24 do begin
if p in [2,5,8,11,14,17,20,23] then soxr_file[p, max_ochki_igroka]:=1000
else soxr_file[p, max_ochki_igroka]:=0;
end;
for p:=1 to povtor do begin
soxr_file[3, max_ochki_igroka]:=soxr_file[3, max_ochki_igroka]+sdachi[p];
soxr_file[6, max_ochki_igroka]:=soxr_file[6, max_ochki_igroka]+pobed_igr[p];
soxr_file[9, max_ochki_igroka]:=soxr_file[9, max_ochki_igroka]+pereb_igr[p];
soxr_file[12, max_ochki_igroka]:=soxr_file[12, max_ochki_igroka]+t10_igr[p];
soxr_file[15, max_ochki_igroka]:=soxr_file[15, max_ochki_igroka]+t10_dil[p];
soxr_file[18, max_ochki_igroka]:=soxr_file[18, max_ochki_igroka]+perv10_igr[p];
soxr_file[21, max_ochki_igroka]:=soxr_file[21, max_ochki_igroka]+perv10_dil[p];
soxr_file[24, max_ochki_igroka]:=soxr_file[24, max_ochki_igroka]+srednee_t10_igr[p];
if sdachi[p]>soxr_file[1, max_ochki_igroka] then soxr_file[1, max_ochki_igroka]:=sdachi[p];
if pobed_igr[p]>soxr_file[4, max_ochki_igroka] then soxr_file[4, max_ochki_igroka]:=pobed_igr[p];
if pereb_igr[p]>soxr_file[7, max_ochki_igroka] then soxr_file[7, max_ochki_igroka]:=pereb_igr[p];
if t10_igr[p]>soxr_file[10, max_ochki_igroka] then soxr_file[10, max_ochki_igroka]:=t10_igr[p];
if t10_dil[p]>soxr_file[13, max_ochki_igroka] then soxr_file[13, max_ochki_igroka]:=t10_dil[p];
if perv10_igr[p]>soxr_file[16, max_ochki_igroka] then soxr_file[16, max_ochki_igroka]:=perv10_igr[p];
if perv10_dil[p]>soxr_file[19, max_ochki_igroka] then soxr_file[19, max_ochki_igroka]:=perv10_dil[p];
if srednee_t10_igr[p]>soxr_file[22, max_ochki_igroka] then soxr_file[22, max_ochki_igroka]:=srednee_t10_igr[p];
if soxr_file[2, max_ochki_igroka]>sdachi[p] then soxr_file[2, max_ochki_igroka]:=sdachi[p];
if soxr_file[5, max_ochki_igroka]>pobed_igr[p] then soxr_file[5, max_ochki_igroka]:=pobed_igr[p];
if soxr_file[8, max_ochki_igroka]>pereb_igr[p] then soxr_file[8, max_ochki_igroka]:=pereb_igr[p];
if soxr_file[11, max_ochki_igroka]>t10_igr[p] then soxr_file[11, max_ochki_igroka]:=t10_igr[p];
if soxr_file[14, max_ochki_igroka]>t10_dil[p] then soxr_file[14, max_ochki_igroka]:=t10_dil[p];
if soxr_file[17, max_ochki_igroka]>perv10_igr[p] then soxr_file[17, max_ochki_igroka]:=perv10_igr[p];
if soxr_file[20, max_ochki_igroka]>perv10_dil[p] then soxr_file[20, max_ochki_igroka]:=perv10_dil[p];
if soxr_file[23, max_ochki_igroka]>srednee_t10_igr[p] then soxr_file[23, max_ochki_igroka]:=srednee_t10_igr[p];
end;
soxr_file[3, max_ochki_igroka]:=soxr_file[3, max_ochki_igroka]/povtor;
soxr_file[6, max_ochki_igroka]:=soxr_file[6, max_ochki_igroka]/povtor;
soxr_file[9, max_ochki_igroka]:=soxr_file[9, max_ochki_igroka]/povtor;
soxr_file[12, max_ochki_igroka]:=soxr_file[12, max_ochki_igroka]/povtor;
soxr_file[15, max_ochki_igroka]:=soxr_file[15, max_ochki_igroka]/povtor;
soxr_file[21, max_ochki_igroka]:=soxr_file[21, max_ochki_igroka]/povtor;
soxr_file[18, max_ochki_igroka]:=soxr_file[18, max_ochki_igroka]/povtor;
soxr_file[24, max_ochki_igroka]:=soxr_file[24, max_ochki_igroka]/povtor;
end; { of if itogiekr=1 or... (see line 476) }
if itogekr=1 then begin
writeln(' diler dobiraet do ',max_ochki_dilera);
for p:=1 to 24 do begin
if (p=1) and (vse<>1) then writeln('SDA4 ');
if (p=4) and (vse<>1) then writeln('WINS ');
if (p=7) and (vse<>1) then writeln('>21 ');
if (p=10) and (vse<>1) then writeln('T+10 you ');
if (p=13) and (vse<>1) then writeln('T+10 dil ');
if (p=16) and (vse<>1) then writeln('10 first you ');
if (p=19) and (vse<>1) then writeln('10 first dil ');
if (p=22) and (vse<>1) then writeln('T+10 % ');
if (p=1) and (vse=1) then writeln('SDA4 12 13 14 15 16 17 18 19 20 21');
if (p=4) and (vse=1) then writeln('WINS 12 13 14 15 16 17 18 19 20 21');
if (p=7) and (vse=1) then writeln('>21 12 13 14 15 16 17 18 19 20 21');
if (p=10) and (vse=1) then writeln('T+10 you 12 13 14 15 16 17 18 19 20 21');
if (p=13) and (vse=1) then writeln('T+10 dil 12 13 14 15 16 17 18 19 20 21');
if (p=16) and (vse=1) then writeln('10 firsr you 12 13 14 15 16 17 18 19 20 21');
if (p=19) and (vse=1) then writeln('10 first dil 12 13 14 15 16 17 18 19 20 21');
if (p=22) and (vse=1) then writeln('T+10 % 12 13 14 15 16 17 18 19 20 21');
if p in [1,4,7,10,13,16,19,22] then write('max ');
if p in [2,5,8,11,14,17,20,23] then write('min ');
if p in [3,6,9,12,15,18,21,24] then write('average ');
for r:=12 to 21 do begin
if vse<>1 then begin
if r=max_ochki_igroka then begin
if p in [22,23,24] then write(soxr_file[p,r]:2:1,' ')
else write(trunc(soxr_file[p,r]),' ');
end;
end;
if vse=1 then begin
if p in [22,23,24] then write(soxr_file[p,r]:2:1,' ')
else write(trunc(soxr_file[p,r]),' ');
end;
end; { of for r:=12 }
writeln;
end; { of for p:=1 }
end; { of if itogiekr = 1 }
if (pechfile=1) and (fileinfo=2) then begin
write (ft,'SDA4',#9,'WINS',#9,'> 21',#9,'T+10 you',#9,'T+10 you %',#9,'T+10 dil',#9);
write(ft,'10 first you',#9,'10 first dil',#9,#9,'igrok beret do ',max_ochki_igroka);
writeln(ft,'');
for p:=1 to povtor do begin
write(ft, sdachi[p],#9);
write(ft, pobed_igr[p],#9);
write(ft, pereb_igr[p],#9);
write(ft, t10_igr[p],#9);
write(ft, trunc(srednee_t10_igr[p]),',',(trunc(frac(srednee_t10_igr[p])*10)):1,#9);
write(ft, t10_dil[p],#9);
write(ft, perv10_igr[p],#9);
write(ft, perv10_dil[p]);
writeln(ft,'');
end;
end;
if vse=1 then inc(max_ochki_igroka) else max_ochki_igroka:=22;
until max_ochki_igroka=22;
if (pechfile=1) and (fileinfo=1) then begin
writeln(ft,' diler dobiraet do ',max_ochki_dilera, ' , CTABKA ',stavka,' , fishek ',fishki );
for p:=1 to 24 do begin
if (p=1) and (vse<>1) then writeln(ft,'SDA4 ');
if (p=4) and (vse<>1) then writeln(ft,'WINS ');
if (p=7) and (vse<>1) then writeln(ft,'>21 ');
if (p=10) and (vse<>1) then writeln(ft,'T+10 you ');
if (p=13) and (vse<>1) then writeln(ft,'T+10 dil ');
if (p=16) and (vse<>1) then writeln(ft,'10 first you ');
if (p=19) and (vse<>1) then writeln(ft,'10 first dil ');
if (p=22) and (vse<>1) then writeln(ft,'T+10 % ');
if (p=1) and (vse=1) then write(ft,'SDA4',#9,'12',#9,'13',#9,'14',#9,'15',#9,'16',#9,'17',#9,'18',#9,'19');
if (p=1) and (vse=1) then writeln(ft,#9,'20',#9,'21');
if (p=4) and (vse=1) then write(ft,'WINS',#9,'12',#9,'13',#9,'14',#9,'15',#9,'16',#9,'17',#9,'18',#9);
if (p=4) and (vse=1) then writeln(ft,'19',#9,'20',#9,'21');
if (p=7) and (vse=1) then write(ft,'>21',#9,'12',#9,'13',#9,'14',#9,'15',#9,'16',#9,'17',#9,'18',#9,'19');
if (p=7) and (vse=1) then writeln(ft,#9,'20',#9,'21');
if (p=10) and (vse=1) then write(ft,'T+10 you',#9,'12',#9,'13',#9,'14',#9,'15',#9,'16',#9,'17',#9);
if (p=10) and (vse=1) then writeln(ft,'18',#9,'19',#9,'20',#9,'21');
if (p=13) and (vse=1) then write(ft,'T+10 dil',#9,'12',#9,'13',#9,'14',#9,'15',#9,'16',#9,'17',#9);
if (p=13) and (vse=1) then writeln(ft,'18',#9,'19',#9,'20',#9,'21');
if (p=16) and (vse=1) then write(ft,'10 first you',#9,'12',#9,'13',#9,'14',#9,'15',#9,'16',#9,'17');
if (p=16) and (vse=1) then writeln(ft,#9,'18',#9,'19',#9,'20',#9,'21');
if (p=19) and (vse=1) then write(ft,'10 first dil',#9,'12',#9,'13',#9,'14',#9,'15',#9,'16',#9,'17');
if (p=19) and (vse=1) then writeln(ft,#9,'18',#9,'19',#9,'20',#9,'21');
if (p=22) and (vse=1) then write(ft,'T+10 %',#9,'12',#9,'13',#9,'14',#9,'15',#9,'16',#9,'17',#9,'18');
if (p=22) and (vse=1) then writeln(ft,#9,'19',#9,'20',#9,'21');
if p in [1,4,7,10,13,16,19,22] then write(ft,'max',#9);
if p in [2,5,8,11,14,17,20,23] then write(ft,'min',#9);
if p in [3,6,9,12,15,18,21,24] then write(ft,'average',#9);
for r:=12 to 21 do begin
if vse<>1 then begin
if r=max_ochki_igroka then begin
if p in [22,23,24] then write(ft,trunc(soxr_file[p,r]),',',(trunc(frac(soxr_file[p,r])*10)):1,#9)
else write(ft,trunc(soxr_file[p,r]),#9);
end;
end;
if vse=1 then begin
if p in [22,23,24] then write(ft,trunc(soxr_file[p,r]),',',(trunc(frac(soxr_file[p,r])*10)):1,#9)
else write(ft,trunc(soxr_file[p,r]),#9);
end;
end; { of for r:=12 }
writeln(ft);
end; { of for p:=1 }
end; { of if (pechfile=1) and (fileinfo=1) }
if pechfile=1 then close(ft);
write(' enter: 1 - to start the program again, or 2 - to finish and out to DOS ');
readln(ag);
until ag=2;
end.
|