コード例 #1
0
        public static int Arity(Multioperation3 op)
        {
            switch (op._val.Length)
            {
            case 3:
                return(1);

            case 9:
                return(2);

            case 27:
                return(3);

            default:
                return(0);
            }
        }
コード例 #2
0
ファイル: SIoP.cs プロジェクト: multiop3308/multiop
        public void button1_Click(object sender, EventArgs e)
        {
            // List<Multioperation3> listg = null;
            //  List<Multioperation3> listf = null;
            Multioperation3 mop1 = new Multioperation3(textBox1.Text);
            Multioperation3 mop2 = new Multioperation3(textBox3.Text);

            if (Regex.IsMatch(textBox1.Text, "[^0-7 ]"))
            {
                textBox2.Text = "Ошибка! Компоненты мультиоперации должны быть [0-7]";
                return;
            }
            if (Regex.IsMatch(textBox3.Text, "[^0-7 ]"))
            {
                textBox2.Text = "Ошибка! Компоненты мультиоперации должны быть [0-7]";
                return;
            }
            if (mop1 < mop2)
            {
                textBox2.Text = "Мультиоперации перестановочны";
            }
            else
            {
                textBox2.Text = "Мультиоперации не перестановочны";
            }

            /* listf = Multioperation3Utils.ReadSetFromBox(s1);
             * listg = Multioperation3Utils.ReadSetFromBox(s2);
             * foreach (Multioperation3 f in listf)
             * {
             *   foreach (Multioperation3 g in listg)
             *   {
             *       textBox2.Text = textBox2.Text + "Мультиоперации  " + f + " и " + g + " ";
             *       if (f < g)
             *       {
             *           textBox2.Text = textBox2.Text + "  перестановочны ";
             *       }
             *       else
             *       {
             *           textBox2.Text = textBox2.Text + "  не перестановочны  ";
             *       };
             *       textBox2.Text = textBox2.Text + "  \n \r";
             *   }
             * }; */
        }