Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,17 +0,0 @@
|
|||
package Shapes is
|
||||
type Point is tagged private;
|
||||
procedure Print(Item : in Point);
|
||||
function Setx(Item : in Point; Val : Integer) return Point;
|
||||
function Sety(Item : in Point; Val : Integer) return Point;
|
||||
function Getx(Item : in Point) return Integer;
|
||||
function Gety(Item : in Point) return Integer;
|
||||
function Create return Point;
|
||||
function Create(X : Integer) return Point;
|
||||
function Create(X, Y : Integer) return Point;
|
||||
|
||||
private
|
||||
type Point is tagged record
|
||||
X : Integer := 0;
|
||||
Y : Integer := 0;
|
||||
end record;
|
||||
end Shapes;
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
with Ada.Text_Io; use Ada.Text_Io;
|
||||
|
||||
package body Shapes is
|
||||
|
||||
-----------
|
||||
-- Print --
|
||||
-----------
|
||||
|
||||
procedure Print (Item : in Point) is
|
||||
begin
|
||||
Put_line("Point");
|
||||
end Print;
|
||||
|
||||
----------
|
||||
-- Setx --
|
||||
----------
|
||||
|
||||
function Setx (Item : in Point; Val : Integer) return Point is
|
||||
begin
|
||||
return (Val, Item.Y);
|
||||
end Setx;
|
||||
|
||||
----------
|
||||
-- Sety --
|
||||
----------
|
||||
|
||||
function Sety (Item : in Point; Val : Integer) return Point is
|
||||
begin
|
||||
return (Item.X, Val);
|
||||
end Sety;
|
||||
|
||||
----------
|
||||
-- Getx --
|
||||
----------
|
||||
|
||||
function Getx (Item : in Point) return Integer is
|
||||
begin
|
||||
return Item.X;
|
||||
end Getx;
|
||||
|
||||
----------
|
||||
-- Gety --
|
||||
----------
|
||||
|
||||
function Gety (Item : in Point) return Integer is
|
||||
begin
|
||||
return Item.Y;
|
||||
end Gety;
|
||||
|
||||
------------
|
||||
-- Create --
|
||||
------------
|
||||
|
||||
function Create return Point is
|
||||
begin
|
||||
return (0, 0);
|
||||
end Create;
|
||||
|
||||
------------
|
||||
-- Create --
|
||||
------------
|
||||
|
||||
function Create (X : Integer) return Point is
|
||||
begin
|
||||
return (X, 0);
|
||||
end Create;
|
||||
|
||||
------------
|
||||
-- Create --
|
||||
------------
|
||||
|
||||
function Create (X, Y : Integer) return Point is
|
||||
begin
|
||||
return (X, Y);
|
||||
end Create;
|
||||
|
||||
end Shapes;
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package Shapes.Circles is
|
||||
type Circle is new Point with private;
|
||||
procedure Print(Item : Circle);
|
||||
function Setx(Item : Circle; Val : Integer) return Circle;
|
||||
function Sety(Item : Circle; Val : Integer) return Circle;
|
||||
function Setr(Item : Circle; Val : Integer) return Circle;
|
||||
function Getr(Item : Circle) return Integer;
|
||||
function Create(P : Point) return Circle;
|
||||
function Create(P : Point; R : Integer) return Circle;
|
||||
function Create(X : Integer) return Circle;
|
||||
function Create(X : Integer; Y : Integer) return Circle;
|
||||
function Create(X : Integer; Y : Integer; R : Integer) return Circle;
|
||||
function Create return Circle;
|
||||
private
|
||||
type Circle is new Point with record
|
||||
R : Integer := 0;
|
||||
end record;
|
||||
end Shapes.Circles;
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
with Ada.Text_Io; use Ada.Text_IO;
|
||||
|
||||
package body Shapes.Circles is
|
||||
|
||||
-----------
|
||||
-- Print --
|
||||
-----------
|
||||
|
||||
procedure Print (Item : Circle) is
|
||||
begin
|
||||
Put_line("Circle");
|
||||
end Print;
|
||||
|
||||
----------
|
||||
-- Setx --
|
||||
----------
|
||||
|
||||
function Setx (Item : Circle; Val : Integer) return Circle is
|
||||
begin
|
||||
return (Val, Item.Y, Item.R);
|
||||
end Setx;
|
||||
|
||||
----------
|
||||
-- Sety --
|
||||
----------
|
||||
|
||||
function Sety (Item : Circle; Val : Integer) return Circle is
|
||||
Temp : Circle := Item;
|
||||
begin
|
||||
Temp.Y := Val;
|
||||
return Temp;
|
||||
end Sety;
|
||||
|
||||
----------
|
||||
-- Setr --
|
||||
----------
|
||||
|
||||
function Setr (Item : Circle; Val : Integer) return Circle is
|
||||
begin
|
||||
return (Item.X, Item.Y, Val);
|
||||
end Setr;
|
||||
|
||||
----------
|
||||
-- Getr --
|
||||
----------
|
||||
|
||||
function Getr (Item : Circle) return Integer is
|
||||
begin
|
||||
return Item.R;
|
||||
end Getr;
|
||||
|
||||
------------
|
||||
-- Create --
|
||||
------------
|
||||
|
||||
function Create (P : Point) return Circle is
|
||||
begin
|
||||
return (P.X, P.Y, 0);
|
||||
end Create;
|
||||
|
||||
------------
|
||||
-- Create --
|
||||
------------
|
||||
|
||||
function Create (P : Point; R : Integer) return Circle is
|
||||
begin
|
||||
return (P.X, P.Y, R);
|
||||
end Create;
|
||||
|
||||
------------
|
||||
-- Create --
|
||||
------------
|
||||
|
||||
function Create (X : Integer) return Circle is
|
||||
begin
|
||||
return (X, 0, 0);
|
||||
end Create;
|
||||
|
||||
------------
|
||||
-- Create --
|
||||
------------
|
||||
|
||||
function Create (X : Integer; Y : Integer) return Circle is
|
||||
begin
|
||||
return (X, Y, 0);
|
||||
end Create;
|
||||
|
||||
------------
|
||||
-- Create --
|
||||
------------
|
||||
|
||||
function Create (X : Integer; Y : Integer; R : Integer) return Circle is
|
||||
begin
|
||||
return (X, Y, R);
|
||||
end Create;
|
||||
|
||||
------------
|
||||
-- Create --
|
||||
------------
|
||||
|
||||
function Create return Circle is
|
||||
begin
|
||||
return (0, 0, 0);
|
||||
end Create;
|
||||
|
||||
end Shapes.Circles;
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
with Shapes.Circles; use Shapes.Circles;
|
||||
use Shapes;
|
||||
|
||||
procedure Shapes_Main is
|
||||
P : Point;
|
||||
C : Circle;
|
||||
begin
|
||||
P.Print;
|
||||
C.Print;
|
||||
end Shapes_Main;
|
||||
|
|
@ -1,21 +1,21 @@
|
|||
define :point [x,y][
|
||||
init: [
|
||||
ensure -> is? :floating this\x
|
||||
ensure -> is? :floating this\y
|
||||
define :point [
|
||||
init: method [x :floating, y :floating][
|
||||
this\x: x
|
||||
this\y: y
|
||||
]
|
||||
|
||||
print: [
|
||||
string: method [][
|
||||
render "point (x: |this\x|, y: |this\y|)"
|
||||
]
|
||||
]
|
||||
|
||||
define :circle [center,radius][
|
||||
init: [
|
||||
ensure -> is? :point this\center
|
||||
ensure -> is? :floating this\radius
|
||||
define :circle [
|
||||
init: method [center :point, radius :floating][
|
||||
this\center: center
|
||||
this\radius: radius
|
||||
]
|
||||
|
||||
print: [
|
||||
string: method [][
|
||||
render "circle (center: |this\center|, radius: |this\radius|)"
|
||||
]
|
||||
]
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class Circle : Point
|
|||
R := r
|
||||
}
|
||||
|
||||
print() { console.printLine("Circle") }
|
||||
print() { Console.printLine("Circle") }
|
||||
}
|
||||
|
||||
public program()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue