Support Forums
[C#] How to be a leet haxr [Makes a weird image?] - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19)
+---- Thread: [C#] How to be a leet haxr [Makes a weird image?] (/showthread.php?tid=11678)



[C#] How to be a leet haxr [Makes a weird image?] - Mike - 08-31-2010

Has to be a console application.

Imports:
Code:
using System.Threading;

Code:
Code:
static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Green;
            while (1 != 2) // Obviously 1 doesn't equal 2. Bad Loop.
            {
                Random integer = new Random();
                Console.Write(Convert.ToString(integer.Next(0, 2)));
                Thread.Sleep(8); // Otherwise it repeats itself. Plus slow typing = cool 8-)
            }
        }

Usage: Just replace the Main void with the code above.

P.S. It sometimes makes funky images.


RE: [C#] How to be a leet haxr [Makes a weird image?] - wchar_t - 09-02-2010

thanks.


this is random, and cool Big Grin


RE: [C#] How to be a leet haxr [Makes a weird image?] - xHtmlPhP - 09-02-2010

That's pretty cool except I'd suggest creating a new thread for the loop, you've put the sleep in the main thread which will freeze the program and not the loop.


RE: [C#] How to be a leet haxr [Makes a weird image?] - Mike - 09-03-2010

(09-02-2010, 08:00 PM)xHtmlPhP Wrote: That's pretty cool except I'd suggest creating a new thread for the loop, you've put the sleep in the main thread which will freeze the program and not the loop.

Threading is pointless when you're not doing anything productive. It will not freeze the program because it's a console application, if you don't stop the thread at time it'll keep going on as "0000000000000" instead of added 1's.