Advertisement
Terrah

2darowunfucker

Sep 15th, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.34 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _2darowunfucker
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             if (args.Length < 1)
  14.             {
  15.                 Console.Out.WriteLine("OI GIVE ME A FILE!");
  16.                 Console.ReadKey();
  17.                 return;
  18.             }
  19.             else
  20.             {
  21.                 List<long> missing = new List<long>();
  22.  
  23.                 string file = args[0];
  24.                 try
  25.                 {
  26.                     long Row = -1;
  27.                     long Actual;
  28.                     string row;
  29.                     foreach (string line in System.IO.File.ReadAllLines(file))
  30.                     {
  31.                         if (Row == -1)
  32.                         {
  33.                             if (string.IsNullOrEmpty(line) || line[0]==' ' || line.ToLower().StartsWith("2da"))
  34.                             {
  35.                                 continue;
  36.                             }
  37.                             else if (char.IsNumber(line[0]))
  38.                             {
  39.                                 Row = 0;    
  40.                             }
  41.                         }
  42.  
  43.                         row = "";
  44.                         foreach (char c in line)
  45.                         {
  46.                             if (!char.IsNumber(c))
  47.                                 break;
  48.                             row += c;
  49.                         }
  50.  
  51.                         Actual = Convert.ToInt64(row);
  52.                         Console.Out.WriteLine(Actual);
  53.                         if (Actual != Row++)
  54.                         {
  55.                             Console.Clear();
  56.                             Console.Out.WriteLine("THIS ROW IS FUCKED: "+Actual);
  57.                             Console.ReadKey();
  58.                             return;
  59.                         }                      
  60.                     }                          
  61.                 }
  62.                 catch (Exception ex)
  63.                 {
  64.                     Console.Out.WriteLine("You fucked up: "+ex.GetType().Name+" "+ex.Message);
  65.                 }
  66.                 Console.Clear();
  67.                 Console.Out.WriteLine("NO ROWS SEEMS FUCKED!");
  68.                 Console.ReadKey();
  69.             }
  70.         }
  71.     }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement