Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,21 +0,0 @@
with Ada.Text_Io;
with Ada.Float_Text_Io;
with Ada.Integer_Text_Io;
procedure Two_Dimensional_Arrays is
type Matrix_Type is array(Positive range <>, Positive range <>) of Float;
Dim_1 : Positive;
Dim_2 : Positive;
begin
Ada.Integer_Text_Io.Get(Item => Dim_1);
Ada.Integer_Text_Io.Get(Item => Dim_2);
-- Create an inner block with the correctly sized array
declare
Matrix : Matrix_Type(1..Dim_1, 1..Dim_2);
begin
Matrix(1, Dim_2) := 3.14159;
Ada.Float_Text_Io.Put(Item => Matrix(1, Dim_2), Fore => 1, Aft => 5, Exp => 0);
Ada.Text_Io.New_Line;
end;
-- The variable Matrix is popped off the stack automatically
end Two_Dimensional_Arrays;

View file

@ -1,12 +0,0 @@
; == get dimensions from user input
$sInput = InputBox('2D Array Creation', 'Input comma separated count of rows and columns, i.e. "5,3"')
$aDimension = StringSplit($sInput, ',', 2)
; == create array
Dim $a2D[ $aDimension[0] ][ $aDimension[1] ]
; == write value to last row/last column
$a2D[ UBound($a2D) -1 ][ UBound($a2D, 2) -1 ] = 'test string'
; == output this value to MsgBox
MsgBox(0, 'Output', 'row[' & UBound($a2D) -1 & '], col[' & UBound($a2D, 2) -1 & ']' & @CRLF & '= ' & $a2D[ UBound($a2D) -1 ][ UBound($a2D, 2) -1 ] )

View file

@ -1,6 +1,6 @@
import extensions;
public program()
public Program()
{
var n := new Integer();
var m := new Integer();

View file

@ -1,7 +1,7 @@
import system'routines;
import extensions;
public program()
public Program()
{
auto n := new Integer();
auto m := new Integer();

View file

@ -1,15 +0,0 @@
include get.e
sequence array
integer height,width,i,j
height = floor(prompt_number("Enter height: ",{}))
width = floor(prompt_number("Enter width: ",{}))
array = repeat(repeat(0,width),height)
i = floor(height/2+0.5)
j = floor(width/2+0.5)
array[i][j] = height + width
printf(1,"array[%d][%d] is %d\n", {i,j,array[i][j]})

View file

@ -1,22 +0,0 @@
function Read-ArrayIndex ([string]$Prompt = "Enter an integer greater than zero")
{
[int]$inputAsInteger = 0
while (-not [Int]::TryParse(([string]$inputString = Read-Host $Prompt), [ref]$inputAsInteger))
{
$inputString = Read-Host "Enter an integer greater than zero"
}
if ($inputAsInteger -gt 0) {return $inputAsInteger} else {return 1}
}
$x = $y = $null
do
{
if ($x -eq $null) {$x = Read-ArrayIndex -Prompt "Enter two dimensional array index X"}
if ($y -eq $null) {$y = Read-ArrayIndex -Prompt "Enter two dimensional array index Y"}
}
until (($x -ne $null) -and ($y -ne $null))
$array2d = New-Object -TypeName 'System.Object[,]' -ArgumentList $x, $y

View file

@ -1,6 +0,0 @@
[int]$k = 1
for ($i = 0; $i -lt 6; $i++)
{
0..5 | ForEach-Object -Begin {$k += 10} -Process {$array2d[$i,$_] = $k + $_}
}

View file

@ -1,4 +0,0 @@
for ($i = 0; $i -lt 6; $i++)
{
"{0}`t{1}`t{2}`t{3}`t{4}`t{5}" -f (0..5 | ForEach-Object {$array2d[$i,$_]})
}

View file

@ -1,5 +1,5 @@
-- 8 Aug 2025
include Settings
-- 23 Aug 2025
include Setting
signal off novalue
say 'CREATE AN TWO-DIMENSIONAL ARRAY AT RUNTIME'