PermuteTPA

From SCAR Divi Manual
Revision as of 12:38, 8 December 2012 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> function PermuteTPA(const TPA: TPointArray): T2DPointArray; </source> ==Availability== SCAR Divi 3.38 > Current ==Descripti...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

function PermuteTPA(const TPA: TPointArray): T2DPointArray;

Availability

SCAR Divi 3.38 > Current

Description

Returns all permutations of the given array TPA.

Example

var
  ATPA: T2DPointArray;
  Idx, Len: Integer;
  
begin
  ATPA := PermuteTPA([Point(0, 0), Point(1, 1), Point(2, 2)]);
  Len := Length(ATPA);
  for Idx := 0 to Len - 1 do
    WriteLn(TPAToStr(ATPA[Idx]));
end.

Output:

(2,2);(0,0);(1,1)
(2,2);(1,1);(0,0)
(1,1);(2,2);(0,0)
(0,0);(2,2);(1,1)
(1,1);(0,0);(2,2)
(0,0);(1,1);(2,2)