还没有好?
昨天不是说了吗
我这个生成算法不知是否正确
数量有1100000,随便写了一下
但是显示肯定很快
匆忙写的代码,吃饭了
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TBall = record
X1, X2, X3, X4, X5, X6, Y: Byte;
end;
TBallArray = array [0..1100000] of TBall;
TForm1 = class(TForm)
Button1: TButton;
ListView1: TListView;
procedure Button1Click(Sender: TObject);
procedure ListView1Data(Sender: TObject; Item: TListItem);
private
{ Private declarations }
public
v: TBallArray;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
i, j, k, l, m, n, q: Integer;
c: Integer;
begin
c := 0;
for i := 1 to 33 do
begin
for j := 2 to 33 do
begin
for k := 3 to 33 do
begin
for l := 4 to 33 do
begin
for m := 5 to 33 do
begin
for n := 6 to 33 do
begin
for q := 1 to 16 do
begin
v[c].X1 := i;
v[c].X2 := j;
v[c].X3 := k;
v[c].X4 := l;
v[c].X5 := m;
v[c].X6 := n;
v[c].Y := q;
Inc(c);
if c > 1100000 then
Break;
end;
if c > 1100000 then
Break;
end;
if c > 1100000 then
Break;
end;
if c > 1100000 then
Break;
end;
if c > 1100000 then
Break;
end;
if c > 1100000 then
Break;
end;
if c > 1100000 then
Break;
end;
ListView1.Items.Count := 1100000;
ListView1.Refresh;
end;
procedure TForm1.ListView1Data(Sender: TObject; Item: TListItem);
begin
if Item.Index > 1100000 then
Exit;
with Item do
begin
Caption := IntToStr(v[Item.Index].X1);
SubItems.Add(IntToStr(v[Item.Index].X2));
SubItems.Add(IntToStr(v[Item.Index].X3));
SubItems.Add(IntToStr(v[Item.Index].X4));
SubItems.Add(IntToStr(v[Item.Index].X5));
SubItems.Add(IntToStr(v[Item.Index].X6));
SubItems.Add(IntToStr(v[Item.Index].Y));
end;
end;
end.
object Form1: TForm1
Left = 192
Top = 140
Width = 696
Height = 480
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
PixelsPerInch = 96
TextHeight = 13
object Button1: TButton
Left = 584
Top = 8
Width = 75
Height = 25
Caption = 'Button1'
TabOrder = 0
OnClick = Button1Click
end
object ListView1: TListView
Left = 8
Top = 16
Width = 553
Height = 409
Columns = <
item
end
item
end
item
end
item
end
item
end
item
end
item
end>
OwnerData = True
TabOrder = 1
ViewStyle = vsReport
OnData = ListView1Data
end
end