Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- namespace ArtiIntelCW
- {
- class Program
- {
- static void Main(string[] args)
- {
- char[] seperator = { ',' };
- string[] cavArray;
- // The amount of caves in the file
- int size;
- int coordsLength;
- int connectivitySize;
- // List of Coordinates
- ArrayList coordsList = new ArrayList();
- // Reading the Cavern Files into a String
- string cav = System.IO.File.ReadAllText(@"H:\Caverns\generated100-1.cav");
- if (cav != null)
- {
- Console.WriteLine("File Loaded.");
- }
- else
- {
- Console.WriteLine("File Failed to Load");
- }
- // Splitting cav file into array
- cavArray = cav.Split(seperator, StringSplitOptions.RemoveEmptyEntries);
- // List of remaining data in the file
- ArrayList cavList = new ArrayList(cavArray);
- // Finding the amount of caves in the file
- size = Convert.ToInt32(cavList[0]);
- // Removing the first entry of the cavlist
- cavList.RemoveAt(0);
- // Finding the coords in the cav file
- coordsLength = size * 2 - 1;
- connectivitySize = size * size;
- // Getting the Array of Coords and removing unecessary text from cavList
- for (int i = 0; i <= coordsLength; i++)
- {
- coordsList.Add(cavList[i]);
- Console.WriteLine("Added: " + cavList[i] + " to list of coords");
- Console.WriteLine("Removed: " + cavList[i] + ". from cav list.");
- cavList.RemoveAt(0);
- }
- string value = string.Join(",", cavList.ToArray());
- Console.WriteLine(value);
- for (int i = 0; i <= size; i++)
- {
- for (int x = 0; x <= size; x++)
- {
- }
- }
- Console.WriteLine("There are: " + size + " caves in this file.");
- Console.WriteLine("Calculating fastest route.");
- // Finding the end of the cav file.
- int connectorSize = size * size;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement