Advertisement
k1alo

Class.Chess

Feb 8th, 2024
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | None | 0 0
  1. import random
  2.  
  3.  
  4. class Figures:
  5.     materials = "wood"
  6.  
  7.     def __init__(self):
  8.         self.x = random.randint(1, 100)
  9.         self.y = random.randint(1,100)
  10.  
  11.     def move(self):
  12.         self.x += 1
  13.         self.y += 1
  14.  
  15.  
  16.  
  17. class Horse(Figures):
  18.     type = "horse"
  19.  
  20.     def __init__(self):
  21.         super().__init__()
  22.  
  23.     def move(self):
  24.         self.x += 1
  25.         self.y += 1
  26.  
  27. class Pawn(Figures):
  28.     type = "pawn"
  29.  
  30.     def __init__(self):
  31.         super().__init__()
  32.  
  33. class Rook(Figures):
  34.     type = "rook"
  35.  
  36.     def __init__(self):
  37.         super().__init__()
  38.  
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement