admin-dashboard-backend/groupTasks/libs/robots/rex.py

22 lines
542 B
Python

class Rex:
"""
This class represents a rex robot.
"""
def __init__(self, name):
self.name = name
self.x = 0
self.y = 0
self.z = 0
def move(self, x, y, z):
"""
Move the robot to a new position.
"""
self.x = x
self.y = y
self.z = z
print("Robot: " + self.name + " moved to (" + str(self.x) + ", " + str(self.y) + ")")
def __str__(self):
return "Robot: " + self.name + " (" + str(self.x) + ", " + str(self.y) + ")"