Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void LoadSuggestedAnswer(string fileName)
- {
- try
- {
- string line;
- StreamReader iterationReader = new StreamReader("iterationsLearned.txt", Encoding.Default);
- int innerIteration = Convert.ToInt32(iterationReader.ReadLine());
- StreamReader theReader = new StreamReader(fileName, Encoding.Default);
- using (theReader)
- {
- do
- {
- line = theReader.ReadLine();
- if (line != "9")
- {
- for (int i = 0; i < line.Length; i++)
- {
- suggedtedAnswer[i] = Convert.ToInt32(line[i]);
- }
- }
- else if(line == "9")
- {
- innerIteration++;
- string pathIterations = "iterationsLearned.txt";
- File.WriteAllText(pathIterations, innerIteration.ToString());
- Debug.Log("ITERATION:" + innerIteration.ToString());
- }
- else
- {
- }
- }
- while (line != null);
- theReader.Close();
- }
- }
- catch (Exception e)
- {
- Debug.Log(e.Message);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement