Пример #1
0
        static void Main()
        {
            QuizEngine.GetQuestionsList();
            var cuky = new Trainer("Cuky");

            cuky.PopulateQuestionsList();
            while (cuky.HasMoreQuestions)
            {
                try
                {
                    var question = cuky.AskQuestion();
                    Console.Write(question);
                    var answerStr = Console.ReadLine();
                    Validator.ValidateStringIsIntParsable(answerStr);
                    var answer = int.Parse(answerStr);
                    Console.WriteLine(question.CheckAnswer(answer) ? "Correct" : "Wrong");
                    Console.WriteLine();
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Error: " + ex.Message);
                    Console.WriteLine();
                }
            }
        }
Пример #2
0
        static void Main(string[] args)
        {
            ConsolRenderer.SetConsoleProperties();

            ConsolRenderer.PrintLogo();

            player.Name     = ConsolRenderer.AskForUsername();
            player.Position = new Position(0, 0);

            ConsolRenderer.DrawPlayground(Size);

            ConsolRenderer.PlayerAbilities(player.Name);


            while (true)
            {
                player.Position = ConsolRenderer.PlayerMove(player.Position, Size);
                ConsolRenderer.PlayerAtPosition(player.Position);

                Console.SetCursorPosition(0, 21);
                if (player.Position.X == 0 && player.Position.Y == 1)
                {
                    QuizEngine.GetQuestionsList();
                    var cuky = new Trainer("Cuky");
                    cuky.PopulateQuestionsList();
                    while (cuky.HasMoreQuestions)
                    {
                        try
                        {
                            var question = cuky.AskQuestion();
                            Console.Write(question);
                            var answerStr = Console.ReadLine();
                            Validator.ValidateStringIsIntParsable(answerStr);
                            var answer = int.Parse(answerStr);
                            Console.WriteLine(question.CheckAnswer(answer) ? "Correct" : "Wrong");
                            Console.WriteLine();
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine("Error: " + ex.Message);
                            Console.WriteLine();
                        }
                    }
                }
            }


            //Test.TestPlaygroundGeneration();
            //Test.TestFighterEngine();
            //Test.TestBoxOpenengine();
            //Test.TestFriendMeetingEngine();

            //Test.TestDice();

            //Test.TestQuiz();
        }
Пример #3
0
        // Orlin's test from the old solution
        public static void TestQuiz()
        {
            QuizEngine.GetQuestionsList();

            var cuky = new Trainer("Cuky");

            cuky.PopulateQuestionsList();

            while (cuky.Questions.Count > 0)
            {
                var question = cuky.AskQuestion();
                Console.WriteLine(question);

                var answer = int.Parse(Console.ReadLine());
                question.CheckAnswer(answer);
            }
        }
Пример #4
0
		public TwitchBot ()
		{     
			mTcpConnection = new TcpConnection();
			mTcpConnection.DataReceived += ProccessMessageData;
            mTcpConnection.EmergencyDisc = EmergencyReset;
			mIrcCommandAnalyzer = new SimpleTwitchBotIrcCommandAnalyzer();

            host = (CustomHost)ApplicationHost.CreateApplicationHost(typeof(CustomHost), "/", Directory.GetParent(Directory.GetCurrentDirectory()).FullName);
            
            StartHttpListener();
            mQE = new QuizEngine();
            mQE.SendMessage = SendMessageToCurrentChannel;
            mQE.PropertyChanged += ProxyPassNotifyPropertyChanged;
            mQE.InternalInitiationQuizStop = StopQuiz;

            TwitchChannel = "NONE";
		}