Skip to content

Instantly share code, notes, and snippets.

@AndreyeuIvan
Created December 14, 2019 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndreyeuIvan/4cc73979b6d08f44c6540e76980a33f7 to your computer and use it in GitHub Desktop.
Save AndreyeuIvan/4cc73979b6d08f44c6540e76980a33f7 to your computer and use it in GitHub Desktop.
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()
@AndreyeuIvan
Copy link
Author

Добавить класс полигон, разработать позицию.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment