This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
/*http://alexanderrasch.blogspot.se/ */ | |
static void Main(string[] args) | |
{ | |
bool bRun = true; | |
Console.Title = "Dem0 By Alexander Rasch"; | |
Console.ForegroundColor = ConsoleColor.Green; | |
Console.WriteLine("Wake up... Follow the White Rabbit"); | |
//Sleep 512 ms | |
System.Threading.Thread.Sleep(512); | |
while (bRun == true) | |
{ | |
int iRand = 1; | |
for (int i = 0; i < 14; i++) | |
{ | |
Console.WriteLine(GetRandomString(iRand)); | |
iRand++; | |
System.Threading.Thread.Sleep(5 * iRand); | |
Console.Clear(); | |
} | |
//Check | |
if (iRand > 14) | |
{ | |
bRun = false; | |
Console.WriteLine("AlexanderRasch".ToUpper()); | |
} | |
} | |
//End | |
Console.ReadLine(); | |
} | |
//Need to "get" a random char | |
public static readonly Random _rRandom = new Random(); | |
public static string GetRandomString(int iLength) | |
{ | |
//Very bad when people use ""; String.Empty is the way to go. | |
string szOut = string.Empty; | |
//Make it look more "real" only having char used in message | |
//CharArray, it's single char | |
char[] arr_cChars = "ACDENRST".ToCharArray(); | |
//While lenght off message lower then iLenght run one more time | |
while (szOut.Length < iLength) | |
{ | |
//Add 1 char from chararray to szOut | |
szOut += arr_cChars[_rRandom.Next(0, arr_cChars.Length)]; | |
} | |
//Give out szOut | |
return szOut; | |
} | |
} | |
} |
Inga kommentarer:
Skicka en kommentar