class point(object):
def __init__(self, x,y):
self.x=x
self.y=y
class reward(point):
def __init__(self, x, y, name):
super(reward, self).__init__(x,y)
self.name=name
reward1 = reward(1,1,“Moeda de ouro”)
print(reward1.x)
print(reward1.name)
class robo:
def init(self,x,y):
self.y=y
self.x=x
def move_up(self,x,y):
if y < 10:
self.y= self.y+1
else:
print("comando proibido")
def move_down(self,x,y):
if y > 1:
self.y= self.y-1
else:
print("comando proibido")
def move_left(self,x,y):
if self.x > 1:
self.x= self.x - 1
else:
print("comando proibido")
def move_right(self,x,y):
if self.x < 10:
self.x= self.x + 1
else:
print("comando proibido"
robot1 = robo(5,5)