//Определение победителя private void WhoWinner(int userChoice) { int compChoice = CompChoice(); int difCompUser = compChoice - userChoice; if ((difCompUser == -2) || (difCompUser == 1)) { //MessageBox.Show("Ты победил!"); lblInfoTable.Text = InfoTable(compChoice, userChoice); userCount++; } else if ((difCompUser == -1) || (difCompUser == 2)) { //MessageBox.Show("Победил компьютер!"); lblInfoTable.Text = InfoTable(compChoice, userChoice); compCount++; } else { //MessageBox.Show("Ничья!"); lblInfoTable.Text = InfoTable(compChoice, userChoice); } lblScore.Text = compCount.ToString() + " : " + userCount.ToString(); } //Камень - 1, Бумага - 0, Ножницы - 2 //Ничья: 0, 2, 4. БК: 1. НБ: 2. КН: 3. private string InfoTable(int comp, int user) { int sum = comp + user; if (comp == user) { return "Ничья!"; } else if (sum == 1) { return "Бумага оборачивает камень!"; } else if (sum == 3) { return "Камень ломает ножницы!"; } else { return "Ножницы режут бумагу!"; } }