예제 #1
0
    //Лице на трапец
    private void Trap()
    {
        instr.text = "Намерете лицето";
        Tra.SetActive(true);
        int a;
        int b;
        int hb;
        int S;
        int Sf;
        int St;

        do
        {
            a  = Random.Range(2, 10);
            b  = Random.Range(2, 10);
            hb = Random.Range(2, 10);
            S  = (a + b) * hb;
            St = S / 2;
            Sf = Random.Range(St - 10, St + 10);
        }while (St == Sf && Sf <= 0 && S % 2 != 0);

        quest.text = "b=" + b + "; \n" + "a=" + a + "; hb=" + hb;
        tr.text    = St.ToString();
        fal.text   = Sf.ToString();
    }
예제 #2
0
    //Умножение и деление
    private void UiD()
    {
        instr.text = "'*'-Умножение; \n '/'-Деление";
        int a = Random.Range(2, 10);
        int b = Random.Range(2, 10);
        int S = a * b;
        int Sf;

        do
        {
            Sf = Random.Range(S - 2, S + 2);
        }while (Sf == S);
        int bf;

        do
        {
            bf = Random.Range(b - 2, b + 2);
        }while (bf == b);
        int k = Random.Range(1, 3);

        switch (k)
        {
        case 1:
            quest.text = a + "*" + b;
            tr.text    = S.ToString();
            fal.text   = Sf.ToString();
            break;

        case 2:
            quest.text = S + "/" + a;
            tr.text    = b.ToString();
            fal.text   = bf.ToString();
            break;
        }
    }
예제 #3
0
    //Лице на триъгълник
    private void STriugulnik()
    {
        instr.text = "Намерете лицето. ";
        int a2;
        int a3;
        int a1;

        do
        {
            a3 = Random.Range(10, 20);
            a1 = Random.Range(10, 20);
        }while (a1 * a3 % 2 != 0);

        int k  = Random.Range(0, 2);
        int hc = Random.Range(10, 20);

        Tri.SetActive(true);
        int Sf;

        if (k == 0)
        {
            int St = a1 * a3 / 2;

            quest.text = "b =" + a1 + ";" + "a=" + a3 + "\n" + ";<ACB=90°;S=? ";
            do
            {
                Sf = Random.Range(St - 10, St + 10);
            }while (Sf == St && Sf <= 0);
            tr.text  = St.ToString();
            fal.text = Sf.ToString();
        }
        do
        {
            hc = Random.Range(10, 20);
            a2 = Random.Range(1, 20);
        }while (hc * a2 % 2 != 0);
        int St1 = a2 * hc / 2;

        do
        {
            Sf = Random.Range(St1 - 10, St1 + 10);
        }while (Sf == St1 && Sf <= 0);
        quest.text = "c =" + a2 + ";" + "hc=" + hc + "\n" + ";S=? ";
        tr.text    = St1.ToString();
        fal.text   = Sf.ToString();
    }
예제 #4
0
    //Лице на успоредник
    private void Usp()
    {
        instr.text = "Намерете лицето";
        Per.SetActive(true);
        int c  = Random.Range(20, 50);
        int hc = Random.Range(20, 50);
        int S  = c * hc;
        int Sf;

        do
        {
            Sf = Random.Range(S - 10, S + 10);
        }while (S == Sf);
        quest.text = "a=" + c + "; ha=" + hc;
        tr.text    = S.ToString();
        fal.text   = Sf.ToString();
    }
예제 #5
0
        /// <summary>
        /// Constructeur de la form ModifierArticle
        /// </summary>
        public ModifierArticle(FormMain Form, String PathToSave)
        {
            this.Form = Form;
            PathBdd   = PathToSave;

            InitializeComponent();

            Articles Ar = (Articles)Form.GetListView().SelectedItems[0].Tag;

            this.TextBoxDescription.Text = Ar.GetDescription();
            AncienNom = Ar.GetDescription();

            SousFamillesDAO     SousFamillesD    = new SousFamillesDAO(PathBdd);
            List <SousFamilles> SousFamillesList = SousFamillesD.GetAllSousFamilles();

            //implémentation des combobox
            String SF = Form.GetListView().SelectedItems[0].SubItems[3].Text;

            foreach (SousFamilles Sf in SousFamillesList)
            {
                ComboBoxSousFamille.Items.Add(Sf);
                if (SF.Equals(Sf.GetNom()))
                {
                    ComboBoxSousFamille.SelectedItem = ComboBoxSousFamille.Items[ComboBoxSousFamille.Items.IndexOf(Sf)];
                }
            }

            MarquesDAO     MarquesD    = new MarquesDAO(PathBdd);
            List <Marques> MarquesList = MarquesD.GetAllMarques();

            String M = Form.GetListView().SelectedItems[0].SubItems[4].Text;

            foreach (Marques Mar in MarquesList)
            {
                ComboBoxMarque.Items.Add(Mar);
                if (M.Equals(Mar.GetNom()))
                {
                    ComboBoxMarque.SelectedItem = ComboBoxMarque.Items[ComboBoxMarque.Items.IndexOf(Mar)];
                }
            }

            NumericUpDown.Value = Ar.GetQuantite();
        }