using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { Console.SetCursorPosition(0, 0); string str; StreamReader f = File.OpenText("c:\\Ourscreen.txt"); do { str = Convert.ToString(f.ReadLine()); Console.WriteLine(str); } while (!f.EndOfStream); f.Close(); int ran1, ran2; char[] setnames = new char[8] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H' }; Random random = new Random(); int m = 2; int[,] sets = new int[8, 8]; for (int i = 0; i <8; i++) { Console.SetCursorPosition(27, m); m++; Console.Write(setnames[i]+"={"); ran2 = random.Next(4, 9); for (int j = 0; j < ran2; j++) { ran1 = random.Next(1, 21); for (int k = 0; k < sets.GetLength(1); k++) { if (sets[i,k] == ran1) { ran1 = random.Next(1, 21); k = 0; } } sets[i,j] = ran1; if (j == ran2 - 1) Console.Write(sets[i,j]); else { Console.Write(sets[i,j] + ","); } } Console.Write("}"); Console.WriteLine(); } Console.ReadLine(); } } }
System.Media.SoundPlayer soundPlayer = new System.Media.SoundPlayer(); soundPlayer.SoundLocation = "sound.wav"; soundPlayer.Play(); // to play the sound in a loop, call soundPlayer.PlayLooping();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)