Random Nesnesi ve Kullanımı
Delay komutu.
Ekran Kullanımı
static void Main(string[] args) { Random Rastgale = new Random(); void Örnek() {int Sütun, Satır,Renk; while (true) { Sütun = Rastgale.Next(0, 100); Satır = Rastgale.Next(0, 30); Renk = Rastgale.Next(1, 10); System.Threading.Thread.Sleep(10); if (Renk == 1) { Console.ForegroundColor = ConsoleColor.Blue; } else if (Renk == 2) { Console.ForegroundColor = ConsoleColor.Red; } else if (Renk == 3) { Console.ForegroundColor = ConsoleColor.Green; } else if (Renk == 4) { Console.ForegroundColor = ConsoleColor.White; } else if (Renk == 5) { Console.ForegroundColor = ConsoleColor.Magenta; } else if (Renk == 6) { Console.ForegroundColor = ConsoleColor.Cyan; } else if (Renk == 7) { Console.ForegroundColor = ConsoleColor.Gray; } else if (Renk == 8) { Console.ForegroundColor = ConsoleColor.Yellow; } else { Console.ForegroundColor = ConsoleColor.Black; } Console.SetCursorPosition(Sütun,Satır ); Console.Write("*"); } } //Console.BackgroundColor = ConsoleColor.White; Console.Clear(); Örnek(); Console.ReadLine(); } }