Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Semrush - keyword research tool

Create your online store today with Shopify

Turn ChatGPT, Claude, Gemini, And CoPilot Into Your Personal Assistant, Business Coach, Content Creator, And More

AFFILIATE MARKETING Your all-in-one performance engine Manage affiliates, creators, and customer referrals in one unified platform—turning every partnership into measurable growth

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Disclosure: My content contains affiliate links.

43,569 questions

56,787 answers

573 users

How to use the clock as a random generator seed in Pascal

1 Answer

0 votes
program RandomSeedExample;

uses
  SysUtils; // For Randomize

var
  i: Integer;
  randomNumber: Longword; // Longword = unsigned 32-bits integer
 
begin
  // Seed the random number generator with the current time
  Randomize;  
   
  for i := 1 to 40 do
  begin
    // Generate a random number between 1 and 100
    randomNumber := Random(100) + 1;
     
    Writeln(randomNumber);
  end;
end.




(*
run:

73
32
48
61
19
69
14
60
90
45
81
2
59
79
92
9
66
2
88
62
61
1
25
10
41
71
44
11
71
79
35
11
4
63
24
86
82
16
35
100

*)



 



answered May 8, 2025 by avibootz
...