1. C# / Говнокод #23054

    −1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    if (this.btn1.Content.ToString() == this.currentSide.ToString() && this.btn2.Content.ToString() == this.currentSide.ToString() && this.btn3.Content.ToString() == this.currentSide.ToString())
    this.Victory();
    else if (this.btn4.Content.ToString() == this.currentSide.ToString() && this.btn5.Content.ToString() == this.currentSide.ToString() && this.btn6.Content.ToString() == this.currentSide.ToString())
    this.Victory();
    else if (this.btn7.Content.ToString() == this.currentSide.ToString() && this.btn8.Content.ToString() == this.currentSide.ToString() && this.btn9.Content.ToString() == this.currentSide.ToString())
    this.Victory();
    else if (this.btn1.Content.ToString() == this.currentSide.ToString() && this.btn4.Content.ToString() == this.currentSide.ToString() && this.btn7.Content.ToString() == this.currentSide.ToString())
    this.Victory();
    else if (this.btn2.Content.ToString() == this.currentSide.ToString() && this.btn5.Content.ToString() == this.currentSide.ToString() && this.btn8.Content.ToString() == this.currentSide.ToString())
    this.Victory();
    else if (this.btn3.Content.ToString() == this.currentSide.ToString() && this.btn6.Content.ToString() == this.currentSide.ToString() && this.btn9.Content.ToString() == this.currentSide.ToString())
    this.Victory();
    else if (this.btn1.Content.ToString() == this.currentSide.ToString() && this.btn5.Content.ToString() == this.currentSide.ToString() && this.btn9.Content.ToString() == this.currentSide.ToString())
    this.Victory();
    else if (this.btn3.Content.ToString() == this.currentSide.ToString() && this.btn5.Content.ToString() == this.currentSide.ToString() && this.btn7.Content.ToString() == this.currentSide.ToString())
    this.Victory();

    Проверка на победу в крестиках-ноликах.

    Запостил: fedor-analplay, 22 Мая 2017

    Комментарии (2) RSS

    Добавить комментарий