private void BtnNext_Click(object sender, EventArgs e) { string result = matrixTextBox1.Text + "," + matrixTextBox2.Text + "," + matrixTextBox3.Text + "," + matrixTextBox4.Text + "," + matrixTextBox5.Text + "," + matrixTextBox6.Text + "," + matrixTextBox7.Text + "," + matrixTextBox8.Text + "," + matrixTextBox9.Text + "," + matrixTextBox10.Text + "," + matrixTextBox11.Text + "," + matrixTextBox12.Text + "," + matrixTextBox13.Text + "," + matrixTextBox14.Text + "," + matrixTextBox15.Text + "," + matrixTextBox16.Text + "," + matrixTextBox17.Text + "," + matrixTextBox18.Text + "," + matrixTextBox19.Text + "," + matrixTextBox20.Text + "," + matrixTextBox21.Text + "," + matrixTextBox22.Text + "," + matrixTextBox23.Text + "," + matrixTextBox24.Text + "," + matrixTextBox25.Text; if (_isTest) { countPassedQuestion++; if (result == correctAnswer) { countCorrectAnswer++; } if (maxCount > countPassedQuestion) { FormElaesaTest5 form = new FormElaesaTest5(true); form.Show(); this.Close(); } else { int mark = countCorrectAnswer * 5 / countPassedQuestion; ResultForm form = new ResultForm(mark, Text, countCorrectAnswer, countPassedQuestion); form.Show(); countPassedQuestion = 4; countCorrectAnswer = 0; this.Close(); } } else { FormElaesaTest5 form = new FormElaesaTest5(false); form.Show(); this.Close(); } }
private void button2_Click_1(object sender, EventArgs e) { FormElaesaTest5 fm1 = new FormElaesaTest5(); fm1.Show(); this.Close(); }
private void BtnNext_Click(object sender, EventArgs e) { string result = textBox1.Text + "," + textBox2.Text + "," + textBox3.Text + "," + textBox4.Text + "," + textBox5.Text + "," + textBox6.Text + "," + textBox7.Text + "," + textBox8.Text + "," + textBox9.Text + "," + textBox10.Text; if (_isTest) { countPassedQuestion++; if (result == correctAnswer) { countCorrectAnswer++; } if (maxCount > countPassedQuestion) { FormElaesaTest1 form = new FormElaesaTest1(true); form.Show(); this.Close(); } else { FormElaesaTest5 form = new FormElaesaTest5(true, countCorrectAnswer); form.Show(); countPassedQuestion = 0; countCorrectAnswer = 0; this.Close(); } } else { FormElaesaTest1 form = new FormElaesaTest1(false); form.Show(); this.Close(); } }
private void OpenForm(string formName, bool isTest, bool codec = true) { if (formName.Equals("Код Элайеса")) { if (codec) { SystematicCode.ElaesaCode.FormElaesaTest1 form = new SystematicCode.ElaesaCode.FormElaesaTest1(isTest); form.Show(); } else { SystematicCode.ElaesaCode.FormElaesaTest5 form = new SystematicCode.ElaesaCode.FormElaesaTest5(isTest); form.Show(); } } else if (formName.Equals("Код Варшамова")) { if (codec) { SystematicCode.VarshamovaCode.FormVarshamovaTest1 form = new SystematicCode.VarshamovaCode.FormVarshamovaTest1(isTest); form.Show(); } else { SystematicCode.VarshamovaCode.FormVarshamovaTest2 form = new SystematicCode.VarshamovaCode.FormVarshamovaTest2(isTest); form.Show(); } } else if (formName.Equals("Коды Рида-Милеера")) { if (codec) { SystematicCode.Rida_MilleraCode.FormRida_MilleraTest1 form = new SystematicCode.Rida_MilleraCode.FormRida_MilleraTest1(isTest); form.Show(); } else { SystematicCode.Rida_MilleraCode.FormRida_MilleraTest2 form = new SystematicCode.Rida_MilleraCode.FormRida_MilleraTest2(isTest); form.Show(); } } else if (formName.Equals("Код Хеминга 1")) { SystematicCode.HemingaCode.FormHemingaTest1 form = new SystematicCode.HemingaCode.FormHemingaTest1(isTest, codec); form.Show(); } // cyclic codes else if (formName.Equals("Коды Абрамсона")) { CyclicCode.AbramsonaCode.FormAbramsTest1 form = new CyclicCode.AbramsonaCode.FormAbramsTest1(isTest, codec); form.Show(); } else if (formName.Equals("Коды Файра")) { FormFairaTest1 form = new FormFairaTest1(isTest, codec); form.Show(); } else if (formName.Equals("Код Хеминга 2")) { CyclicCode.HemingaCode.FormHemingaTest1 form = new CyclicCode.HemingaCode.FormHemingaTest1(isTest, codec); form.Show(); } else if (formName.Equals("Код БЧХ")) { CyclicCode.BChHCode.FormBChHTest1 form = new CyclicCode.BChHCode.FormBChHTest1(isTest, codec); form.Show(); } //non binary codes else if (formName.Equals("Первичные недвоичные коды")) { if (codec) { Non_binaryCode.PrimaryNon_binaryCode.FormPrimaryNon_binaryTest1 form = new Non_binaryCode.PrimaryNon_binaryCode.FormPrimaryNon_binaryTest1(isTest); form.Show(); } else { Non_binaryCode.PrimaryNon_binaryCode.FormPrimaryNon_binaryTest2 form = new Non_binaryCode.PrimaryNon_binaryCode.FormPrimaryNon_binaryTest2(isTest); form.Show(); } } else if (formName.Equals("Код с проверкой по модулю q")) { if (codec) { Non_binaryCode.CodeWithModuleTest.FormModuleTest1 form = new Non_binaryCode.CodeWithModuleTest.FormModuleTest1(isTest); form.Show(); } else { Non_binaryCode.CodeWithModuleTest.FormModuleTest6 form = new Non_binaryCode.CodeWithModuleTest.FormModuleTest6(isTest); form.Show(); } } else if (formName.Equals("Код с простым повторением")) { Non_binaryCode.CodeWithaSimpleIteration.FormIterationTest1 form = new Non_binaryCode.CodeWithaSimpleIteration.FormIterationTest1(isTest, codec); form.Show(); } else if (formName.Equals("Итеративный код")) { if (codec) { Non_binaryCode.IterativityCode.FormIterativityTest1 form = new Non_binaryCode.IterativityCode.FormIterativityTest1(isTest); form.Show(); } else { Non_binaryCode.IterativityCode.FormIterativityTest5 form = new Non_binaryCode.IterativityCode.FormIterativityTest5(isTest); form.Show(); } } //other codes else if (formName.Equals("Код Грея")) { ElseCodeAndLabs.GrayCode.FormGrayTest1 form = new ElseCodeAndLabs.GrayCode.FormGrayTest1(isTest, codec); form.Show(); } else if (formName.Equals("Двоично-десятичный код")) { FormDDCTest1 form = new FormDDCTest1(isTest, codec); form.Show(); } else if (formName.Equals("Код Бергера")) { ElseCodeAndLabs.BergerCode.FormBergerTest1 form = new ElseCodeAndLabs.BergerCode.FormBergerTest1(isTest, codec); form.Show(); } else if (formName.Equals("Код Шенона-Фано")) { ElseCodeAndLabs.Shenona_FanoCode.FormShenona_FanoTest1 form = new ElseCodeAndLabs.Shenona_FanoCode.FormShenona_FanoTest1(isTest); form.Show(); } else if (formName.Equals("Код Хаффмена")) { if (codec) { ElseCodeAndLabs.HaffmenaCode.FormHaffmenaTest1 form = new ElseCodeAndLabs.HaffmenaCode.FormHaffmenaTest1(isTest); form.Show(); } else { ElseCodeAndLabs.HaffmenaCode.FormHaffmenaTest2 form = new ElseCodeAndLabs.HaffmenaCode.FormHaffmenaTest2(isTest); form.Show(); } } else if (formName.Equals("Коды-спутники")) { if (codec) { ElseCodeAndLabs.SateliteCode.FormSateliteTest1 form = new ElseCodeAndLabs.SateliteCode.FormSateliteTest1(isTest); form.Show(); } else { ElseCodeAndLabs.SateliteCode.FormSateliteTest4 form = new ElseCodeAndLabs.SateliteCode.FormSateliteTest4(isTest); form.Show(); } } else if (formName.Equals("Количество информации и энтропия")) { ElseCodeAndLabs.Entropy.FormEntropyTest1 form = new ElseCodeAndLabs.Entropy.FormEntropyTest1(); form.Show(); } else if (formName.Equals("Рекурентный код")) { if (codec) { ElseCodeAndLabs.RekyrentCode.FormRekyrentTest1 form = new ElseCodeAndLabs.RekyrentCode.FormRekyrentTest1(isTest); form.Show(); } else { ElseCodeAndLabs.RekyrentCode.FormRekyrentTest4 form = new ElseCodeAndLabs.RekyrentCode.FormRekyrentTest4(isTest); form.Show(); } } else if (formName.Equals("Канальные коды")) { } }