From 3bfdab784b6f182796366625c021a2cec0452245 Mon Sep 17 00:00:00 2001 From: Pascal Lais Date: Wed, 11 Mar 2020 12:35:01 +0100 Subject: [PATCH] Update 'point.py' Random coordinates are now float values. --- point.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/point.py b/point.py index 6a7a701..5f4d520 100644 --- a/point.py +++ b/point.py @@ -11,7 +11,7 @@ class Point(): self.set_y(y) def set_x(self, new_x): """Set the X-Coordinate of the Point""" - self.__x = int(new_x) + self.__x = new_x def get_x(self): """Returns the X-Coordinate of the Point""" return self.__x @@ -29,7 +29,7 @@ class Point(): def get_random(min_x=0, max_x=100, min_y=0, max_y=100): """Set the point to a random place inside the boundaries""" - return Point(random.randint(min_x, max_x), random.randint(min_y, max_y)) + return Point(random.uniform(min_x, max_x), random.uniform(min_y, max_y)) def sort_set(point_set, sort_by_y=False): """Sort a Point set using merge sort"""