📄 unit1.pas
字号:
form1.ADOQuery1.Next;
end;
form1.Series1.Clear ;
for j:=0 to 9 do form1.Series1.Add(tmp[j],'('+inttostr(j)+')',clTeeColor) ;
end;
Function pscheck(i,j: Integer;sinput:string): string; //密码加密解密
//i,加密解密控制变量(0/1),j,范围0-255
var
k,m,n:integer;
tmpstr:string;
begin
k:=0;
tmpstr:='';
n:= length(sinput);
if i=0 then
begin
for m:=1 to n do
begin
k:=ord(sinput[m]);
if k>j then
begin
k:=k-(255-j);
tmpstr:=tmpstr+chr(k);
end
else
begin
k:=k+(255-j);
tmpstr:=tmpstr+chr(k);
end;
end;
m:=m+1;
end
else
begin
for m:=1 to n do
begin
k:=ord(sinput[m]);
if k<j then
begin
k:=k+(255-j);
tmpstr:=tmpstr+chr(k);
end
else
begin
k:=k-(255-j);
tmpstr:=tmpstr+chr(k);
end;
end;
m:=m+1;
end;
result:=tmpstr;
end;
Function checknum(n1,n2,n3,n4,n5,n6,n7:string):string;
//过滤函数
var
numarray:array[1..7] of string;
i,j,k,m:integer;
tmp:array[0..9] of string;
tmps1,tmps2:string;
begin
numarray[1]:=n1;
numarray[2]:=n2;
numarray[3]:=n3;
numarray[4]:=n4;
numarray[5]:=n5;
numarray[6]:=n6;
numarray[7]:=n7;
i:=0;
//指定位不出现数字
IF form1.CheckBox2.Checked =true then
if i=0 then
begin
if form1.Editn11.Text=n1 then
i:=1;
if form1.Editn12.Text=n2 then
i:=1;
if form1.Editn13.Text=n3 then
i:=1;
if form1.Editn14.Text=n4 then
i:=1;
if form1.Editn15.Text=n5 then
i:=1;
if form1.Editn16.Text=n6 then
i:=1;
if form1.Editn17.Text=n7 then
i:=1;
end;
//过滤连续同码
IF form1.CheckBox3.Checked =true then
if i=0 then
begin
k:=strtoint(form1.ComboBox1.text);
case k of
2:
begin
for j:=1 to 6 do
begin
if numarray[j]=numarray[j+1] then
i:=1;
end;
end;
3:
begin
for j:=1 to 5 do
begin
if numarray[j]=numarray[j+1] then
if numarray[j]=numarray[j+2] then
i:=1;
end;
end;
4:
begin
for j:=1 to 4 do
begin
if numarray[j]=numarray[j+1] then
if numarray[j]=numarray[j+2] then
if numarray[j]=numarray[j+3] then
i:=1;
end;
end;
end;
end;
//过滤递增递减组合
IF form1.CheckBox4.Checked =true then
if i=0 then
begin
k:=strtoint(form1.ComboBox2.text); //位数
m:=strtoint(form1.ComboBox3.text); //增量
case k of
3:
begin
for j:=1 to 5 do
begin
if strtoint(numarray[j])+m=strtoint(numarray[j+1]) then
if strtoint(numarray[j+1])+m=strtoint(numarray[j+2]) then
i:=1;
if strtoint(numarray[j])-m=strtoint(numarray[j+1]) then
if strtoint(numarray[j+1])-m=strtoint(numarray[j+2]) then
i:=1;
end;
end;
4:
begin
for j:=1 to 4 do
begin
if strtoint(numarray[j])+m=strtoint(numarray[j+1]) then
if strtoint(numarray[j+1])+m=strtoint(numarray[j+2]) then
if strtoint(numarray[j+2])+m=strtoint(numarray[j+3]) then
i:=1;
if strtoint(numarray[j])-m=strtoint(numarray[j+1]) then
if strtoint(numarray[j+1])-m=strtoint(numarray[j+2]) then
if strtoint(numarray[j+2])-m=strtoint(numarray[j+3]) then
i:=1;
end;
end;
5:
begin
for j:=1 to 3 do
begin
if strtoint(numarray[j])+m=strtoint(numarray[j+1]) then
if strtoint(numarray[j+1])+m=strtoint(numarray[j+2]) then
if strtoint(numarray[j+2])+m=strtoint(numarray[j+3]) then
if strtoint(numarray[j+3])+m=strtoint(numarray[j+4]) then
i:=1;
if strtoint(numarray[j])-m=strtoint(numarray[j+1]) then
if strtoint(numarray[j+1])-m=strtoint(numarray[j+2]) then
if strtoint(numarray[j+2])-m=strtoint(numarray[j+3]) then
if strtoint(numarray[j+3])-m=strtoint(numarray[j+4]) then
i:=1;
end;
end;
end;
end;
//过滤对称数
IF form1.CheckBox5.Checked =true then
if i=0 then
begin
k:=strtoint(form1.ComboBox4.text); //位数
if k=3 then
if (numarray[1]+numarray[2]+numarray[3])=(numarray[7]+numarray[6]+numarray[5]) then
i:=1
else
if (numarray[1]+numarray[2])=(numarray[7]+numarray[6]) then
i:=1
else
if (numarray[2]+numarray[3])=(numarray[6]+numarray[5]) then
i:=1 ;
end;
// 过滤少于4个不同数字的号码组合
IF form1.CheckBox6.Checked =true then
if i=0 then
begin
for k:=0 to 9 do
tmp[k]:=inttostr(k);
m:=0;
for j:=1 to 7 do
begin
for k:=0 to 9 do
if tmp[k]=numarray[j] then
begin
tmp[k]:='F';
m:=m+1;
end;
end;
if m<4 then
i:=1;
end;
//计算该组合的奇偶
tmps1:=''; //组合的奇偶情况
for j:=1 to 7 do
tmps1:=tmps1+inttostr(strtoint(numarray[j]) mod 2);
// 过滤全部奇数或全部偶数的组合
IF form1.CheckBox7.Checked =true then
if i=0 then
begin
if tmps1='1111111' then i:=1
else
if tmps1='0000000' then i:=1;
end;
// 过滤与上期相同的奇偶组合
IF form1.CheckBox8.Checked =true then
if i=0 then
begin
tmps2:='';
for j:=1 to 7 do
tmps2:=tmps2+inttostr(strtoint(lastnum[j]) mod 2);
if tmps1=tmps2 then i:=1;
end;
// 过滤与上期同位相同数字
IF form1.CheckBox9.Checked =true then
if i=0 then
begin
m:=0;
for j:=1 to 7 do
if lastnum[j]=numarray[j] then tmp[j]:='s';
for j:=1 to 7 do
if tmp[j]='s' then m:=m+1;
if m>=strtoint(form1.ComboBox5.Text ) then i:=1;
end;
//最后的输出
if i=0 then
result:=numarray[1]+numarray[2]+numarray[3]+numarray[4]+numarray[5]+numarray[6]+numarray[7]
else
result:='FFFFFFF' ;
// result:='a'+numarray[1]+numarray[2]+numarray[3]+numarray[4]+numarray[5]+numarray[6]+numarray[7]+'/'+inttostr(tmp2);
end;
procedure TForm1.RadioButton5Click(Sender: TObject);
begin
edit1.Enabled :=true;
button9.Enabled :=true;
edit1.Text:='0';
end;
procedure TForm1.RadioButton2Click(Sender: TObject);
begin
edit1.Enabled :=false;
button9.Enabled :=false;
edit1.Text :='100';
label8.Caption :='目前统计的有100期';
adoquery1.Close ;
adoquery1.SQL.Clear ;
adoquery1.SQL.add('select * from sstar_count where allnum>='+'20'+' and allnum<'+'40');
adoquery1.Open ;
label52.Caption :=findmaxmin(1,5,100).min;
label53.Caption :=findmaxmin(1,5,100).max;
label54.Caption :=findmaxmin(2,5,100).min;
label55.Caption :=findmaxmin(2,5,100).max;
label56.Caption :=findmaxmin(3,5,100).min;
label57.Caption :=findmaxmin(3,5,100).max;
label58.Caption :=findmaxmin(4,5,100).min;
label59.Caption :=findmaxmin(4,5,100).max;
label60.Caption :=findmaxmin(5,5,100).min;
label61.Caption :=findmaxmin(5,5,100).max;
label62.Caption :=findmaxmin(6,5,100).min;
label63.Caption :=findmaxmin(6,5,100).max;
label64.Caption :=findmaxmin(7,5,100).min;
label65.Caption :=findmaxmin(7,5,100).max;
allnumchart(100);
end;
procedure TForm1.RadioButton3Click(Sender: TObject);
begin
edit1.Enabled :=false;
button9.Enabled :=false;
edit1.Text :='50';
label8.Caption :='目前统计的有50期';
adoquery1.Close ;
adoquery1.SQL.Clear ;
adoquery1.SQL.add('select * from sstar_count where allnum>='+'40'+' and allnum<'+'60');
adoquery1.Open ;
label52.Caption :=findmaxmin(1,5,50).min;
label53.Caption :=findmaxmin(1,5,50).max;
label54.Caption :=findmaxmin(2,5,50).min;
label55.Caption :=findmaxmin(2,5,50).max;
label56.Caption :=findmaxmin(3,5,50).min;
label57.Caption :=findmaxmin(3,5,50).max;
label58.Caption :=findmaxmin(4,5,50).min;
label59.Caption :=findmaxmin(4,5,50).max;
label60.Caption :=findmaxmin(5,5,50).min;
label61.Caption :=findmaxmin(5,5,50).max;
label62.Caption :=findmaxmin(6,5,50).min;
label63.Caption :=findmaxmin(6,5,50).max;
label64.Caption :=findmaxmin(7,5,50).min;
label65.Caption :=findmaxmin(7,5,50).max;
allnumchart(50);
end;
procedure TForm1.RadioButton4Click(Sender: TObject);
begin
edit1.Enabled :=false;
button9.Enabled :=false;
label8.Caption :='目前统计的有10期';
edit1.Text :='10';
adoquery1.Close ;
adoquery1.SQL.Clear ;
adoquery1.SQL.add('select * from sstar_count where allnum>='+'60'+' and allnum<'+'80');
adoquery1.Open ;
label52.Caption :=findmaxmin(1,5,10).min;
label53.Caption :=findmaxmin(1,5,10).max;
label54.Caption :=findmaxmin(2,5,10).min;
label55.Caption :=findmaxmin(2,5,10).max;
label56.Caption :=findmaxmin(3,5,10).min;
label57.Caption :=findmaxmin(3,5,10).max;
label58.Caption :=findmaxmin(4,5,10).min;
label59.Caption :=findmaxmin(4,5,10).max;
label60.Caption :=findmaxmin(5,5,10).min;
label61.Caption :=findmaxmin(5,5,10).max;
label62.Caption :=findmaxmin(6,5,10).min;
label63.Caption :=findmaxmin(6,5,10).max;
label64.Caption :=findmaxmin(7,5,10).min;
label65.Caption :=findmaxmin(7,5,10).max;
allnumchart(10);
end;
procedure TForm1.TabSheet7Show(Sender: TObject);
begin
if radiobutton1.Checked=true then
begin
try
edit1.Enabled :=false;
button9.Enabled :=false;
edit1.Text :='全部';
adoquery1.Close ;
adoquery1.SQL.Clear ;
label8.Caption :='目前统计的有'+inttostr(adotable1.RecordCount)+'期';
adoquery1.SQL.add('select * from sstar_count where allnum<'+'20');
adoquery1.Open ;
label52.Caption :=findmaxmin(1,5,9999).min;
label53.Caption :=findmaxmin(1,5,9999).max;
label54.Caption :=findmaxmin(2,5,9999).min;
label55.Caption :=findmaxmin(2,5,9999).max;
label56.Caption :=findmaxmin(3,5,9999).min;
label57.Caption :=findmaxmin(3,5,9999).max;
label58.Caption :=findmaxmin(4,5,9999).min;
label59.Caption :=findmaxmin(4,5,9999).max;
label60.Caption :=findmaxmin(5,5,9999).min;
label61.Caption :=findmaxmin(5,5,9999).max;
label62.Caption :=findmaxmin(6,5,9999).min;
label63.Caption :=findmaxmin(6,5,9999).max;
label64.Caption :=findmaxmin(7,5,9999).min;
label65.Caption :=findmaxmin(7,5,9999).max;
allnumchart(9999);
form1.StatusBar1.Panels[2].Text :='智能分析--基本信息(表格)';
except
StatusBar1.Panels[2].Text :='无法连接数据库!';
end;
end;
end;
procedure TForm1.Button10Click(Sender: TObject);
var
i,j:integer;
s,k,m:string;
begin
RichEdit1.Lines.Clear;
try
for i:=0 to strtoint(edit2.Text )-1 do
begin
for j:=0 to 6 do
begin
s:=s+inttostr(random(10));
end;
if CheckBoxnu1.Checked =true then
m:=checknum(copy(s,1,1),copy(s,2,1),copy(s,3,1),copy(s,4,1),copy(s,5,1),copy(s,6,1),copy(s,7,1))
else
m:=s;
if m<>'FFFFFFF' THEN
begin
k:=k+m+',';
s:='';
end;
end;
except
showmessage('请输入要生成的注数(1~9999999)');
end;
RichEdit1.Lines.Add(k);
end;
procedure TForm1.RadioButton7Click(Sender: TObject);
begin
PANEL4.Enabled:=true;
edit2.Enabled:=false;
button10.Enabled:=false;
CheckBoxnu1.Enabled:=false;
CheckBox1.Enabled:=true;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -