Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,30 +0,0 @@
|
|||
with Ada.Text_IO, Ada.Numerics.Float_Random;
|
||||
|
||||
procedure Pick_Random_Element is
|
||||
|
||||
package Rnd renames Ada.Numerics.Float_Random;
|
||||
Gen: Rnd.Generator; -- used globally
|
||||
|
||||
type Char_Arr is array (Natural range <>) of Character;
|
||||
|
||||
function Pick_Random(A: Char_Arr) return Character is
|
||||
-- Chooses one of the characters of A (uniformly distributed)
|
||||
begin
|
||||
return A(A'First + Natural(Rnd.Random(Gen) * Float(A'Last)));
|
||||
end Pick_Random;
|
||||
|
||||
Vowels : Char_Arr := ('a', 'e', 'i', 'o', 'u');
|
||||
Consonants: Char_Arr := ('t', 'n', 's', 'h', 'r', 'd', 'l');
|
||||
Specials : Char_Arr := (',', '.', '?', '!');
|
||||
|
||||
begin
|
||||
Rnd.Reset(Gen);
|
||||
for J in 1 .. 3 loop
|
||||
for I in 1 .. 10 loop
|
||||
Ada.Text_IO.Put(Pick_Random(Consonants));
|
||||
Ada.Text_IO.Put(Pick_Random(Vowels));
|
||||
end loop;
|
||||
Ada.Text_IO.Put(Pick_Random(Specials) & " ");
|
||||
end loop;
|
||||
Ada.Text_IO.New_Line;
|
||||
end Pick_Random_Element;
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
>>SOURCE FREE
|
||||
IDENTIFICATION DIVISION.
|
||||
PROGRAM-ID. random-element.
|
||||
|
||||
DATA DIVISION.
|
||||
WORKING-STORAGE SECTION.
|
||||
01 nums-area VALUE "123456789".
|
||||
03 nums PIC 9 OCCURS 9 TIMES.
|
||||
|
||||
01 random-idx PIC 9 COMP.
|
||||
|
||||
PROCEDURE DIVISION.
|
||||
COMPUTE random-idx = FUNCTION RANDOM(FUNCTION CURRENT-DATE (9:7)) * 9 + 1
|
||||
DISPLAY nums (random-idx)
|
||||
.
|
||||
END PROGRAM random-element.
|
||||
|
|
@ -3,12 +3,12 @@ import extensions;
|
|||
extension listOp
|
||||
{
|
||||
randomItem()
|
||||
= self[randomGenerator.nextInt(self.Length)];
|
||||
= self[Random.nextInt(self.Length)];
|
||||
}
|
||||
|
||||
public program()
|
||||
{
|
||||
var item := new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
auto item := new int[]{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
|
||||
|
||||
console.printLine("I picked element ",item.randomItem())
|
||||
Console.printLine("I picked element ",item.randomItem())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
(defun random-choice (items)
|
||||
(nth (random (length items)) items))
|
||||
|
||||
(random-choice '("a" "b" "c"))
|
||||
;; => "a"
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
constant s = {'a', 'b', 'c'}
|
||||
puts(1,s[rand($)])
|
||||
|
|
@ -1 +0,0 @@
|
|||
1..100 | Get-Random -Count 3
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
let fruits = ["apple", "banana", "coconut", "orange", "lychee"]
|
||||
|
||||
let pickRand = arr => {
|
||||
let len = Js.Array.length(arr)
|
||||
let i = Js.Math.random_int(0, len)
|
||||
arr[i]
|
||||
}
|
||||
|
||||
Js.log(pickRand(fruits))
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
Function pick_random(arr)
|
||||
Set objRandom = CreateObject("System.Random")
|
||||
pick_random = arr(objRandom.Next_2(0,UBound(arr)+1))
|
||||
End Function
|
||||
|
||||
WScript.Echo pick_random(Array("a","b","c","d","e","f"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue