// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Collections.Generic; using System.IO; using System.Drawing; using System.Windows.Forms; namespace E { public partial class MainForm { [STAThread] public static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } public MainForm() { InitializeComponent(); } private static Random rng = new Random(); private void Button1Click(object sender, System.EventArgs e) { int min = int.Parse(textBox1.Text); int max = int.Parse(textBox2.Text); List nums = new List(); for(int i = min; i <= max; i++) nums.Add(i); StreamWriter sw = new StreamWriter(@"C:\nums.txt"); while(nums.Count > 0) { int ix = rng.Next(nums.Count); sw.WriteLine(nums[ix]); nums.RemoveAt(ix); } sw.Close(); } } }