Advertisement
Guest User

Untitled

a guest
Oct 24th, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.82 KB | None | 0 0
  1. public List<string> options1 = new List<string>();
  2.         public struct question
  3.         {
  4.             public string text;
  5.             public List<string> options;
  6.         }
  7.         public List<question> questions;
  8. string line;
  9.             var reader = new System.IO.StreamReader("questions.txt");
  10.             question ques = new question();
  11.             while (reader.ReadLine()!=null)
  12.             {
  13.                 line = reader.ReadLine();
  14.                 if (line[0]!='+' && line[0]!='-')
  15.                 {
  16.                     ques.text = line;
  17.                    
  18.                 }
  19.                 else
  20.                 {
  21.                     ques.options.Add(line);
  22.                 }
  23.                 if (line=="@")
  24.                 {
  25.                     questions.Add(ques);
  26.                 }
  27.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement