EG Information

Main Index
EG Manual
Disclaimer
Legal Information
Hall of Fame
Hall of Shame
Member Rankings
Members List
Meet the Staff
Hacker's Home Page
IRC Flash Chat

Training Missions

Read Me First
Basic Skills
Realistic Scenarios
Cryptography
Software Cracking
Linux ELF Binary Cracking
Logical Thinking
Programming
Captcha Cracking
Patching
Steganography
Deface This Wall
/dev/null
/dev/urandom
/dev/extra

Knowledge Bank

Discussion Forums
Exploit Database New
PasteBin New
RSS Feeds RSS
Articles / Tutorials
Videos
Online EG MP3 Player Radio
Downloads
Tools

Code Resources

Submit Code
Ajax
ASM
Bash
C
CPP
Csharp
Delphi
Haskell
Java
Javascript
Jython
Lisp
mIRC
MySQL
Perl
PHP
Python
QBASIC
VisualBasic

Pimp Us Out!

Review enigmagroup.org on alexa.com

Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.

Enigma Group

Enigma Group

Enigma Group

Enigma Group
 

Enigma Group's Code Bank


Matrix Effect

By: evisceration  -  Date Submitted: 2012-04-11 15:03:10

  1. #define readkey
  2.  
  3. using System;
  4.  
  5. namespace m7tr1x
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. Console.Title = "Matrix Effect!";
  12. Console.ForegroundColor = ConsoleColor.DarkGreen;
  13. Console.WindowLeft = Console.WindowTop = 0;
  14. Console.WindowHeight = Console.BufferHeight = Console.LargestWindowHeight;
  15. Console.WindowWidth = Console.BufferWidth = Console.LargestWindowWidth;
  16. #if readkey
  17. Console.WriteLine("Press any key to begin!");
  18. Console.ReadKey();
  19. #endif
  20. Console.CursorVisible = false;
  21. int width, height;
  22. int[] y;
  23. int[] l;
  24. Initialize(out width, out height, out y, out l);
  25. int ms;
  26. while (true)
  27. {
  28. DateTime t1 = DateTime.Now;
  29. MatrixStep(width, height, y, l);
  30. ms = 10 - (int)((TimeSpan)(DateTime.Now - t1)).TotalMilliseconds;
  31. if (ms > 0)
  32. System.Threading.Thread.Sleep(ms);
  33. if (Console.KeyAvailable)
  34. if (Console.ReadKey().Key == ConsoleKey.F5)
  35. Initialize(out width, out height, out y, out l);
  36. }
  37. }
  38.  
  39. static bool thistime = false;
  40.  
  41. private static void MatrixStep(int width, int height, int[] y, int[] l)
  42. {
  43. int x;
  44. thistime = !thistime;
  45. for (x = 0; x < width; ++x)
  46. {
  47. if (x % 11 == 10)
  48. {
  49. if (!thistime)
  50. continue;
  51. Console.ForegroundColor = ConsoleColor.White;
  52. }
  53. else
  54. {
  55. Console.ForegroundColor = ConsoleColor.DarkGreen;
  56. Console.SetCursorPosition(x, inBoxY(y[x] - 2 - (l[x] / 40 * 2), height));
  57. Console.Write(R);
  58. Console.ForegroundColor = ConsoleColor.Green;
  59. }
  60. Console.SetCursorPosition(x, y[x]);
  61. Console.Write(R);
  62. y[x] = inBoxY(y[x] + 1, height);
  63. Console.SetCursorPosition(x, inBoxY(y[x] - l[x], height));
  64. Console.Write(' ');
  65. }
  66. }
  67.  
  68. private static void Initialize(out int width, out int height, out int[] y, out int[] l)
  69. {
  70. int h1;
  71. int h2 = (h1 = (height = Console.WindowHeight) / 2) / 2;
  72. width = Console.WindowWidth - 1;
  73. y = new int[width];
  74. l = new int[width];
  75. int x;
  76. Console.Clear();
  77. for (x = 0; x < width; ++x)
  78. {
  79. y[x] = r.Next(height);
  80. l[x] = r.Next(h2 * ((x % 11 != 10) ? 2 : 1), h1 * ((x % 11 != 10) ? 2 : 1));
  81. }
  82. }
  83.  
  84. static Random r = new Random();
  85. static char R
  86. {
  87. get
  88. {
  89. int t = r.Next(10);
  90. if (t <= 2)
  91. return (char)('0' + r.Next(10));
  92. else if (t <= 4)
  93. return (char)('a' + r.Next(27));
  94. else if (t <= 6)
  95. return (char)('A' + r.Next(27));
  96. else
  97. return (char)(r.Next(32, 255));
  98. }
  99. }
  100.  
  101. public static int inBoxY(int n, int height)
  102. {
  103. n = n % height;
  104. if (n < 0)
  105. return n + height;
  106. else
  107. return n;
  108. }
  109. }
  110. }
Return to csharp category list

Who Visited EnigmaGroup Today?

1547 Guests, 156 Users (194 Spiders)
cls777, zediwon, tamari, zombiehack640, seichi, Red, proman, intersys, eusouumpeixe, rayomand, Spider web, yashganesh, Gh000st, GothicLogic, jax440, itsukiminami2, Doraga, dark_void, potato18, emeil, Nightraven, Laserman34170, revlis, theninjayistic, bhushanpatil12, milindsalvlve, tulu, sasuke, xthomd, Freshchris, rajivkelkar, bharatkumar, Priti Singh, maxsate, lolliver, anishthakur, ldg1992, jarlskov, LakhanRathi, edwin092, the mentor, panda_hacker, lithium_love, lirongbin123, Sooham, Abhinav2107, nerd, kurt_culley, vipro, ehkrin, ecokeco, wolfy1379, anandbhala, Kelionj, JaRam, HAcker2000, tdinsmoretuli, Anonymousfigure, ghost walker, SCBbestof, aelarbee, jp367, voldonp, mb4263, Arsenal, untchable, N4g4c3N, xsiemich, KIKNWING, negasora, LePhantom, TLH, Synthethic, ropopopo, LegitGlitcha, Tjm, 13thd4y, darthsmoot, huayra, KidNinja, kernel_mod, be3le3, Renack, Partisan, Javar2698, ktsukino, galuhiman, st3alth, kr1shn4murt1, VivisClone, brooks, Anonanonamous, WarSnail, InternetGuy123, Ausome1, killr00t, fulle294, Evil1, cobra, Vreality2007, cyberjin, cannonhead2, Slìmàgø, Repuhlsive, LWPiNDaHiZZY, akhil, DBD Darkened, l8nit3tr0ubl3, MaxMeier, Vidrion, d3krepit, Newd, NewdCouchGuy, fatal, 3v1l, cor3dump, ADV0CAT3, hackaday, Bahamut, Robbie, AlexDxel, Baboo123456, echo_steps, Arrow of time, Jos18, supermoore1025, apackofgiraffes, neverquit, Synick, tyzer200946, sweetkool1987, c0re, statix, raybendegun, mittal_palash, marco1548, r00t3r, nSoul, FalconHibiki, Annumbo, nh_99, itfact, NITINKNSL1, makler2004, JPMMaia, Megji, sernaval, Dcrypt3d, Hypertext, machile, Pelthrund, xxy143, sprx, HoerWing, wolfboy97, Tow
 
Enigma Group