Anti-armenia.ORG - Forumlar - c# Matrix - Kod + Şəkil



Istifadəçi
    2014-01-25 21:06 GMT                 

By_Hummet



Banned
Mesaj Sayı : 527
Mövzu Sayı :
Rep Ver : 
Rep Sayı :   34  
Indi Saytda : Durum
Cinsiyyət : Oğlan
Şəhər :
Ölkə :
Məslək :
Yaş : 30
Mesaj :

Mövzunu Paylaş!


http://s003.radikal.ru/i204/1401/ff/f56422c06047.png

+ + + Kodlari Yapiştirin Və F5 Basin + + +

http://i021.radikal.ru/1401/da/d28cd8f573fd.png

+ + + Num -1-2-3-4 Və.s

http://i056.radikal.ru/1401/46/753ca8431adf.png

Kod:
#define readkey

using System;

namespace m7tr1x
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.Title = "By_Hummet M4TR1X ANTİ-armenia.ORG";
            Console.ForegroundColor = ConsoleColor.DarkGreen;
            Console.WindowLeft = Console.WindowTop = 0;
            Console.WindowHeight = Console.BufferHeight = Console.LargestWindowHeight;
            Console.WindowWidth = Console.BufferWidth = Console.LargestWindowWidth;

#if readkey
            Console.WriteLine("Aktiv Etmək Üçün Num 1 Basin .. !");
            Console.ReadKey();
#endif

            Console.CursorVisible = false;
            int width, height;
            int[] y;
            int[] l;
            Initialize(out width, out height, out y, out l);
            int ms;

            while (true)
            {
                DateTime t1 = DateTime.Now;
                MatrixStep(width, height, 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)
                        Initialize(out width, out height, out y, out l);
            }
        }

        static bool thistime = false;

        private static void MatrixStep(int width, int height, int[] y, int[] l)
        {
            int x;
            thistime = !thistime;

            for (x = 0; x < width; ++x)
            {
                if (x % 11 == 10)
                {
                    if (!thistime)
                        continue;

                    Console.ForegroundColor = ConsoleColor.White;
                }
                else
                {
                    Console.ForegroundColor = ConsoleColor.DarkGreen;
                    Console.SetCursorPosition(x, inBoxY(y[x] - 2 - (l[x] / 40 * 2), height));
                    Console.Write(R);
                    Console.ForegroundColor = ConsoleColor.Green;
                }
                Console.SetCursorPosition(x, y[x]);
                Console.Write(R);
                y[x] = inBoxY(y[x] + 1, height);
                Console.SetCursorPosition(x, inBoxY(y[x] - l[x], height));
                Console.Write(' ');
            }
        }

        private static void Initialize(out int width, out int height, out int[] y, out int[] l)
        {
            int h1;
            int h2 = (h1 = (height = Console.WindowHeight) / 2) / 2;
            width = Console.WindowWidth - 1;
            y = new int[width];
            l = new int[width];
            int x;
            Console.Clear();
            for (x = 0; x < width; ++x)
            {
                y[x] = r.Next(height);
                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)('A' + r.Next(10));
                else if (t <= 4)
                    return (char)('A' + r.Next(27));
                else if (t <= 6)
                    return (char)('A' + 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;
        }
    }
}
code]

Anti-armenia.ORG
    

Istifadəçi
    2014-01-26 21:09 GMT                 

glorfindel



İstifadəçi
Mesaj Sayı : 17
Mövzu Sayı :
Rep Ver : 
Rep Sayı :   0  
Indi Saytda : Durum
Cinsiyyət : Oğlan
Şəhər :
Ölkə :
Məslək :
Yaş :
Mesaj :

Mövzunu Paylaş!


Teşekkürler muhteşem paylaşım ++rep

Anti-armenia.ORG
    

Istifadəçi
    2014-01-26 21:32 GMT                 

M4NY3T!K



Gold
Mesaj Sayı : 606
Mövzu Sayı :
Rep Ver : 
Rep Sayı :   7  
Indi Saytda : Durum
Cinsiyyət : Oğlan
Şəhər : Naxçıvan
Ölkə :
Məslək :
Yaş :
Mesaj :

Mövzunu Paylaş!


Təşəkkür + Mənimdə VB - İlə Məşğul Olduğum Vaxtlar Olubdu

http://s017.radikal.ru/i404/1202/c6/a2947080a3c4.png
Anti-armenia.ORG
    

Istifadəçi
    2014-01-26 22:36 GMT                 

By_Hummet



Banned
Mesaj Sayı : 527
Mövzu Sayı :
Rep Ver : 
Rep Sayı :   34  
Indi Saytda : Durum
Cinsiyyət : Oğlan
Şəhər :
Ölkə :
Məslək :
Yaş : 30
Mesaj :

Mövzunu Paylaş!


Təşəkkürlər .. Hər Birinizə...

Anti-armenia.ORG