type
TFigureWorkSheet=array[1..4,1..4] of Byte;
TFigureWorkSheetPos=array[1..4] of Integer;
TFigureType=(ftTriada,ftLCorner,ftRCorner,ftLZigzag,ftRZigzag,ftStick,ftBox,ftNull);
procedure TForm1.GenerateNewFigure;
var
RandomNum:Integer;
begin
ClearNextFigureWorkSheet;
NowFigureType:=NextFigureType;
InitialFigureWorkSheetPos;
if NowFigureType =ftNull then
begin
Randomize;
RandomNum:=Random(7);
case RandomNum of
0:begin
NowFigureType:=ftTriada;
Move(Triada,FigureWorkSheet,SizeOf(FigureWorkSheet));
end;
1:begin
NowFigureType:=ftLCorner;
Move(LCorner,FigureWorkSheet,SizeOf(FigureWorkSheet));
end;
2:begin
NowFigureType:=ftRCorner;
Move(RCorner,FigureWorkSheet,SizeOf(FigureWorkSheet));
end;
3:begin
NowFigureType:=ftLZigzag;
Move(LZigzag,FigureWorkSheet,SizeOf(FigureWorkSheet));
end;
4:begin
NowFigureType:=ftRZigzag;
Move(RZigzag,FigureWorkSheet,SizeOf(FigureWorkSheet));
end;
5:begin
NowFigureType:=ftStick;
Move(Stick,FigureWorkSheet,SizeOf(FigureWorkSheet));
end;
6:begin
NowFigureType:=ftBox;
Move(Box,FigureWorkSheet,SizeOf(FigureWorkSheet));
end;
end;
FigureColor:=RandomFigureColor;
// Label1.Caption:=Inttostr(FigureHorizonMaxSize);
//