using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MatrixEfekt
{
class Program
{
static void Main(string[] args)
{
Console.Title = "THE MATRIX EFFECT - TRCodeRooTeR";
Console.ForegroundColor = ConsoleColor.DarkGreen;
Console.WindowLeft = Console.WindowTop = 0;
Console.WindowHeight = Console.BufferHeight = Console.LargestWindowHeight;
Console.WindowWidth = Console.BufferWidth = Console.LargestWindowWidth;
Console.CursorVisible = false;
int gen, yuk;
int[] y;
int[] l;
Process(out gen, out yuk, out y, out l);
int ms;
while (true)
{
DateTime t1 = DateTime.Now;
Matrix(gen, yuk, y, l);
ms = 10 - (int)((TimeSpan)(DateTime.Now - t1)).TotalMilliseconds;
if (ms > 0)
System.Threading.Thread.Sleep(ms);
if (Console.KeyAvailable)
if (Console.ReadKey().Key == ConsoleKey.F5)
Process(out gen, out yuk, out y, out l);
}
}
static bool zaman = false;
private static void Matrix(int gen, int yuk, int[] y, int[] l)
{
int x;
zaman = !zaman;
for (x = 0; x < gen; ++x)
{
if (x % 11 == 10)
{
if (!zaman)
continue;
Console.ForegroundColor = ConsoleColor.White;
}
else
{
Console.ForegroundColor = ConsoleColor.DarkGreen;
Console.SetCursorPosition(x, inBoxY(y[x] - 2 - (l[x] / 40 * 2), yuk));
Console.Write(R);
Console.ForegroundColor = ConsoleColor.Green;
}
Console.SetCursorPosition(x, y[x]);
Console.Write(R);
y[x] = inBoxY(y[x] + 1, yuk);
Console.SetCursorPosition(x, inBoxY(y[x] - l[x], yuk));
Console.Write(' ');
}
}
private static void Process(out int gen, out int yuk, out int[] y, out int[] l)
{
int h1;
int h2 = (h1 = (yuk = Console.WindowHeight) / 2) / 2;
gen = Console.WindowWidth - 1;
y = new int[gen];
l = new int[gen];
int x;
Console.Clear();
for (x = 0; x < gen; ++x)
{
y[x] = r.Next(yuk);
l[x] = r.Next(h2 * ((x % 11 != 10) ? 2 : 1), h1 * ((x % 11 != 10) ? 2 : 1));
}
}
static Random r = new Random();
static char R
{
get
{
int t = r.Next(10);
if (t <= 2)
return (char)('t' + r.Next(10));
else if (t <= 4)
return (char)('R' + r.Next(27));
else if (t <= 6)
return (char)('1' + r.Next(27));
else
return (char)(r.Next(32, 255));
}
}
public static int inBoxY(int n, int height)
{
n = n % height;
if (n < 0)
return n + height;
else
return n;
}
}
}
C# ile çok fonksiyonlu hesap makinesi yapımı kodları....
TRCodeRooTeR 8443 1 2019-12-22 05:12:22C# ile yazılmış Bankamatik Otomasyonu program kodları...
TRCodeRooTeR 6990 1 2020-11-16 10:17:29