CKTIS / C#
System.Random: practical reference
System.Random: practical reference: Random generates a deterministic pseudorandom sequence determined by its state and seed.
Version: .NET API; verified against .NET 10 reference surface
Syntax
System.Random /* select a documented member or constructor */Random generates a deterministic pseudorandom sequence determined by its state and seed.
Use it for simulations and non-cryptographic draws; share Random.Shared.
It is unsuitable for secrets, and the same seed reproduces the sequence.
The upper bound of Next is exclusive, and an empty range returns its lower bound.
The complete program actually uses System.Random; its exact expected stdout is 9.
Examples
using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
using Number = System.Int32;
var random = new Random(123);
Console.WriteLine(random.Next(10));
Result
9
The complete program actually uses `System.Random`; its exact expected stdout is `9`.