⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wndcom.pas

📁 彩票号码筛选的程序
💻 PAS
字号:
unit WndCom;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TComForm = class(TForm)
    ListBox1: TListBox;
    Button3: TButton;
    ListBox2: TListBox;
    Panel1: TPanel;
    Button1: TButton;
    Button2: TButton;
    ListBox3: TListBox;
    Edit1: TEdit;
    Label1: TLabel;
    Button4: TButton;
    Panel2: TPanel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Edit2: TEdit;
    ComboBox1: TComboBox;
    Label9: TLabel;
    Edit3: TEdit;
    ListBox4: TListBox;
    Button5: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Edit1KeyPress(Sender: TObject; var Key: Char);
    procedure Edit2KeyPress(Sender: TObject; var Key: Char);
    procedure Edit3KeyPress(Sender: TObject; var Key: Char);
    procedure ComboBox1Select(Sender: TObject);
  private
     ListNo:Integer;
     Myarray:array[1..5040,1..7] of char;
    { Private declarations }
  public
    { Public declarations }
  end;

var
  ComForm: TComForm;

implementation

{$R *.dfm}
uses WndChoose;

procedure TComForm.Button1Click(Sender: TObject);
type
  items=array[1..7] of char;
var
  TempArray:packed array[1..5040] of items;
  temp,temp1:string[7];
  temp2:string[6];
  temp3:string[5];
  temp4:string[4];
  temp5:string[3];
  temp6:string[2];
  temp7:string[1];
  n,n1,L,r1,r2,r3,r4,r5,r6,r7,s1,s2,s3,s4,s5,s6,s7,e1,e2,e3,e4,e5,e6,e7:Integer;
begin
  if (Length(Edit1.Text)<>7) then
  begin
     edit1.SetFocus;
     ShowMessage('请正确输入七位号码!');
  end
  else
begin
   button3.Enabled:=True;
   button4.Enabled:=true;
   ListNo:=0;
   s1:=1;
   s2:=1;
   s3:=1;
   s4:=1;
   s5:=1;
   s6:=1;
   s7:=1;
   e1:=720;
   e2:=120;
   e3:=24;
   e4:=6;
   e5:=2;
   e6:=1;
   e7:=1;
   ListBox1.Items.Clear;
   temp1:=Edit1.Text;
   for r1:=1 to 7 do
   begin
      for n:=s1 to e1 do
      begin
       TempArray[n][1]:=(temp1[r1]);
       end;
       s1:=s1+720;
       e1:=e1+720;
       for r2:=1 to 6 do
       begin
          temp2:='';
          temp2:=copy(temp1,1,r1-1)+copy(temp1,r1+1,7-r1);
          for n:=s2 to e2 do
          begin
          TempArray[n][2]:=(temp2[r2]);
          end;
          s2:=s2+120;
          e2:=e2+120;
          for r3:=1 to 5 do
          begin
            temp3:='';
            temp3:=copy(temp2,1,r2-1)+copy(temp2,r2+1,6-r2);
            for n:=s3 to e3 do
            begin
            TempArray[n][3]:=(temp3[r3]);
            end;
            s3:=s3+24;
            e3:=e3+24;
            for r4:=1 to 4 do
            begin
              temp4:='';
              temp4:=copy(temp3,1,r3-1)+copy(temp3,r3+1,5-r3);
              for n:=s4 to e4 do
              begin
              TempArray[n][4]:=(temp4[r4]);
              end;
              s4:=s4+6;
              e4:=e4+6;
              for r5:=1 to 3 do
              begin
                temp5:='';
                temp5:=copy(temp4,1,r4-1)+copy(temp4,r4+1,4-r4);
                 for n:=s5 to e5 do
                 begin
                TempArray[n][5]:=(temp5[r5]);
                end;
                s5:=s5+2;
                e5:=e5+2;
                for r6:=1 to 2 do
                begin
                  temp6:='';
                  temp6:=copy(temp5,1,r5-1)+copy(temp5,r5+1,3-r5);
                   for n:=s6 to e6 do
                   begin
                  TempArray[n][6]:=(temp6[r6]);
                  end;
                  s6:=s6+1;
                  e6:=e6+1;
                  for r7:=1 to 1 do
                  begin
                     temp7:='';
                     temp7:=copy(temp6,1,r6-1)+copy(temp6,r6+1,2-r6);
                     for n:=s7 to e7 do
                     begin
                     TempArray[n][7]:=(temp7[r7]);
                     ListNo:=ListNo+1;
                     end;
                     s7:=s7+1;
                     e7:=e7+1;
                  end;
                end;
              end;
            end;
          end;
       end;
     end;

     showMessage(IntTOStr(ListNo));
     for n:=1 to ListNo do
     begin
       temp:='';
       for n1:=1 to 7 do
       begin
         Myarray[n,n1]:=TempArray[n][n1];
         temp:=temp+MyArray[n][n1];
       end;
       ListBox1.Items.Add(temp);
     end;
end;
end;

procedure TComForm.Button2Click(Sender: TObject);

begin
ListBox1.Items.SaveToFile('所有组合.txt');
ListBox2.Items.SaveToFile('变大组合组合.txt');
ListBox3.Items.SaveToFile('定位组合.txt');
showMessage('数据存在程序所在文件夹!') ;
end;

procedure TComForm.Button3Click(Sender: TObject);
var
  ch:TFrmChoose;
  ss1:string[1];
  temp:string[7];
  bn,k1,k2,n,r,L:integer;
begin
   ch:=TFrmChoose.Create(Application);//built the choose window
   ch.Label2.Visible:=False;
   ch.Edit2.Visible:=false;
   ch.Edit3.Visible:=false;
   ch.Label3.Visible:=false;
   ch.Button2.Visible:=false;

   ch.Label1.Top:=85;
   ch.Edit1.Top:=85;
   ch.Button1.Top:=85;
   bn:=ch.ShowModal;
   ss1:=trim(ch.Edit1.Text);
   ch.Destroy;
   if bn=mrOk then
   begin
      L:=1;
      ListBox2.Items.Clear;
      k1:=StrToInt(ss1[1]);
      for n:=1 to ListNo do
      begin
         k2:=0;
         temp:='';
         temp:=temp+Myarray[n,1] ;
         for r:=2 to 7 do
         begin
          temp:=temp+Myarray[n,r];
          if strToInt(temp[r])>StrToInt(temp[r-1]) then
          k2:=k2+1;
        end;
     if k1=k2 then
     begin
       for r:=1 to 7 do
         begin
         Myarray[L,r]:=temp[r];
         end;
         L:=L+1;
         ListBox2.Items.Add(temp);
     end;
   end;
   ListNo:=L-1;
   showMessage('还有'+IntTostr(L-1)+'注号码');
end;
end;
procedure TComForm.Button4Click(Sender: TObject);
var
  ch:TFrmChoose;
 p1,n1:string[1];
  temp:string[7];
  bn,k1,k2,n,r,m,L:integer;
begin
   ch:=TFrmChoose.Create(Application);//built the choose window
   ch.Label1.Visible:=False;
   ch.Edit1.Visible:=false;
   ch.Button1.Visible:=false;
   bn:=ch.ShowModal;    //display the choose window
   p1:='';
   n1:='';
   p1:=trim(ch.Edit2.Text);
   n1:=trim(ch.Edit3.Text);
   ch.Destroy;
   if bn=mrOk then
   begin
     L:=1;
     ListBox3.Items.Clear;
     k1:=StrToInt(p1[1]);
     K2:=StrToInt(n1[1]);
     if ListNo=1 then
     m:=5040
     else
     m:=ListNo-1;

     for n:=1 to m do
     begin
      temp:='';
       for r:=1 to 7 do
       begin
        temp:=temp+Myarray[n,r];
       end;
         if StrToInt(temp[k1])=k2 then
         begin
           for r:=1 to 7 do
           begin
           Myarray[L,r]:=temp[r];
           end;
           L:=L+1;
           ListBox3.Items.Add(temp);
         end;
      end;
      ListNo:=L-1;
      ShowMessage(IntToStr(ListNo));
    end;
  end;


procedure TComForm.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if not (key in ['0'..'9',#8,#13])then key:=#0 ;
  if key=#13 then edit1.setfocus;
end;

procedure TComForm.Edit2KeyPress(Sender: TObject; var Key: Char);
begin
   if not (key in ['0'..'9',#8,#13]) then key:=#0 ;
   if key=#13 then edit2.setfocus;
end;

procedure TComForm.Edit3KeyPress(Sender: TObject; var Key: Char);
begin
   if not (key in ['0'..'9',#8,#13]) then key:=#0 ;
   if key=#13 then edit3.setfocus;
end;

procedure TComForm.ComboBox1Select(Sender: TObject);
var temp1,temp2,temp:string;
    m,r,k,n:integer;
begin
   temp1:=trim(Edit3.Text);
   temp2:=trim(edit1.Text);
    k:=0;
    m:=1;
   if ComboBox1.ItemIndex=0 then
   begin
     for n:=1 to ListNo do
     begin
         temp:='';
         for r:=1 to 7 do
         begin
          temp:=temp+Myarray[n,r];
          if (odd(Integer(temp2[r]))=odd(Integer(Myarray[n,r]))) then
          k:=k+1;
        end;
        if k=StrToInt(temp1[1]) then
        begin
           for r:=1 to 7 do
           begin
             Myarray[m,r]:=temp[r];
           end;
          ListBox4.Items.Add(temp);
          m:=m+1;
         End;
     end;
     ListNo:=m-1;
     ShowMessage(IntToStr(ListNo));
   end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -