- Moderatör
- #1
Admin
C# kullanarak Console'dan nasıl Matrix yapılacağını göstericem.
İlk olarak bir Console Projesi oluşturun.
Ardından Şu kodları direk olarak yapıştırın ;
C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
Ardından alt tarafta vereceğim kodu yeşil yazılı yere yapıştırın.
Matrix Kod :
C#:
Console.ForegroundColor = ConsoleColor.Green;
Random RDN = new Random();
int sayı;
int art = 0;
for (int i = 0; ; i++)
{
sayı = RDN.Next(0, 10);
Console.Write(sayı);
Thread.Sleep(20);
art++;
Console.ForegroundColor = ConsoleColor.Green;
if (art == 10)
{
Console.ForegroundColor = ConsoleColor.White;
art = 0;
}
Console.Write(new string('\t', sayı));
}
Console.ReadKey();
Kodların Hepsi ;
C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace Matrix
{
class Program
{
static **** Main(string[] args)
{
Console.ForegroundColor = ConsoleColor.Green;
Random RDN = new Random();
int sayı;
int art = 0;
for (int i = 0; ; i++)
{
sayı = RDN.Next(0, 10);
Console.Write(sayı);
Thread.Sleep(20);
art++;
Console.ForegroundColor = ConsoleColor.Green;
if (art == 10)
{
Console.ForegroundColor = ConsoleColor.White;
art = 0;
}
Console.Write(new string('\t', sayı));
}
Console.ReadKey();
}
}
}