Changeset 6f7c049 in tol for tol_tests


Ignore:
Timestamp:
Mar 29, 2010, 10:10:33 AM (17 years ago)
Author:
Víctor de Buen <vdebuen@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
75e0fdd
Parents:
8e8520b
Message:

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@2070 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol_tests/tol/Bugzilla/bug_000869/test.tol

    r8e8520b r6f7c049  
    1515  Real numWar0 = Copy(NWarning);
    1616     
    17   Class @Circle
    18   {
    19   //Definition members
    20     Real _.center.x_;
    21     Real _.center.y_;
    22     Real _.radius;
    23  
    24   //Auxiliar members
    25     Real _.perimeter;
    26     Real _.area;
    27    
    28   //Basic Constructor
    29     Static @Circle New(
    30       Real x,  //First coordinate of center
    31       Real y,  //Second coordinate of center
    32       Real r)  //Radius
    33     {
    34       @Circle new =
    35       [[
    36         Real _.center.x_ = x;
    37         Real _.center.y_ = y;
    38         Real _.radius = r;
    39         //Auxiliuar members definition
    40         Real _.perimeter = 2*Pi*r;
    41         Real _.area = Pi*r^2
    42       ]]
    43     };
    44   //Derivate constructor
    45     Static @Circle Random(
    46      Real min.x, Real max.x,
    47      Real min.y, Real max.y,
    48      Real min.r, Real max.r)
    49     {
    50       @Circle::New(Rand(min.x,max.x),
    51                    Rand(min.y,max.y),
    52                    Rand(min.r,max.r))
    53     };
    54  
    55   //Returns true if the point (x,y) is inside the circle
    56   Real includes(Real x, Real y)
    57   {
    58     (x-_.center.x_)^2+(y-_.center.y_)^2<=_.radius^2
    59   };
    60   Real outsides(Real x, Real y){ Not(includes(x,y)) }
    61   };
    62  
    63   @Circle c1 = @Circle[[0,1,1]];
     17//////////////////////////////////////////////////////////////////////////////
     18// Compílese el archivo (con F9)
     19
     20Class @Element {
     21  Text _.info;
     22  Anything GetThis(Real void){ _this }
     23};
     24
     25NameBlock Container = [[
     26  Set _.elements = Copy(Empty);
     27  Real CreateElement(Text info) {
     28    @Element element = [[
     29      Text _.info = info
     30    ]];
     31    Set Append(_.elements, [[element]]);
     32  0};
     33  @Element GetElement(Real index) {
     34    _.elements[index]
     35  }
     36]];
     37
     38Real Container::CreateElement("nota");
     39
     40
     41/*
    6442 
    6543  Real numErr1 = Copy(NError);
Note: See TracChangeset for help on using the changeset viewer.