-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.py
More file actions
35 lines (34 loc) · 1.27 KB
/
errors.py
File metadata and controls
35 lines (34 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from tkinter import *
class IllegalMove(Exception):
def __str__(self):
return("Невозможный ход")
class NoPiece(IllegalMove):
def __str__(self):
return("Выберите фигуру")
class WrongPlayer(IllegalMove):
def __str__(self):
return("Сейчас ход другого игрока")
class SelfCapture(IllegalMove):
def __str__(self):
return("Нельзя бить фигуры своего цвета")
class KingIllegalMove(IllegalMove):
def __str__(self):
return("Король так не ходит")
class QueenIllegalMove(IllegalMove):
def __str__(self):
return("Ферзь так не ходит")
class RookIllegalMove(IllegalMove):
def __str__(self):
return("Ладья так не ходит")
class BishopIllegalMove(IllegalMove):
def __str__(self):
return("Слон так не ходит")
class KnightIllegalMove(IllegalMove):
def __str__(self):
return("Конь так не ходит")
class PawnIllegalMove(IllegalMove):
def __str__(self):
return("Пешка так не ходит")
class IllegalCastling(IllegalMove):
def __str__(self):
return("Рокировка в эту сторону невозможна")