PureBytes Links
Trading Reference Links
|
On Tue, 28 May 2002, ed wrote:
> 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.
I can't get into my TS6 just now, but what about something like this?
Does this code do the same thing you're wanting?
Mike
vars: loop(0), str(""), x(0), y(0), found(false);
array: a[5]("");
for loop = 0 to 1555555 begin
str = numtostr(loop, 0);
for x = 1 to 6 begin
a[x] = midstr(str, x, 1);
end;
found = false;
for x = 1 to 5 begin
for y = x to 6 begin
if a[x] = a[y] then
found = true;
end;
end;
if found = false then
print(numtostr(loop, 0));
end;
|