C# Help 5165

02/28/2010 20:01 xScott#1
After alot of trail an error, i still cant find a solution, and getting realy annoyed, LOL.

im using this:

Code:
           if (File.Exists(@"C:\OldCODB\Questions.txt"))
           {
               
               string[] Lines = File.ReadAllLines(@"C:\OldCODB\Questions.txt");
               List<string> Words = new List<string>();
               foreach (string line in Lines)
               {
                   foreach (string s in line.Split('\n'))
                       Words.Add(s);
               }
               string[] WordsArray = new string[Words.Count];
               Words.CopyTo(WordsArray);
               Random Rnd = new Random();
               int RandomLine = Rnd.Next(0,12);
               string LineToConvert = WordsArray[RandomLine];
               string[] ConvertedString =  LineToConvert.Split(' ');
               string Question = ConvertedString[0].Replace("~", " ");
               string Answer = ConvertedString[1];

           }
           else 
           {
               Console.WriteLine("Questions.txt doesnt exist.");
           }
I want to use the string variables "Question & Answer" So the NPC displays the random question and answer to compare it to the input, but i dont know how to implement it into the NPC.

if someone could help me with this id be realy grateful.
02/28/2010 21:04 PeTe Ninja#2
makes ur questions be put in a array or list or w.e but on a global array or list..
03/01/2010 00:07 xScott#3
I have no clue where :s
03/01/2010 01:51 PeTe Ninja#4
does the 5165 have liek


AllPlayers ?
03/01/2010 08:19 xScott#5
ermmm, thats what i dont know, it has, Character.cs but i dont know how to tell what one applies to all players. could it be World.cs? im not sure :/