tom99
2011-02-23 04:52:17
Hello this is a little lotto script, go ahead and see how many tries you will use to win first price, i know i will never bet as the chances is near 0%… lol
var
a,b,c,d,e,f,g,h:integer;
premie,premie2,premie3,premie4,premie5,premie6:integer;
begin
premie:=1;premie2:=1;premie3:=1;premie4:=1;premie5:=1;premie6:=1;
repeat
a:=(0)+random(47);
b:=(0)+random(47);
c:=(0)+random(47);
d:=(0)+random(47);
e:=(0)+random(47);
f:=(0)+random(47);
g:=(0)+random(47);
if not(a=b) or (a=c) or (a=d) or (a=e) or (a=f) or (a=g) then begin
if not(b=a) or (b=c) or (b=d) or (b=e) or (b=f) or (b=g) then begin
if not(c=a) or (c=b) or (c=d) or (c=e) or (c=f) or (b=g) then begin
if not(d=a) or (d=b) or (d=c) or (d=e) or (c=f) or (b=g) then begin
if not(e=a) or (e=b) or (e=c) or (e=b) or (e=f) or (e=g) then begin
if not(f=a) or (f=b) or (f=c) or (f=d) or (f=e) or (b=g) then begin
if not(g=a) or (g=b) or (g=c) or (g=d) or (g=e) or (g=f) then begin
writeln(a);
writeln(b);
writeln(c);
writeln(d);
writeln(e);
writeln(f);
writeln(g);
inc(h);
end;
end;
end;
end;
end;
end;
end;
if(a=5) and (b=11) and (c=15) and (d=3) and (f=8) and (g=20) then
begin
addtoreport('You won first price! prices won '+inttostr(premie));
terminatescript;
inc(premie);
end;
if(a=5) and (b=11) and (c=15) and (d=3) and (f=8)then
begin
addtoreport('You won second price! prices won '+inttostr(premie2));
inc(premie2);
end;
if(a=5) and (b=11) and (c=15) and (d=3) then
begin
addtoreport('You won third price! prices won '+inttostr(premie3));
inc(premie3);
end;
if(a=5) and (b=11) and (c=15) then
begin
addtoreport('You won fourth price! prices won '+inttostr(premie4));
inc(premie4);
end;
if(a=5) and (b=11) then
begin
addtoreport('You won fivth price! prices won '+inttostr(premie5));
inc(premie5);
end;
writeln('');
writeln('Number of attempts '+inttostr(h));
until(h>9999)
end.