Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,14 +0,0 @@
|
|||
with Ada.Integer_Text_IO;
|
||||
use Ada.Integer_Text_IO;
|
||||
|
||||
procedure For_Each is
|
||||
|
||||
A : array (1..5) of Integer := (-1, 0, 1, 2, 3);
|
||||
|
||||
begin
|
||||
|
||||
for Num in A'Range loop
|
||||
Put( A (Num) );
|
||||
end loop;
|
||||
|
||||
end For_Each;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
for Item of A loop
|
||||
Put( Item );
|
||||
end loop;
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
with Ada.Integer_Text_IO, Ada.Containers.Doubly_Linked_Lists;
|
||||
use Ada.Integer_Text_IO, Ada.Containers;
|
||||
|
||||
procedure Doubly_Linked_List is
|
||||
|
||||
package DL_List_Pkg is new Doubly_Linked_Lists (Integer);
|
||||
use DL_List_Pkg;
|
||||
|
||||
procedure Print_Node (Position : Cursor) is
|
||||
begin
|
||||
Put (Element (Position));
|
||||
end Print_Node;
|
||||
|
||||
DL_List : List;
|
||||
|
||||
begin
|
||||
|
||||
DL_List.Append (1);
|
||||
DL_List.Append (2);
|
||||
DL_List.Append (3);
|
||||
|
||||
-- Iterates through every node of the list.
|
||||
DL_List.Iterate (Print_Node'Access);
|
||||
|
||||
end Doubly_Linked_List;
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
with Ada.Integer_Text_IO, Ada.Containers.Vectors;
|
||||
use Ada.Integer_Text_IO, Ada.Containers;
|
||||
|
||||
procedure Vector_Example is
|
||||
|
||||
package Vector_Pkg is new Vectors (Natural, Integer);
|
||||
use Vector_Pkg;
|
||||
|
||||
procedure Print_Element (Position : Cursor) is
|
||||
begin
|
||||
Put (Element (Position));
|
||||
end Print_Element;
|
||||
|
||||
V : Vector;
|
||||
|
||||
begin
|
||||
|
||||
V.Append (1);
|
||||
V.Append (2);
|
||||
V.Append (3);
|
||||
|
||||
-- Iterates through every element of the vector.
|
||||
V.Iterate (Print_Element'Access);
|
||||
|
||||
end Vector_Example;
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
01 things occurs 3.
|
||||
...
|
||||
set content of things to ("Apple", "Banana", "Coconut")
|
||||
perform varying thing as string through things
|
||||
display thing
|
||||
end-perform
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
var food = ["Milk", "Bread", "Butter"];
|
||||
for f in food do writeln(f);
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
import system'routines;
|
||||
import extensions;
|
||||
|
||||
public program()
|
||||
public Program()
|
||||
{
|
||||
var things := new string[]{"Apple", "Banana", "Coconut"};
|
||||
|
||||
things.forEach::(thing)
|
||||
{
|
||||
console.printLine(thing)
|
||||
Console.printLine(thing)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import extensions;
|
||||
|
||||
public program()
|
||||
public Program()
|
||||
{
|
||||
var things := new string[]{"Apple", "Banana", "Coconut"};
|
||||
|
||||
foreach(var thing; in things)
|
||||
{
|
||||
console.printLine(thing)
|
||||
Console.printLine(thing)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +0,0 @@
|
|||
(dolist (x '(1 2 3 4))
|
||||
(message "x=%d" x))
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
(mapc (lambda (x)
|
||||
(message "x=%d" x))
|
||||
'(1 2 3 4))
|
||||
|
|
@ -1 +0,0 @@
|
|||
(cl-loop for x in '(1 2 3 4) do (message "x=%d" x))
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
include std/console.e
|
||||
|
||||
sequence s = {-2,-1,0,1,2} --print elements of a numerical list
|
||||
for i = 1 to length(s) do
|
||||
? s[i]
|
||||
end for
|
||||
|
||||
puts(1,'\n')
|
||||
|
||||
s = {"Name","Date","Field1","Field2"} -- print elements of a list of 'strings'
|
||||
for i = 1 to length(s) do
|
||||
printf(1,"%s\n",{s[i]})
|
||||
end for
|
||||
|
||||
puts(1,'\n')
|
||||
|
||||
for i = 1 to length(s) do -- print subelements of elements of a list of 'strings'
|
||||
for j = 1 to length(s[i]) do
|
||||
printf(1,"%s\n",s[i][j])
|
||||
end for
|
||||
puts(1,'\n')
|
||||
end for
|
||||
|
||||
if getc(0) then end if
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
var a = [1, 2, 3, 4];
|
||||
|
||||
for (i in a)
|
||||
Sys.println(i);
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
$colors = "Black","Blue","Cyan","Gray","Green","Magenta","Red","White","Yellow",
|
||||
"DarkBlue","DarkCyan","DarkGray","DarkGreen","DarkMagenta","DarkRed","DarkYellow"
|
||||
|
||||
foreach ($color in $colors)
|
||||
{
|
||||
Write-Host "$color" -ForegroundColor $color
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
REBOL [
|
||||
Title: "Loop/Foreach"
|
||||
URL: http://rosettacode.org/wiki/Loop/Foreach
|
||||
]
|
||||
|
||||
names: [Sork Gun Blues Neds Thirst Fright Catur]
|
||||
|
||||
foreach name names [prin join name "day "] print ""
|
||||
|
||||
; Rebol also has the 'forall' construct, which provides the rest of
|
||||
; the list from the current position.
|
||||
|
||||
forall names [prin join names/1 "day "] print ""
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
let fruits = ["apple", "banana", "coconut"]
|
||||
|
||||
Js.Array2.forEach(fruits, f => Js.log(f))
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
items = Array("Apple", "Orange", "Banana")
|
||||
|
||||
For Each x In items
|
||||
WScript.Echo x
|
||||
Next
|
||||
Loading…
Add table
Add a link
Reference in a new issue