Data update

This commit is contained in:
Ingy döt Net 2026-04-30 12:34:36 -04:00
parent 4bb20c9b71
commit cbaf4c4b64
12390 changed files with 318560 additions and 27248 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,14 @@
IDENTIFICATION DIVISION.
PROGRAM-ID. Display-Odd-Nums.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 I PIC 99.
PROCEDURE DIVISION.
PERFORM VARYING I FROM 1 BY 2 UNTIL 10 < I
DISPLAY I
END-PERFORM
GOBACK
.

View file

@ -0,0 +1,6 @@
// Can be set on commandline via --N=x
config const N = 3;
for i in 1 .. 10 by N {
writeln(i);
}

View file

@ -1,4 +1,3 @@
# Prints even numbers from 0 to 100
for i = 0 step 2 to 100
for i = 0 step 2 to 10
print i
.

View file

@ -0,0 +1,3 @@
for i = 1 to 10 by 2 do
? i
end for

View file

@ -0,0 +1,2 @@
print(1, something)
puts(1, "\n")

View file

@ -0,0 +1,23 @@
class Step {
var end:Int;
var step:Int;
var index:Int;
public inline function new(start:Int, end:Int, step:Int) {
this.index = start;
this.end = end;
this.step = step;
}
public inline function hasNext() return step > 0 ? end >= index : index >= end;
public inline function next() return (index += step) - step;
}
class Main {
static function main() {
for (i in new Step(2, 8, 2)) {
Sys.print('$i ');
}
Sys.println('WHOM do we appreciate? GRAMMAR! GRAMMAR! GRAMMAR!');
}
}

View file

@ -0,0 +1,3 @@
for (i = 0; i < 50; i += 5) {
println i
}

View file

@ -0,0 +1,11 @@
HAI 1.3
HOW IZ I ADDINGTWO YR X
FOUND YR SUM OF X AN 2
IF U SAY SO
IM IN YR LOOP I IZ ADDINGTWO YR N MKAY TIL BOTH SAEM N AN 10
VISIBLE N
IM OUTTA YR LOOP
KTHXBYE

View file

@ -0,0 +1,10 @@
(* Loops/For with a specified step *)
block
var
i: integer;
begin
for i := 0 step 5 to 30
do
writeln(i)
od;
end;

View file

@ -0,0 +1,3 @@
for ($i = 0; $i -lt 10; $i += 2) {
$i
}

View file

@ -0,0 +1,2 @@
for i 2 8 2 [prin join i ", "]
print "who do we appreciate?"

View file

@ -0,0 +1,5 @@
buffer = ""
For i = 2 To 8 Step 2
buffer = buffer & i & " "
Next
WScript.Echo buffer