Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- namespace ArtificialIntelligenceCW
- {
- class Program
- {
- static void Main(string[] args)
- {
- char[] seperator = { ',' };
- string[] cavArray;
- int size;
- int coordsLength;
- ArrayList coordsList = new ArrayList();
- // Reading the Cavern Files into a String
- string cav = System.IO.File.ReadAllText(@"C:\Caverns\input1.cav");
- // Splitting cav file into array
- cavArray = cav.Split(seperator, StringSplitOptions.RemoveEmptyEntries);
- 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;
- // Getting the Array of Coords
- for (int i = 0; i <= coordsLength; i++)
- {
- coordsList.Add(cavList[i]);
- cavList.Remove(i);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement