[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

easylang. help



PureBytes Links

Trading Reference Links

Hi everyone

I'm trying to create 6 digit numbers with unique digits(no one digit is
equals to other five);
Easylang.  code  and printout is included.(print statements are used for
debugging purposes)
There is a problem with the code: it's looping forever in n(5) and value of
n[5] is staying at 1
and never gets incremented to 2,3,4,5.
I looked at this simple code for 3 days now and coudn't come up with any
solution.

Please H E L P ! ! !

Thanks in advance

Ed


Vars:goodnbr(true),refnbr(0),x(0),y(0);
array:n[6](0);
If CurrentBar=1 Then Begin
 for n[0] = 0 to 5 begin
  print("n0",n[0]);
  for n[1] = 0 to 5 begin
   print("n1",n[1]);
   for n[2] = 0 to 5 begin
    print("n2",n[2]);
    for n[3] = 0 to 5 begin
     print("n3",n[3]);
     for n[4] = 0 to 5 begin
      print("n4",n[4]);
      for n[5] = 0 to 5 begin
       print("n5",n[5]);
       goodnbr=true;
       for x = 0 to 5 begin
        for y = 0 to 5 begin
         if x<>y and n[x]=n[y] then goodnbr=false;
        end;
       end;
       if goodnbr then begin
        refnbr=refnbr+1;
        value1=1*n[5]+10*n[4]+100*n[3]+1000*n[2]+10000*n[1]+100000*n[0];
        print(refnbr,value1);
       end;
       print("n5");
      end;
      print("n4");
     end;
    end;
   end;
  end;
 end;
end;
plot1(1);
*************************************
printout
************************************
n0      0.00
n1      0.00
n2      0.00
n3      0.00
n4      0.00
n5      0.00
n5
n5      1.00
n5
n5      1.00
n5
n5      1.00
n5
n5      1.00
................
................
................
................
................
................