Introduction: Make a Matrix Screen With Pseudo-Random Number Generator
I was having a look around the Instructables site, and saw some Matrix screen makers.
I like writing computer programs, and one time decided to make one of these, and I am going to show you how!
You must have the Microsoft .NET Framework 3.5 installed to do this.
Please rate, it is my first instructable, and I want to know how I go.
**UPDATE**
If you do not have the Microsoft.NET Framework 3.5, you can easily download it from the Microsoft Download site (download.microsoft.com), and search for .NET 3.5.
I have made a new version that spits out random characters, instead of just numbers.
It DOES NOT show a screenshot of the matrix, or show a 3D screen. Just random letters. In green.
Step 1: Coding
You need to download the code file attached, and save it in to your my documents folder. If you are interested in computer programming, this program might be interesting to look at. You need to copy all of the italic text, and save it to a file called Program.txt.
using System; namespace Matrix_V2 { class Program { static void Main(string[] args) {
//Sets the text color to green
Console.ForegroundColor = ConsoleColor.Green;
//Create a string with some random characters
string random_characters = "£¤¥¦§¨©ª«¬®¯±²³´µ¶·¸¹ºΣΤΦΩαβδεμπστφABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz<,>.?/:;\"\'{[}]\\|`~0123456790-_=+!@#$%^&*() ";
//Get all of those characters and turn them into an "array"
char[] random_characters_array = random_characters.ToCharArray();
//Clear the screen Console.Clear();
//Writes details about the application to the console screen
Console.Title = "Matrix V2 - Press Ctrl+C to exit";
Console.WriteLine("Matrix V2");
Console.WriteLine("Written by Chris Ward");
Console.WriteLine("https://www.instructables.com/member/7654321chris");
Console.Write("Press any key to continue");
Console.ReadKey();
//Creates a pseudo-random generator
Random r = new Random();
//Creates a statement that runs forever
while (true) {
//Gets the ASCII character from the array, based on what the number is
Console.Write(random_characters_array[r.Next(random_characters.Length)]);
//then runs the statement again... and again... etc.
} } } }
Attachments
Step 2: Creating Batch File.
@C:\WINDOWS\Microsoft.NET\Framework\v3.5 \csc.exe /noconfig /nowarn:1701,1702
/errorreport:prompt /warn:4 /define:TRACE /reference:"C:\WINDOWS\Microsoft.NET\Framework
\v2.0.50727\System.dll" /filealign:512 /optimize- /target:exe /out:Matrix.EXE Program.txt
Then you must save it as a .BAT file, in the same location as the program.txt file.
Step 3: Running
Troubleshooting
If the file isn't created, add on a new line @pause to the batch file, then try running it again, then if there is detail on an error, post a comment and I will try to fix the problem. Any other problems? Just post a comment.
Step 4: Troubleshooting
* This is actually my fault, I made a mistake on the batch file. I will update the code on it, but to change it, there is a little space, just after the ...work\v3.5 and before the \csc.exe. Just remove that space and run again. Alternatively you could download the code again.
Any other problems? Post a message and I will get back to u asap.