Exemplo n.º 1
0
 protected void go()
 {//when btnGo is button is clicked
     RtfOutput.Clear();
     RtfOutputLineNumbers.Clear();
     if (btnGo.Text == "Go!")
     {
         errorChecker = new Logic.ErrorChecker(rtfInput.Text, bot, this);
         if (!errorChecker.HasError)
         {
             _showLineNo = true;
             btnGo.Text  = "Reset";
             displayAsLog();
             interpreter = new Logic.Interpreter(rtfInput.Text, bot, this);
             bot.CheckForExit();
             _attemptNo++;
             if (_attemptNo > 2)
             {
                 lblHint.Visible = true;
             }
         }
         else
         {
             _showLineNo = false;
             displayAsError();
         }
     }
     else
     {
         btnGo.Text = "Go!";
         CallOnLoad();
     }
 }
Exemplo n.º 2
0
 //methods below
 virtual protected void CallOnLoad()
 {// called when the form is loaded or reset button is pressed
  //bot.SetPosition is set in the child form
     RtfOutput.Clear();
     RtfOutputLineNumbers.Clear();
     DisplayBotLocation();
     Walls.Clear();
     displayAsLog();
     _showLineNo = false;
 }