Список использованной литературы
Заничковский Е. Ю. проблемы информатики — проблемы интеллектуального развития общества. / Информатика и образование. — 1994. В. М. Полонский. Международные сети и базы данных по народному образованию и педагогике./ Педагогика. — 1993. М. Р. Кочаловский. Технология баз данных на персональных ЭВМ. Москва: Финансы и статистика 1992 г. В. А. Каймин. От компьютерной грамотности к новой информационной… Читать ещё >
Список использованной литературы (реферат, курсовая, диплом, контрольная)
- 1 О. И. Бахтина. Информатизация гуманитарного образования./ Педагогика. — 1990.
- 2 Л. В. Шеншев. Компьютерное обучение: прогресс или регресс?/ Педагогика. — 1992.
- 3 Заничковский Е. Ю. проблемы информатики — проблемы интеллектуального развития общества. / Информатика и образование. — 1994.
- 4 И. И. Мархель. Компьютерная технология обучения./ Педагогика. — 1990.
- 5 В. А. Каймин. От компьютерной грамотности к новой информационной культуре./ Педагогика. — 1990.
- 6 Архангельский А. Я. Программирование в Borland Delphi 6. Москва: «БИНОМ» 2001 г.
- 7 М. Р. Кочаловский. Технология баз данных на персональных ЭВМ. Москва: Финансы и статистика 1992 г.
- 8 Клейман Т. М. Школы будущего: Компьютеры в процессе обучения. — М.: Радио и связь, 1997.
- 7 В. М. Полонский. Международные сети и базы данных по народному образованию и педагогике./ Педагогика. — 1993.
- 8 Н. М. Розенберг. Информационная культура в содержании общего образования./ Педагогика. — 1991.
- 9 Первин С. П. Дети, компьютеры и коммуникации. / Информатика и образование. -1994.
- 10 В. М. Оксман. Компьютерная грамотность и профессиональная компетентность./ Педагогика. — 1990.
- 11 Кржен Дж. Компьютер дома. — М., 1996.
- 12 И. К. Журавлев. Бок о бок с компьютером./ Педагогика. — 1990.
Приложение
unit table;
interface.
uses.
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,.
ExtCtrls, StdCtrls, Buttons, Menus, OleCtrls, Wintypes, WinProcs;
type.
Pic = ^TImage;
TForm1 = class (TForm).
//Объявление полей.
a1: TImage; a2: TImage; a3: TImage; a4: TImage; a5: TImage;
a6: TImage; a7: TImage; a8: TImage; a9: TImage; a10: TImage;
b1: TImage; b2: TImage; b3: TImage; b4: TImage; b5: TImage;
b6: TImage; b7: TImage; b8: TImage; b9: TImage; b10: TImage;
c1: TImage; c2: TImage; c3: TImage; c4: TImage; c5: TImage;
c6: TImage; c7: TImage; c8: TImage; c9: TImage; c10: TImage;
d1: TImage; d2: TImage; d3: TImage; d4: TImage; d5: TImage;
d6: TImage; d7: TImage; d8: TImage; d9: TImage; d10: TImage;
e1: TImage; e2: TImage; e3: TImage; e4: TImage; e5: TImage;
e6: TImage; e7: TImage; e8: TImage; e9: TImage; e10: TImage;
f1: TImage; f2: TImage; f3: TImage; f4: TImage; f5: TImage;
f6: TImage; f7: TImage; f8: TImage; f9: TImage; f10: TImage;
g1: TImage; g2: TImage; g3: TImage; g4: TImage; g5: TImage;
g6: TImage; g7: TImage; g8: TImage; g9: TImage; g10: TImage;
h1: TImage; h2: TImage; h3: TImage; h4: TImage; h5: TImage;
h6: TImage; h7: TImage; h8: TImage; h9: TImage; h10: TImage;
i1: TImage; i2: TImage; i3: TImage; i4: TImage; i5: TImage;
i6: TImage; i7: TImage; i8: TImage; i9: TImage; i10: TImage;
j1: TImage; j2: TImage; j3: TImage; j4: TImage; j5: TImage;
j6: TImage; j7: TImage; j8: TImage; j9: TImage; j10: TImage;
//Объявление фигур
h_w_r: TImage; e_w_r: TImage; d_w_r: TImage; f_w: TImage;
k_w: TImage; d_w_l: TImage; e_w_l: TImage; l_w_r: TImage;
l_w_l: TImage; h_w_l: TImage; l_b_l: TImage; l_b_r: TImage;
h_b_l: TImage; e_b_l: TImage; d_b_l: TImage; k_b: TImage;
f_b: TImage; d_b_r: TImage; e_b_r: TImage; h_b_r: TImage;
p_b01: TImage; p_b02: TImage; p_b10: TImage; p_b03: TImage;
p_b08: TImage; p_b09: TImage; p_b04: TImage; p_b05: TImage;
p_b06: TImage; p_b07: TImage; p_w01: TImage; p_w02: TImage;
p_w10: TImage; p_w03: TImage; p_w08: TImage; p_w09: TImage;
p_w04: TImage; p_w05: TImage; p_w06: TImage; p_w07: TImage;
L11: TLabel; L12: TLabel; L13: TLabel; L14: TLabel; L15: TLabel;
L16: TLabel; L17: TLabel; L18: TLabel; L04: TLabel; L05: TLabel; L02: TLabel; L03: TLabel;
L08: TLabel; L06: TLabel; L07: TLabel; L01: TLabel;
Label21: TLabel; lab_turn: TLabel;
L_game: TLabel; sharchil: TLabel;
vibor1: TImage; vibor2: TImage; vibor3: TImage; vibor4: TImage;
vibor5: TImage; empty: TImage; Label10: TLabel;
//Процедуры.
procedure Figure (img: Pic; str1: string; sel, color: integer);
procedure line8;
procedure newkletki;
procedure oldkletki;
procedure Fig (img: Pic);
procedure Party (dlina:byte);
procedure chess64;
//Функции ходов.
function rule_square (ts, ls, te, le: integer):boolean;
function turn_ladia (ts, ls, te, le: integer):boolean;
function turn_horse (ts, ls, te, le: integer):boolean;
function turn_elefant (ts, ls, te, le: integer):boolean;
function turn_dragon (ts, ls, te, le: integer):boolean;
function empty_square (tf, lf: integer):boolean;
procedure prSquare;
procedure prStart100Chess (Sender: TObject);
procedure N12Click (Sender: TObject);
procedure end_vibor (ch:char);
procedure b_Dragon_l (Sender: TObject); procedure b_Dragon_r (Sender: TObject);
procedure b_Horse_l (Sender: TObject); procedure b_Horse_r (Sender: TObject);
procedure w_Horse_l (Sender: TObject); procedure w_Horse_r (Sender: TObject);
procedure b_Ladia_l (Sender: TObject); procedure b_Ladia_r (Sender: TObject);
procedure w_Ladia_l (Sender: TObject); procedure w_Ladia_r (Sender: TObject);
procedure b_Elefant_l (Sender: TObject); procedure b_Elefant_r (Sender: TObject);
procedure w_Elefant_l (Sender: TObject); procedure w_Elefant_r (Sender: TObject);
procedure w_Ferz (Sender: TObject); procedure b_Ferz (Sender: TObject);
procedure w_King (Sender: TObject); procedure b_King (Sender: TObject);
procedure w_Peshka01(Sender: TObject); procedure w_Peshka02(Sender: TObject);
procedure w_Peshka03(Sender: TObject); procedure w_Peshka04(Sender: TObject);
procedure w_Peshka05(Sender: TObject); procedure w_Peshka06(Sender: TObject);
procedure w_Peshka07(Sender: TObject); procedure w_Peshka08(Sender: TObject);
procedure w_Peshka09(Sender: TObject); procedure w_Peshka10(Sender: TObject);
procedure b_Peshka01(Sender: TObject); procedure b_Peshka02(Sender: TObject);
procedure b_Peshka03(Sender: TObject); procedure b_Peshka04(Sender: TObject);
procedure b_Peshka05(Sender: TObject); procedure b_Peshka06(Sender: TObject);
procedure b_Peshka07(Sender: TObject); procedure b_Peshka08(Sender: TObject);
procedure b_Peshka09(Sender: TObject); procedure b_Peshka10(Sender: TObject);
procedure vibor_l (Sender: TObject);
procedure vibor_h (Sender: TObject);
procedure vibor_e (Sender: TObject);
procedure vibor_d (Sender: TObject);
procedure vibor_f (Sender: TObject);
procedure kletka (Sender: TObject);
private.
{ Private declarations }.
public.
{ Public declarations }.
end;
const square=32;
border=20;
FormWidth=495;
FormHeight=440;
var.
Form1: TForm1;
turn_prohod, sel_prohod, t_prohod, l_prohod,.
turn, selection, t, l,.
liner, game, i, j: integer;
flag:boolean;
// Массив растановки полей.
fgico: array [0.40] of string;
fgname: array [0.40] of Pic;
squares: array [1.10,1.10] of Pic;
squarico: array [1.10,1.10] of string;
mutant: array [1.40] of char;
labels: array [1.20] of string[1];
implementation.
{$R *.DFM}.
//——————————————————————————————————————-;
//Описание ячеек доски.
procedure TForm1. oldkletki;
begin.
for i:=1 to 10 do.
for j:=1 to 10 do.
begin.
if squarico[i, j]='_picsq_r.ico' then begin.
if odd (i+j) then squarico[i, j]: ='_picsq_w.ico'.
else squarico[i, j]: ='_picsq_b.ico';
squares[i, j]. Picture. LoadFromFile (squarico[i, j]);
end end;
end;
procedure TForm1. newkletki;
var i, j: byte;
begin.
for i:=1 to 10 do.
for j:=1 to 10 do.
begin.
squares[i, j]. OnClick:=kletka;
squares[i, j]. left:=border+(i-1)*square;
squares[i, j]. top:=border+(10-j)*square;
if odd (i+j) then squarico[i, j]: ='_picsq_w.ico'.
else squarico[i, j]: ='_picsq_b.ico';
squares[i, j]. Picture. LoadFromFile (squarico[i, j]);
end;
end;
//——————————————————————————————————————-;
//первоначальная растановка фигур
procedure TForm1. Party (dlina:byte);
var i, j: byte;
begin.
fgico[0]: ='_picsq_w';
for i:=1 to 20 do if i<11 then fgico[i]: ='_picp_w' else fgico[i]: ='_picp_b';
fgico[21]: ='_picd_w'; fgico[22]: ='_picd_w'; fgico[23]: ='_picd_b';
fgico[24]: ='_picd_b'; fgico[25]: ='_pich_w'; fgico[26]: ='_pich_w';
fgico[27]: ='_pich_b'; fgico[28]: ='_pich_b'; fgico[29]: ='_picl_w';
fgico[30]: ='_picl_w'; fgico[31]: ='_picl_b'; fgico[32]: ='_picl_b';
fgico[33]: ='_pice_w'; fgico[34]: ='_pice_w'; fgico[35]: ='_pice_b';
fgico[36]: ='_pice_b'; fgico[37]: ='_picf_w'; fgico[38]: ='_picf_b';
fgico[39]: ='_pick_w'; fgico[40]: ='_pick_b';
// Описание фигур
fgname[0]: =@empty;
fgname[1]: =@p_w01; fgname[2]: =@p_w02; fgname[3]: =@p_w03;
fgname[4]: =@p_w04; fgname[5]: =@p_w05; fgname[6]: =@p_w06;
fgname[7]: =@p_w07; fgname[8]: =@p_w08; fgname[9]: =@p_w09;
fgname[10]: =@p_w10; fgname[11]: =@p_b01; fgname[12]: =@p_b02;
fgname[13]: =@p_b03; fgname[14]: =@p_b04; fgname[15]: =@p_b05;
fgname[16]: =@p_b06; fgname[17]: =@p_b07; fgname[18]: =@p_b08;
fgname[19]: =@p_b09; fgname[20]: =@p_b10; fgname[21]: =@d_w_l;
fgname[22]: =@d_w_r; fgname[23]: =@d_b_l; fgname[24]: =@d_b_r;
fgname[25]: =@h_w_l; fgname[26]: =@h_w_r; fgname[27]: =@h_b_l;
fgname[28]: =@h_b_r; fgname[29]: =@l_w_l; fgname[30]: =@l_w_r;
fgname[31]: =@l_b_l; fgname[32]: =@l_b_r; fgname[33]: =@e_w_l;
fgname[34]: =@e_w_r; fgname[35]: =@e_b_l; fgname[36]: =@e_b_r;
fgname[37]: =@f_w; fgname[38]: =@f_b; fgname[39]: =@k_w;
fgname[40]: =@k_b;
for i:=1 to 10 do for j:=1 to 10 do squares[i, j]. hide;
for i:=1 to dlina do for j:=1 to dlina do squares[i, j]. show;
vibor1.hide;
vibor2.hide;
vibor3.hide;
vibor4.hide;
vibor5.hide;
sharchil.caption:='Начало партии';
lab_turn.caption:='Ход белых';
turn:=1;
flag:=false;
for i:=1 to 40 do.
begin.
fgname[i]. Picture. LoadFromFile (fgico[i]+'.ico');
fgname[i]. hide;
mutant[i]: ='p';
end;
selection:=0;
newkletki;
end;
//——————————————————————————————————————-;
//——————————————————————————————————————-;
//Определение типа игры.
procedure TForm1. chess64;
var i: byte;
begin.
Party (8);
game:=64;
L_game.caption:='Классические шахматы';
for i:=1 to 40 do if not (i in [9,10,19.24]) then fgname[i]. show;
for i:=1 to 8 do begin.
fgname[i]. top:=squares[i, 2].top;
fgname[i]. left:=squares[i, 2].left;
fgname[i+10]. top:=squares[i, 7].top;
fgname[i+10]. left:=squares[i, 7].left;
end;
//растановка при начале игры.
l_w_l.top:=a1.top; l_w_l.left:=a1.left;
l_w_r.top:=a1.top; l_w_r.left:=h1.left;
h_w_l.top:=a1.top; h_w_l.left:=b1.left;
h_w_r.top:=a1.top; h_w_r.left:=g1.left;
e_w_l.top:=a1.top; e_w_l.left:=c1.left;
e_w_r.top:=a1.top; e_w_r.left:=f1.left;
k_w.top :=a1.top; k_w.left :=e1.left;
f_w.top :=a1.top; f_w.left :=d1.left;
l_b_l.top:=a8.top; l_b_l.left:=a1.left;
l_b_r.top:=a8.top; l_b_r.left:=h1.left;
h_b_l.top:=a8.top; h_b_l.left:=b1.left;
h_b_r.top:=a8.top; h_b_r.left:=g1.left;
e_b_l.top:=a8.top; e_b_l.left:=c1.left;
e_b_r.top:=a8.top; e_b_r.left:=f1.left;
k_b.top :=a8.top; k_b.left :=e1.left;
f_b.top :=a8.top; f_b.left :=d1.left;
end;
//——————————————————————————————————————-;
//——————————————————————————————————————-;
//Изменение вида выбранной фигуры.
//——————————————————————————————————————-;
procedure TForm1. kletka (Sender:TObject);
var Img: Timage;
begin.
img:=sender as TImage;
t:=img.top;
l:=img.left;
sharchil.caption:='Выберите фигуру';
oldkletki;
prSquare;
end;
//——————————————————————————————————————-;
procedure TForm1. prStart100Chess (Sender: TObject);
begin.
// Процедуры для фигур — начало.
p_w01.OnClick:=w_Peshka01; p_w02.OnClick:=w_Peshka02;
p_w03.OnClick:=w_Peshka03; p_w04.OnClick:=w_Peshka04;
p_w05.OnClick:=w_Peshka05; p_w06.OnClick:=w_Peshka06;
p_w07.OnClick:=w_Peshka07; p_w08.OnClick:=w_Peshka08;
p_w09.OnClick:=w_Peshka09; p_w10.OnClick:=w_Peshka10;
p_b01.OnClick:=b_Peshka01; p_b02.OnClick:=b_Peshka02;
p_b03.OnClick:=b_Peshka03; p_b04.OnClick:=b_Peshka04;
p_b05.OnClick:=b_Peshka05; p_b06.OnClick:=b_Peshka06;
p_b07.OnClick:=b_Peshka07; p_b08.OnClick:=b_Peshka08;
p_b09.OnClick:=b_Peshka09; p_b10.OnClick:=b_Peshka10;
d_b_l.OnClick:=b_Dragon_l; d_b_r.OnClick:=b_Dragon_r;
h_b_l.OnClick:=b_Horse_l; h_b_r.OnClick:=b_Horse_r;
h_w_l.OnClick:=w_Horse_l; h_w_r.OnClick:=w_Horse_r;
l_b_l.OnClick:=b_Ladia_l; l_b_r.OnClick:=b_Ladia_r;
l_w_l.OnClick:=w_Ladia_l; l_w_r…
turn_ladia:=false;
if.
(((le=ls+0*square) and (te=ts+1*square)) or.
((le=ls+0*square) and (te=ts+2*square)) and empty_square (te-1*square, le) or.
((le=ls+0*square) and (te=ts+3*square)) and empty_square (te-1*square, le).
and empty_square (te-2*square, le) or.
((le=ls+0*square) and (te=ts+4*square)) and empty_square (te-1*square, le).
and empty_square (te-2*square, le).
and empty_square (te-3*square, le) or.
((le=ls+0*square) and (te=ts+5*square)) and empty_square (te-1*square, le).
and empty_square (te-2*square, le).
and empty_square (te-3*square, le).
and empty_square (te-4*square, le) or.
((le=ls+0*square) and (te=ts+6*square)) and empty_square (te-1*square, le).
and empty_square (te-2*square, le).
and empty_square (te-3*square, le).
and empty_square (te-4*square, le).
and empty_square (te-5*square, le) or.
((le=ls+0*square) and (te=ts+7*square)) and empty_square (te-1*square, le).
and empty_square (te-2*square, le).
and empty_square (te-3*square, le).
and empty_square (te-4*square, le).
and empty_square (te-5*square, le).
and empty_square (te-6*square, le) or.
((le=ls+0*square) and (te=ts+8*square)) and empty_square (te-1*square, le).
and empty_square (te-2*square, le).
and empty_square (te-3*square, le).
and empty_square (te-4*square, le).
and empty_square (te-5*square, le).
and empty_square (te-6*square, le).
and empty_square (te-7*square, le) or.
((le=ls+0*square) and (te=ts+9*square)) and empty_square (te-1*square, le).
and empty_square (te-2*square, le).
and empty_square (te-3*square, le).
and empty_square (te-4*square, le).
and empty_square (te-5*square, le).
and empty_square (te-6*square, le).
and empty_square (te-7*square, le).
and empty_square (te-8*square, le) or.
- ((le=ls+0*square) and (te=ts-1*square)) or
- ((le=ls+0*square) and (te=ts-2*square)) and empty_square (te+1*square, le) or
- ((le=ls+0*square) and (te=ts-3*square)) and empty_square (te+1*square, le)
and empty_square (te+2*square, le) or.
((le=ls+0*square) and (te=ts-4*square)) and empty_square (te+1*square, le).
and empty_square (te+2*square, le).
and empty_square (te+3*square, le) or.
((le=ls+0*square) and (te=ts-5*square)) and empty_square (te+1*square, le).
and empty_square (te+2*square, le).
and empty_square (te+3*square, le).
and empty_square (te+4*square, le) or.
((le=ls+0*square) and (te=ts-6*square)) and empty_square (te+1*square, le).
and empty_square (te+2*square, le).
and empty_square (te+3*square, le).
and empty_square (te+4*square, le).
and empty_square (te+5*square, le) or.
((le=ls+0*square) and (te=ts-7*square)) and empty_square (te+1*square, le).
and empty_square (te+2*square, le).
and empty_square (te+3*square, le).
and empty_square (te+4*square, le).
and empty_square (te+5*square, le).
and empty_square (te+6*square, le) or.
((le=ls+0*square) and (te=ts-8*square)) and empty_square (te+1*square, le).
and empty_square (te+2*square, le).
and empty_square (te+3*square, le).
and empty_square (te+4*square, le).
and empty_square (te+5*square, le).
and empty_square (te+6*square, le).
and empty_square (te+7*square, le) or.
((le=ls+0*square) and (te=ts-9*square)) and empty_square (te+1*square, le).
and empty_square (te+2*square, le).
and empty_square (te+3*square, le).
and empty_square (te+4*square, le).
and empty_square (te+5*square, le).
and empty_square (te+6*square, le).
and empty_square (te+7*square, le).
and empty_square (te+8*square, le) or.
- ((te=ts+0*square) and (le=ls+1*square)) or
- ((te=ts+0*square) and (le=ls+2*square)) and empty_square (te, le-1*square)or
- ((te=ts+0*square) and (le=ls+3*square)) and empty_square (te, le-1*square)
and empty_square (te, le-2*square)or.
((te=ts+0*square) and (le=ls+4*square)) and empty_square (te, le-1*square).
and empty_square (te, le-2*square).
and empty_square (te, le-3*square)or.
((te=ts+0*square) and (le=ls+5*square)) and empty_square (te, le-1*square).
and empty_square (te, le-2*square).
and empty_square (te, le-3*square).
and empty_square (te, le-4*square)or.
((te=ts+0*square) and (le=ls+6*square)) and empty_square (te, le-1*square).
and empty_square (te, le-2*square).
and empty_square (te, le-3*square).
and empty_square (te, le-4*square).
and empty_square (te, le-5*square)or.
((te=ts+0*square) and (le=ls+7*square)) and empty_square (te, le-1*square).
and empty_square (te, le-2*square).
and empty_square (te, le-3*square).
and empty_square (te, le-4*square).
and empty_square (te, le-5*square).
and empty_square (te, le-6*square)or.
((te=ts+0*square) and (le=ls+8*square)) and empty_square (te, le-1*square).
and empty_square (te, le-2*square).
and empty_square (te, le-3*square).
and empty_square (te, le-4*square).
and empty_square (te, le-5*square).
and empty_square (te, le-6*square).
and empty_square (te, le-7*square)or.
((te=ts+0*square) and (le=ls+9*square)) and empty_square (te, le-1*square).
and empty_square (te, le-2*square).
and empty_square (te, le-3*square).
and empty_square (te, le-4*square).
and empty_square (te, le-5*square).
and empty_square (te, le-6*square).
and empty_square (te, le-7*square).
and empty_square (te, le-8*square)or.
- ((te=ts+0*square) and (le=ls-1*square)) or
- ((te=ts+0*square) and (le=ls-2*square)) and empty_square (te, le+1*square)or
- ((te=ts+0*square) and (le=ls-3*square)) and empty_square (te, le+1*square)
and empty_square (te, le+2*square)or.
((te=ts+0*square) and (le=ls-4*square)) and empty_square (te, le+1*square).
and empty_square (te, le+2*square).
and empty_square (te, le+3*square)or.
((te=ts+0*square) and (le=ls-5*square)) and empty_square (te, le+1*square).
and empty_square (te, le+2*square).
and empty_square (te, le+3*square).
and empty_square (te, le+4*square)or.
((te=ts+0*square) and (le=ls-6*square)) and empty_square (te, le+1*square).
and empty_square (te, le+2*square).
and empty_square (te, le+3*square).
and empty_square (te, le+4*square).
and empty_square (te, le+5*square)or.
((te=ts+0*square) and (le=ls-7*square)) and empty_square (te, le+1*square).
and empty_square (te, le+2*square).
and empty_square (te, le+3*square).
and empty_square (te, le+4*square).
and empty_square (te, le+5*square).
and empty_square (te, le+6*square)or.
((te=ts+0*square) and (le=ls-8*square)) and empty_square (te, le+1*square).
and empty_square (te, le+2*square).
and empty_square (te, le+3*square).
and empty_square (te, le+4*square).
and empty_square (te, le+5*square).
and empty_square (te, le+6*square).
and empty_square (te, le+7*square)or.
((te=ts+0*square) and (le=ls-9*square)) and empty_square (te, le+1*square).
and empty_square (te, le+2*square).
and empty_square (te, le+3*square).
and empty_square (te, le+4*square).
and empty_square (te, le+5*square).
and empty_square (te, le+6*square).
and empty_square (te, le+7*square).
and empty_square (te, le+8*square)).
then turn_ladia:=true.
end;
//——————————————————————————————————————-;
function TForm1. turn_horse (ts, ls, te, le: integer):boolean;
begin //Ходы лошадок.
turn_horse:=false;
if.
(((le=ls+1*square) and (te=ts+2*square)) or.
((le=ls-1*square) and (te=ts+2*square)) or.
((le=ls+1*square) and (te=ts-2*square)) or.
((le=ls-1*square) and (te=ts-2*square)) or.
((le=ls+2*square) and (te=ts+1*square)) or.
((le=ls+2*square) and (te=ts-1*square)) or.
((le=ls-2*square) and (te=ts+1*square)) or.
((le=ls-2*square) and (te=ts-1*square))).
then turn_horse:=true;
end;
//——————————————————————————————————————-;
function TForm1. turn_elefant (ts, ls, te, le: integer):boolean;
begin //Описание ходов слонов (оф).
turn_elefant:=false;
if.
(((le=ls+1*square) and (te=ts+1*square)) or.
((le=ls+2*square) and (te=ts+2*square)) and empty_square (te-1*square, le-1*square)or.
((le=ls+3*square) and (te=ts+3*square)) and empty_square (te-1*square, le-1*square).
and empty_square (te-2*square, le-2*square)or.
((le=ls+4*square) and (te=ts+4*square)) and empty_square (te-1*square, le-1*square).
and empty_square (te-2*square, le-2*square).
and empty_square (te-3*square, le-3*square)or.
((le=ls+5*square) and (te=ts+5*square)) and empty_square (te-1*square, le-1*square).
and empty_square (te-2*square, le-2*square).
and empty_square (te-3*square, le-3*square).
and empty_square (te-4*square, le-4*square)or.
((le=ls+6*square) and (te=ts+6*square)) and empty_square (te-1*square, le-1*square).
and empty_square (te-2*square, le-2*square).
and empty_square (te-3*square, le-3*square).
and empty_square (te-4*square, le-4*square).
and empty_square (te-5*square, le-5*square)or.
((le=ls+7*square) and (te=ts+7*square)) and empty_square (te-1*square, le-1*square).
and empty_square (te-2*square, le-2*square).
and empty_square (te-3*square, le-3*square).
and empty_square (te-4*square, le-4*square).
and empty_square (te-5*square, le-5*square).
and empty_square (te-6*square, le-6*square)or.
((le=ls+8*square) and (te=ts+8*square)) and empty_square (te-1*square, le-1*square).
and empty_square (te-2*square, le-2*square).
and empty_square (te-3*square, le-3*square).
and empty_square (te-4*square, le-4*square).
and empty_square (te-5*square, le-5*square).
and empty_square (te-6*square, le-6*square).
and empty_square (te-7*square, le-7*square)or.
((le=ls+9*square) and (te=ts+9*square)) and empty_square (te-1*square, le-1*square).
and empty_square (te-2*square, le-2*square).
and empty_square (te-3*square, le-3*square).
and empty_square (te-4*square, le-4*square).
and empty_square (te-5*square, le-5*square).
and empty_square (te-6*square, le-6*square).
and empty_square (te-7*square, le-7*square).
and empty_square (te-8*square, le-8*square)or.
((le=ls+1*square) and (te=ts-1*square)) or.
((le=ls+2*square) and (te=ts-2*square)) and empty_square (te+1*square, le-1*square)or.
((le=ls+3*square) and (te=ts-3*square)) and empty_square (te+1*square, le-1*square).
and empty_square (te+2*square, le-2*square)or.
((le=ls+4*square) and (te=ts-4*square)) and empty_square (te+1*square, le-1*square).
and empty_square (te+2*square, le-2*square).
and empty_square (te+3*square, le-3*square)or.
((le=ls+5*square) and (te=ts-5*square)) and empty_square (te+1*square, le-1*square).
and empty_square (te+2*square, le-2*square).
and empty_square (te+3*square, le-3*square).
and empty_square (te+4*square, le-4*square)or.
((le=ls+6*square) and (te=ts-6*square)) and empty_square (te+1*square, le-1*square).
and empty_square (te+2*square, le-2*square).
and empty_square (te+3*square, le-3*square).
and empty_square (te+4*square, le-4*square).
and empty_square (te+5*square, le-5*square)or.
((le=ls+7*square) and (te=ts-7*square)) and empty_square (te+1*square, le-1*square).
and empty_square (te+2*square, le-2*square).
and empty_square (te+3*square, le-3*square).
and empty_square (te+4*square, le-4*square).
and empty_square (te+5*square, le-5*square).
and empty_square (te+6*square, le-6*square)or.
((le=ls+8*square) and (te=ts-8*square)) and empty_square (te+1*square, le-1*square).
and empty_square (te+2*square, le-2*square).
and empty_square (te+3*square, le-3*square).
and empty_square (te+4*square, le-4*square).
and empty_square (te+5*square, le-5*square).
and empty_square (te+6*square, le-6*square).
and empty_square (te+7*square, le-7*square)or.
((le=ls+9*square) and (te=ts-9*square)) and empty_square (te+1*square, le-1*square).
and empty_square (te+2*square, le-2*square).
and empty_square (te+3*square, le-3*square).
and empty_square (te+4*square, le-4*square).
and empty_square (te+5*square, le-5*square).
and empty_square (te+6*square, le-6*square).
and empty_square (te+7*square, le-7*square).
and empty_square (te+8*square, le-8*square)or.
- ((te=ts-1*square) and (le=ls-1*square)) or
- ((te=ts-2*square) and (le=ls-2*square)) and empty_square (te+1*square, le+1*square)or
((te=ts-3*square) and (le=ls-3*square)) and empty_square (te+1*square, le+1*square).
and empty_square (te+2*square, le+2*square)or.
((te=ts-4*square) and (le=ls-4*square)) and empty_square (te+1*square, le+1*square).
and empty_square (te+2*square, le+2*square).
and empty_square (te+3*square, le+3*square)or.
((te=ts-5*square) and (le=ls-5*square)) and empty_square (te+1*square, le+1*square).
and empty_square (te+2*square, le+2*square).
and empty_square (te+3*square, le+3*square).
and empty_square (te+4*square, le+4*square)or.
((te=ts-6*square) and (le=ls-6*square)) and empty_square (te+1*square, le+1*square).
and empty_square (te+2*square, le+2*square).
and empty_square (te+3*square, le+3*square).
and empty_square (te+4*square, le+4*square).
and empty_square (te+5*square, le+5*square)or.
((te=ts-7*square) and (le=ls-7*square)) and empty_square (te+1*square, le+1*square).
and empty_square (te+2*square, le+2*square).
and empty_square (te+3*square, le+3*square).
and empty_square (te+4*square, le+4*square).
and empty_square (te+5*square, le+5*square).
and empty_square (te+6*square, le+6*square)or.
((te=ts-8*square) and (le=ls-8*square)) and empty_square (te+1*square, le+1*square).
and empty_square (te+2*square, le+2*square).
and empty_square (te+3*square, le+3*square).
and empty_square (te+4*square, le+4*square).
and empty_square (te+5*square, le+5*square).
and empty_square (te+6*square, le+6*square).
and empty_square (te+7*square, le+7*square)or.
((te=ts-9*square) and (le=ls-9*square)) and empty_square (te+1*square, le+1*square).
and empty_square (te+2*square, le+2*square).
and empty_square (te+3*square, le+3*square).
and empty_square (te+4*square, le+4*square).
and empty_square (te+5*square, le+5*square).
and empty_square (te+6*square, le+6*square).
and empty_square (te+7*square, le+7*square).
and empty_square (te+8*square, le+8*square)or.
((te=ts+1*square) and (le=ls-1*square)) or.
((te=ts+2*square) and (le=ls-2*square)) and empty_square (te-1*square, le+1*square)or.
((te=ts+3*square) and (le=ls-3*square)) and empty_square (te-1*square, le+1*square).
and empty_square (te-2*square, le+2*square)or.
((te=ts+4*square) and (le=ls-4*square)) and empty_square (te-1*square, le+1*square).
and empty_square (te-2*square, le+2*square).
and empty_square (te-3*square, le+3*square)or.
((te=ts+5*square) and (le=ls-5*square)) and empty_square (te-1*square, le+1*square).
and empty_square (te-2*square, le+2*square).
and empty_square (te-3*square, le+3*square).
and empty_square (te-4*square, le+4*square)or.
((te=ts+6*square) and (le=ls-6*square)) and empty_square (te-1*square, le+1*square).
and empty_square (te-2*square, le+2*square).
and empty_square (te-3*square, le+3*square).
and empty_square (te-4*square, le+4*square).
and empty_square (te-5*square, le+5*square)or.
((te=ts+7*square) and (le=ls-7*square)) and empty_square (te-1*square, le+1*square).
and empty_square (te-2*square, le+2*square).
and empty_square (te-3*square, le+3*square).
and empty_square (te-4*square, le+4*square).
and empty_square (te-5*square, le+5*square).
and empty_square (te-6*square, le+6*square)or.
((te=ts+8*square) and (le=ls-8*square)) and empty_square (te-1*square, le+1*square).
and empty_square (te-2*square, le+2*square).
and empty_square (te-3*square, le+3*square).
and empty_square (te-4*square, le+4*square).
and empty_square (te-5*square, le+5*square).
and empty_square (te-6*square, le+6*square).
and empty_square (te-7*square, le+7*square)or.
((te=ts+9*square) and (le=ls-9*square)) and empty_square (te-1*square, le+1*square).
and empty_square (te-2*square, le+2*square).
and empty_square (te-3*square, le+3*square).
and empty_square (te-4*square, le+4*square).
and empty_square (te-5*square, le+5*square).
and empty_square (te-6*square, le+6*square).
and empty_square (te-7*square, le+7*square).
and empty_square (te-8*square, le+8*square)).
then turn_elefant:=true.
end;
//——————————————————————————————————————-;
// слон.
function TForm1. turn_dragon (ts, ls, te, le: integer):boolean;
begin.
turn_dragon:=false;
if.
(((le=ls+0*square) and (te=ts+1*square)) or.
((le=ls+0*square) and (te=ts+2*square)) or.
((le=ls+0*square) and (te=ts-1*square)) or.
((le=ls+0*square) and (te=ts-2*square)) or.
- ((le=ls+1*square) and (te=ts+0*square)) or
- ((le=ls+2*square) and (te=ts+0*square)) or
- ((le=ls-1*square) and (te=ts+0*square)) or
- ((le=ls-2*square) and (te=ts+0*square)) or
- ((le=ls+1*square) and (te=ts+1*square)) or
- ((le=ls-1*square) and (te=ts+1*square)) or
- ((le=ls+2*square) and (te=ts+2*square)) or
- ((le=ls-2*square) and (te=ts+2*square)) or
- ((le=ls+1*square) and (te=ts-1*square)) or
- (le=ls-1*square) and (te=ts-1*square)) or
- ((le=ls+2*square) and (te=ts-2*square)) or
- ((le=ls-2*square) and (te=ts-2*square)))
then turn_dragon:=true.
end;
//——————————————————————————————————————-;
// Право ходов всех фигур
function TForm1. rule_square (ts, ls, te, le: integer):boolean;
begin.
rule_square:=false;
case selection of.
0: rule_square:=false;
// Белые пешки.
1.10:
case mutant[selection] of.
'l': rule_square:=turn_ladia (ts, ls, te, le);
'h': rule_square:=turn_horse (ts, ls, te, le);
'e': rule_square:=turn_elefant (ts, ls, te, le);
'd': rule_square:=turn_dragon (ts, ls, te, le);
'f': rule_square:=turn_ladia (ts, ls, te, le) or turn_elefant (ts, ls, te, le);
else begin.
if (le=ls) then begin.
if (te=ts-square) and empty_square (te, le) then rule_square:=true;
if (ts=a2.top) and (te=ts-2*square) and empty_square (te, le) and empty_square (te+1*square, le) and (game25).
or (ts=a2.top) and (te=ts-1*square) and (game=25).
or (ts=a2.top) and (te=ts-3*square) and empty_square (te, le) and empty_square (te+1*square, le) and empty_square (te+2*square, le) and (game=100).
then begin turn_prohod:=0; sel_prohod:=selection; t_prohod:=te+square;
l_prohod:=le; rule_square:=true; end;
end;
if ((le=ls+square)or (le=ls-square))and (te=ts-square)and not (empty_square (te, le)).
then flag:=true;
if flag then rule_square:=true;
if (turn_prohod=1) and (t_prohod=ts-square) and ((l_prohod=ls+square)or (l_prohod=ls-square)) then.
begin.
fgname[sel_prohod]. hide;
sharchil.caption:='Черная пешка взята на проходе';
rule_square:=true;
end;
end;
end;
// Черные пешки.
11.20: begin.
case mutant[selection] of.
'l': rule_square:=turn_ladia (ts, ls, te, le);
'h': rule_square:=turn_horse (ts, ls, te, le);
'e': rule_square:=turn_elefant (ts, ls, te, le);
'f': rule_square:=turn_ladia (ts, ls, te, le) or turn_elefant (ts, ls, te, le);
else begin.
if (le=ls) then begin.
if (te=ts+square) and empty_square (te, le).
or (ts=a9.top) and (te=ts+2*square) and empty_square (te, le) and empty_square (te-1*square, le) and (game25).
then rule_square:=true;
if (ts=a9.top) and (te=ts+3*square) and empty_square (te, le) and empty_square (te-1*square, le) and empty_square (te-2*square, le).
or (ts=a4.top) and (te=ts+1*square) and (game=25).
or (ts=a7.top) and (te=ts+2*square) and empty_square (te, le) and empty_square (te-1*square, le) and (game=64).
then begin turn_prohod:=0; sel_prohod:=selection; t_prohod:=te-square; l_prohod:=le; rule_square:=true; end;
end;
if ((le=ls+square)or (le=ls-square))and (te=ts+square)and not (empty_square (te, le)).
then flag:=true;
if flag then rule_square:=true;
if (turn_prohod=1) and (t_prohod=ts+square) and ((l_prohod=ls+square)or (l_prohod=ls-square)) then.
begin.
fgname[sel_prohod]. hide;
sharchil.caption:='Белая пешка взята на проходе';
rule_square:=true;
end;
end;
end;
end;
//Короли.
39,40: begin.
if.
((le=ls+0*square) and (te=ts+1*square)) or.
((le=ls+0*square) and (te=ts-1*square)) or.
((le=ls+1*square) and (te=ts+0*square)) or.
((le=ls+1*square) and (te=ts+1*square)) or.
((le=ls+1*square) and (te=ts-1*square)) or.
((le=ls-1*square) and (te=ts+0*square)) or.
((le=ls-1*square) and (te=ts+1*square)) or.
((le=ls-1*square) and (te=ts-1*square)).
then rule_square:=true.
end;
//Короли — конец.
- 37,38: rule_square:=turn_ladia (ts, ls, te, le) or turn_elefant (ts, ls, te, le);
- 33,34,35,36: rule_square:=turn_elefant (ts, ls, te, le);
- 29,30,31,32: rule_square:=turn_ladia (ts, ls, te, le);
- 25,26,27,28: rule_square:=turn_horse (ts, ls, te, le);
end;
end;
//—————————————————————————————————————-//.
procedure TForm1. Figure (img: Pic; str1: string; sel, color: integer);
{color: 1=white; -1=black} // При выборе фигуры.
var i, j: byte;
begin.
oldkletki;
if (turn=-1*color) and rule_square (t, l, img. top, img. left) then.
begin.
sharchil.caption:='Взят'+str1;
img.hide;
t:=img.top;
l:=img.left;
prSquare;
exit;
end;
if turn=(1*color) then.
begin.
fgname[selection]. Picture. LoadFromFile (fgico[selection]+'.ico');
img.Picture.LoadFromFile (fgico[sel]+'_s.ico');
t:=img.top;
l:=img.left;
selection:=sel;
sharchil.caption:='Выбран'+str1;
for i:=1 to 10 do.
for j:=1 to 10 do.
begin.
if rule_square (img.top, img. left, squares[i, j]. top, squares[i, j].left).
then begin.
// squarico[i, j]: ='_picsq_r.ico';
// squares[i, j]. Picture. LoadFromFile (squarico[i, j]).
end;
end;
end;
end;
// Фигуры — начало.
procedure TForm1. w_Peshka01(Sender: TObject);
begin Figure (@p_w01,'а белая пешка', 1,1);end;
procedure TForm1. w_Peshka02(Sender: TObject);
begin Figure (@p_w02,'а белая пешка', 2,1);end;
procedure TForm1. w_Peshka03(Sender: TObject);
begin Figure (@p_w03,'а белая пешка', 3,1);end;
procedure TForm1. w_Peshka04(Sender: TObject);
begin Figure (@p_w04,'а белая пешка', 4,1);end;
procedure TForm1. w_Peshka05(Sender: TObject);
begin Figure (@p_w05,'а белая пешка', 5,1);end;
procedure TForm1. w_Peshka06(Sender: TObject);
begin Figure (@p_w06,'а белая пешка', 6,1);end;
procedure TForm1. w_Peshka07(Sender: TObject);
begin Figure (@p_w07,'а белая пешка', 7,1);end;
procedure TForm1. w_Peshka08(Sender: TObject);
begin Figure (@p_w08,'а белая пешка', 8,1);end;
procedure TForm1. w_Peshka09(Sender: TObject);
begin Figure (@p_w09,'а белая пешка', 9,1);end;
procedure TForm1. w_Peshka10(Sender: TObject);
begin Figure (@p_w10,'а белая пешка', 10,1);end;
procedure TForm1. b_Peshka01(Sender: TObject);
begin Figure (@p_b01,'а черная пешка', 11,-1);end;
procedure TForm1. b_Peshka02(Sender: TObject);
begin Figure (@p_b02,'а черная пешка', 12,-1);end;
procedure TForm1. b_Peshka03(Sender: TObject);
begin Figure (@p_b03,'а черная пешка', 13,-1);end;
procedure TForm1. b_Peshka04(Sender: TObject);
begin Figure (@p_b04,'а черная пешка', 14,-1);end;
procedure TForm1. b_Peshka05(Sender: TObject);
begin Figure (@p_b05,'а черная пешка', 15,-1);end;
procedure TForm1. b_Peshka06(Sender: TObject);
begin Figure (@p_b06,'а черная пешка', 16,-1);end;
procedure TForm1. b_Peshka07(Sender: TObject);
begin Figure (@p_b07,'а черная пешка', 17,-1);end;
procedure TForm1. b_Peshka08(Sender: TObject);
begin Figure (@p_b08,'а черная пешка', 18,-1);end;
procedure TForm1. b_Peshka09(Sender: TObject);
begin Figure (@p_b09,'а черная пешка', 19,-1);end;
procedure TForm1. b_Peshka10(Sender: TObject);
begin Figure (@p_b10,'а черная пешка', 20,-1);end;
procedure TForm1. b_Dragon_l (Sender: TObject);
begin Figure (@d_b_l,' черный дракон', 23,-1);end;
procedure TForm1. b_Dragon_r (Sender: TObject);
begin Figure (@d_b_r,' черный дракон', 24,-1);end;
procedure TForm1. w_Horse_l (Sender: TObject);
begin Figure (@h_w_l,' белый конь', 25,1);end;
procedure TForm1. w_Horse_r (Sender: TObject);
begin Figure (@h_w_r,' белый конь', 26,1);end;
procedure TForm1. b_Horse_l (Sender: TObject);
begin Figure (@h_b_l,' черный конь', 27,-1);end;
procedure TForm1. b_Horse_r (Sender: TObject);
begin Figure (@h_b_r,' черный конь', 28,-1);end;
procedure TForm1. w_Ladia_l (Sender: TObject);
begin Figure (@l_w_l,'а белая ладья', 29,1);end;
procedure TForm1. w_Ladia_r (Sender: TObject);
begin Figure (@l_w_r,'а белая ладья', 30,1);end;
procedure TForm1. b_Ladia_l (Sender: TObject);
begin Figure (@l_b_l,'а черная ладья', 31,-1);end;
procedure TForm1. b_Ladia_r (Sender: TObject);
begin Figure (@l_b_r,'а черная ладья', 32,-1);end;
procedure TForm1. w_Elefant_l (Sender: TObject);
begin Figure (@e_w_l,' белый слон', 33,1);end;
procedure TForm1. w_Elefant_r (Sender: TObject);
begin Figure (@e_w_r,' белый слон', 34,1);end;
procedure TForm1. b_Elefant_l (Sender: TObject);
begin Figure (@e_b_l,' черный слон', 35,-1);end;
procedure TForm1. b_Elefant_r (Sender: TObject);
begin Figure (@e_b_r,' черный слон', 36,-1);end;
procedure TForm1. w_Ferz (Sender: TObject);
begin Figure (@f_w,' белый ферзь', 37,1);end;
procedure TForm1. b_Ferz (Sender: TObject);
begin Figure (@f_b,' черный ферзь', 38,-1);end;
procedure TForm1. w_King (Sender: TObject);
begin Figure (@k_w,' белый король', 39,1);end;
procedure TForm1. b_King (Sender: TObject);
begin Figure (@k_b,' черный король', 40,-1);end;
// Фигуры — конец.
//——————————————————————————————————————-;
procedure TForm1. line8;
begin.
liner:=turn;
turn:=0;
sharchil.caption:='Выберите новую фигуру';
vibor1.show;
vibor2.show;
vibor3.show;
if game=100 then vibor4. show;
vibor5.show;
case liner of.
— 1: begin.
vibor1.Picture.LoadFromFile ('_picl_w.ico');
vibor2.Picture.LoadFromFile ('_pich_w.ico');
vibor3.Picture.LoadFromFile ('_pice_w.ico');
vibor4.Picture.LoadFromFile ('_picd_w.ico');
vibor5.Picture.LoadFromFile ('_picf_w.ico');
end;
1: begin.
vibor1.Picture.LoadFromFile ('_picl_b.ico');
vibor2.Picture.LoadFromFile ('_pich_b.ico');
vibor3.Picture.LoadFromFile ('_pice_b.ico');
vibor4.Picture.LoadFromFile ('_picd_b.ico');
vibor5.Picture.LoadFromFile ('_picf_b.ico');
end;
end.
end;
//——————————————————————————————————————-;
//загрузка режимов фигуры.
procedure TForm1. Fig (img: Pic);
begin.
turn:=turn*(-1);
img.top:=t;
img.left:=l;
if (mutant[selection] ='p') and (.
- ((selection in [1.10]) and (game=100) and (img.top=a10.top)) or
- ((selection in [1.10]) and (game=64) and (img.top=a8.top)) or
- ((selection in [1.10]) and (game=25) and (img.top=a5.top)) or
- ((selection in [11.20]) and (img.top=a1.top))) then line8;
fgname[selection]. Picture. LoadFromFile (fgico[selection]+'.ico');
if turn0 then selection:=0;
flag:=false;
end;
//——————————————————————————————————————-;
// Сообщение о очередности ходов (справо).
procedure TForm1. prSquare;
begin.
if rule_square (fgname[selection]. top, fgname[selection].left, t, l) then Fig (fgname[selection]);
case turn of.
1: begin.
lab_turn.caption:='Ход белых';
end;
— 1: begin.
lab_turn.caption:='Ход черных';
end;
end;
turn_prohod:=turn_prohod+1;
if turn_prohod>30 000 then turn_prohod:=2;
end;
//——————————————————————————————————————-;
procedure TForm1. N12Click (Sender: TObject);
begin.
chess64;
end;
//Изменение цвета фигуры при ее выделении.
procedure TForm1. end_vibor (ch:char);
begin.
case liner of.
— 1: begin.
mutant[selection]: =ch;
fgico[selection]: ='_pic+ch+'_w';
end;
1: begin.
mutant[selection]: =ch;
fgico[selection]: ='_pic+ch+'_b';
end;end;
fgname[selection]. Picture. LoadFromFile (fgico[selection]+'.ico');
turn:=liner;
vibor1.hide;
vibor2.hide;
vibor3.hide;
vibor4.hide;
vibor5.hide;
end;
procedure TForm1. vibor_l (Sender: TObject);
begin end_vibor ('l'); end;
procedure TForm1. vibor_h (Sender: TObject);
begin end_vibor ('h'); end;
procedure TForm1. vibor_e (Sender: TObject);
begin end_vibor ('e'); end;
procedure TForm1. vibor_d (Sender: TObject);
begin end_vibor ('d'); end;
procedure TForm1. vibor_f (Sender: TObject);
begin end_vibor ('f'); end;
end.