Time for an 2014 update…

This commit is contained in:
Ingy döt Net 2014-01-17 05:32:22 +00:00
parent 372c577f83
commit 09687c4926
2520 changed files with 34227 additions and 7318 deletions

View file

@ -0,0 +1,63 @@
with Loopers;
use Loopers;
procedure For_Main is
begin
Looper_1;
Looper_2;
Looper_3;
end For_Main;
package Loopers is
procedure Looper_1;
procedure Looper_2;
procedure Looper_3;
end Loopers;
with Ada.Text_IO, Ada.Integer_Text_IO;
use Ada.Text_IO, Ada.Integer_Text_IO;
package body Loopers is
procedure Looper_1 is
Values : array(1..5) of Integer := (2,4,6,8,10);
begin
for I in Values'Range loop
Put(Values(I),0);
if I = Values'Last then
Put_Line(".");
else
Put(",");
end if;
end loop;
end Looper_1;
procedure Looper_2 is
E : Integer := 5;
begin
for I in 1..E loop
Put(I*2,0);
if I = E then
Put_Line(".");
else
Put(",");
end if;
end loop;
end Looper_2;
procedure Looper_3 is
Values : array(1..10) of Integer := (1,2,3,4,5,6,7,8,9,10);
Indices : array(1..5) of Integer := (2,4,6,8,10);
begin
for I in Indices'Range loop
Put(Values(Indices(I)),0);
if I = Indices'Last then
Put_Line(".");
else
Put(",");
end if;
end loop;
end Looper_3;
end Loopers;

View file

@ -0,0 +1 @@
FOR I = 2 TO 8 STEP 2 : PRINT I; ", "; : NEXT I : PRINT "WHO DO WE APPRECIATE?"

View file

@ -0,0 +1,10 @@
for i in [1, 3 .. 11] do
Print(i, "\n");
od;
1
3
5
7
9
11

View file

@ -0,0 +1,4 @@
for i in 2:2:8
print(i, ", ")
end
println("whom do we appreciate?")

View file

@ -0,0 +1,3 @@
do thing=1 by 3/2 to 10
say thing
end