text stringlengths 0 234 |
|---|
Function Body: begin |
Put('A'); |
New_Line; |
Function Definition: procedure Power is |
Function Body: procedure PrintInt(N: Integer) is |
C: Integer := N rem 10; |
begin |
if N > 9 then PrintInt(N / 10); end if; |
Put(Character'Val(48 + C)); |
Function Definition: procedure Test is |
Function Body: type R is record A, B: Integer; end record; |
procedure P1(X, Y: in out R) is |
begin |
X.A := 0; |
X.B := 1; |
Y.A := 2; |
Y.B := 3; |
if X = Y then Put('a'); end if; |
X := Y; |
if X = Y then Put('d'); end if; |
Function Definition: procedure Syracuse is |
Function Body: procedure PrintInt(N: Integer) is |
C: Integer := N rem 10; |
begin |
if N > 9 then PrintInt(N / 10); end if; |
Put(Character'Val(48 + C)); |
Function Definition: procedure length is |
Function Body: v,j : integer; |
procedure step is |
begin |
v := v+1; if j = 2*(j/2) then j := j/2; else j := 3*j+1; end if; |
Function Definition: procedure Record3 is |
Function Body: type R is record A, B: Character; end record; |
type S is record C: Character; D: R; E: Character; end record; |
procedure PrintR(x: R) is |
begin |
Put('['); |
Put(x.A); |
Put(','); |
Put(x.B); |
Put(']'); |
Function Definition: procedure Quine is |
Function Body: type str; |
type u is access str; |
type str is record |
value : integer; |
tail : u; |
end record; |
procedure puts(s : u) is begin |
if s /= null then |
put(character'val(s.value)); |
puts(s.tail); |
end if; |
Function Definition: procedure Print_int is |
Function Body: procedure PrintInt(N: Integer) is |
C: Integer := N rem 10; |
begin |
if N > 9 then PrintInt(N / 10); end if; |
Put(Character'Val(48 + C)); |
Function Definition: procedure Test is |
Function Body: function F(X: Integer) return Integer is |
begin |
Put('F'); |
return X; |
Function Definition: procedure josephus is |
Function Body: type Node; |
type List is access Node; |
type Node is record |
Value: Integer; |
Prev, Next: List; |
end record; |
function Singleton(V: Integer) return List is |
L: List := new Node; |
begin |
L.Value := V; |
L.Prev := L; |
L.Next := L; |
return L; |
Function Definition: procedure NQueens is |
Function Body: procedure PrintInt(N: Integer) is |
C: Integer := N rem 10; |
begin |
if N > 9 then PrintInt(N / 10); end if; |
Put(Character'Val(48 + C)); |
Function Definition: procedure Mandelbrot is |
Function Body: -- Ada 2012 |
-- function Add(x, y: in Integer) return Integer is (X+Y); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.