Advertisement
Blizzardo1

random uBoat xD

Jun 17th, 2013
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.20 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Text;
  5.  
  6. namespace URANDOM
  7. {
  8.     class Program
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             string[] allLines = File.ReadAllLines(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\random.l");
  13.             string nLine = string.Empty;
  14.             int MAX_LENGTH = 512;
  15.             byte tB;
  16.             StreamWriter writer = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\random.ll");
  17.  
  18.             for (int i = 0; i < MAX_LENGTH; i++)
  19.             {
  20.                 foreach (char c in allLines[i])
  21.                 {
  22.                     tB = (byte)c;
  23.  
  24.                     tB = (byte)((tB ^ 32) & 0xFF >> tB * 32);
  25.  
  26.                     nLine += ((char)tB);
  27.                 }
  28.                 Console.Write("Writing Line {0} of {1} instead of {2}", i + 1, MAX_LENGTH, allLines.Length);
  29.                 Console.SetCursorPosition(0, 0);
  30.                 System.Threading.Thread.Sleep(1);
  31.                 writer.WriteLine(nLine);
  32.                 writer.Flush();
  33.             }
  34.             Console.ReadKey(true);
  35.             writer.Close();
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement