Created
December 14, 2019 09:33
-
-
Save AndreyeuIvan/4cc73979b6d08f44c6540e76980a33f7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
class Fig(object): | |
position = [] | |
def __init__(self): | |
self.cur_position = ('a', 1) | |
def get_position(self): | |
return random.choice(self.position) | |
def move(self): | |
print(self.cur_position) | |
self.cur_position = self.get_position() | |
print(self.cur_position) | |
class Pond(Fig): | |
def __init__(self): | |
super().__init__() | |
self.position = [('a', 3), ('a', 4)] | |
class Elefant(Fig): | |
def __init__(self): | |
super().__init__() | |
self.position = [('b', 2), ('c', 3), ('d', 4)] | |
class Poligon(object): | |
pass | |
P = Elefant() | |
P.move() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Добавить класс полигон, разработать позицию.