; y: = 150; end;
: begin x: = 150; y: = 150; end;;. Rectangle (x, y, x +51, y +51);. Brush. Color: = clWhite;;: = 3; q: = 0 to w doi: = 0 to w do. MoveTo (i * 50, q * 50);. LineTo ((i) * 50, (w-q +1) * 50);. MoveTo (i * 50, q * 50);. LineTo ((w-i +1) * 50, (q) * 50);;: = 1; q: = 1 to 4 doi: = 1 to 4 do (pjat [w] <> 0) then ( keyb = 'yes') and (keybpos = w) then. Brush. Color: = clGradientInactiveCaption;. TextOut (i * 50-30, q * 50-30, mass58 [Pjat [w]]);. Brush. Color: = clWhite; else. TextOut (i * 50-30, q * 50-30, mass58 [Pjat [w]]);: = w +1;;; CheckPole (): string; i: integer;: = 'yes'; i: = 1 to 15 do if (pjat [i] <> i) then result: = 'no'; (pjat [16] <> 0) then result: = 'no';; TMain1. FormCreate (Sender: TObject); (); (image1. Canvas);. left: = (screen. Width-main1. Width) div 2;. top: = (screen. Height-main1. Height) div 2;: = 'no';: = 1;; TMain1. ResetClick (Sender: TObject); (); (image1. Canvas);; go (i, cell: integer); [i]: = pjat [cell]; [cell]: = 0;: = steps +1; ( main1. image1. Canvas);. label2. Caption: = inttostr (steps); CheckPole = 'yes' then showmessage (pre. wintext);; direction (dire: string); cell: integer; dire = 'sdown' then if (keybpos <= 12) then keybpos: = keybpos +4; dire = 'sleft' then if (keybpos <> 1) and (keybpos <> 5) and (keybpos <> 9) and (keybpos <> 13) then keybpos: = keybpos-1; dire = 'sup' then if (keybpos> = 5) then keybpos: = keybpos-4; dire = 'sright'then if (keybpos <> 4) and (keybpos <> 8) and (keybpos <> 12 ) and (keybpos <> 16) then keybpos: = keybpos +1; dire = 'space' then begin: = keybpos; (pjat [cell-1] = 0) and (cell> = 2) and (cell <= 17) then (cell-1, cell); (pjat [cell +1] = 0) and (cell> = 0) and (cell <= 15) then (cell +1, cell); (pjat [cell-4 ] = 0) and (cell> = 5) and (cell <= 20) then (cell-4, cell); (pjat [cell +4] = 0) and (cell> = -3) and (cell <= 12) then (cell +4, cell);; (main1. image1. Canvas);; TMain1. Image1Click (Sender: TObject);, y, cell: integer; keyb = 'no' then: = mouse. CursorPos. x-image1. left-main1. Left-4;
y: = mouse. CursorPos. y-image1. top-main1. top-30;: = x div 50;: = y div 50;
cell: = x * 1 + y * 4 +1; (pjat [cell-1] = 0) and (cell> = 2) and (cell <= 17) then (cell-1 , cell); (pjat [cell +1] = 0) and (cell> = 0) and (cell <= 15) then (cell +1, cell); (pjat [cell-4] = 0) and (cell> ; = 5) and (cell <= 20) then (cell-4, cell); (pjat [cell +4] = 0) and (cell> = -3) and (cell <= 12) then (cell +4 , cell);;; TMain1. SwitchClick (Sender: TObject); (keyb = 'yes'): = 'no'; (image1. Canvas);: = 'yes'; (image1. Canvas);;; TMain1. ExitClick (Sender: TObject);;; TMain1. FormPaint (Sender: TObject);. Caption: = pre. WholestepsText; keyb = 'no'keyb =' yes '; TMain1. FormKeyDown (Sender: TObject; var Key: Word;: TShiftState); ...