Miscellany
public text v1 · immutablewith Ada.Calendar;
with Ada.Numerics.Discrete_Random;
procedure Random_Seed is
Now : constant Ada.Calendar.Day_Seconds :=
Ada.Calendar.Seconds (Ada.Calendar.Clock);
use type Ada.Calendar.Day_Seconds;
Seed : constant Integer := Integer (Now * 1000.0);
type Random_Value is range 1 .. 10;
package Random is new Ada.Numerics.Discrete_Random (Random_Value);
Gen : Random.Genrator;
begin
Random.Reset (Gen, Initiator => Seed);
end Random_Seed;