Exemplo n.º 1
0
        private void run_Click(object sender, System.EventArgs e)
        {
            RefreshMission();

            string content = this.codeText.Text.ToUpper();
            string file    = FileReadWrite.WriteFile(content, mission.data.name);

            CallInterpreter(file, mission.data.inputs);

            int[] outputs = interpreter.TakeOutputs();
            debugOutputs = interpreter.TakeDebugOutputs();

            if (UiManager.debugForm != null)
            {
                UiManager.debugForm.GetDebugOutputs(debugOutputs);
            }

            viewer.GiveOutputs(outputs);

            bool success = true;

            for (int i = 0; i < outputs.Length; i++)
            {
                if (outputs.Length != solutions.Length)
                {
                    success = false;
                    break;
                }
                if (outputs[i] != solutions[i])
                {
                    success = false;
                    break;
                }
            }

            viewer.SetSuccess(success);

            viewer.Refresh();

            if (success)
            {
                MissionForm.SearchInEnabledMissions(mission.data.number.ToString());
                RefreshTitle();
            }
        }
Exemplo n.º 2
0
        private void save_Click(object sender, System.EventArgs e)
        {
            string content = this.codeText.Text.ToUpper();

            FileReadWrite.WriteFile(content, mission.data.name);
        }