I see ClearSameInteger and ClearSameIntegerAndTPA, but its not the same as what a ClearSameTPA would be. Has this been discussed? I sure it would be a useful addition to something like wizzy plugin.
I see ClearSameInteger and ClearSameIntegerAndTPA, but its not the same as what a ClearSameTPA would be. Has this been discussed? I sure it would be a useful addition to something like wizzy plugin.
Originally Posted by irc
Compiled succesfully in 31 ms.Code:program new; function clearsametpa(a: TPointArray): TPointArray; var b: TPointArray; len, i, n: Integer; switch: boolean; begin switch := false; len := 0; result := []; setarraylength(b, length(a)); for i := 0 to high(a) do begin for n := 0 to high(b) do begin switch := a[i] = b[n]; if switch then break; end; if not switch then begin b[len] := a[i]; inc(len); switch := false; end; end; setarraylength(b, len); result := b; end; var a, b: array of TPoint; begin a := [point(1, 1), point(2, 2), point(2, 2), point(3, 3), point(5, 3), point(5, 3), point(3, 5)]; b := clearsametpa(a); writeln(a); writeln(b); end.
[(1, 1), (2, 2), (2, 2), (3, 3), (5, 3), (5, 3), (3, 5)]
[(1, 1), (2, 2), (3, 3), (5, 3), (3, 5)]
faster in plugin, and could be optimized?
edit: its damn slow on large sets.
Last edited by noidea; 06-09-2011 at 02:00 AM.
Originally Posted by irc
ClearDoubleTPA?
Writing an SRL Member Application | [Updated] Pascal Scripting Statements
My GitHub
Progress Report:13:46 <@BenLand100> <SourceCode> @BenLand100: what you have just said shows you have serious physchological problems 13:46 <@BenLand100> HE GETS IT! 13:46 <@BenLand100> HE FINALLY GETS IT!!!!1
Thanks.
Originally Posted by irc
There are currently 1 users browsing this thread. (0 members and 1 guests)