Commit Graph

3 Commits

Author SHA1 Message Date
2d4ee80b4c Move set_random() out of class
As generating a random Point is mostly not used on an existing object,
the method is now an independent function get_random() instead of a
class method.
2020-03-09 18:42:46 +01:00
Pascal Lais
6f83b57ffb Add sort function and class methods to class Point
The sort function takes a list of Point objects and sorts them either
by their x or y coordinate using merge sort.
Also added a method set_random, that sets the coordinates to random
values and a method str, that returns the coordinates as string.
2020-03-09 07:48:07 +01:00
Pascal Lais
a14f96ab2a Add point module
The point module defines a Point class, that displays a Point in a
two-dimensional coordinate system. An object of the class contains a x-
and y-coordinate and a setter and getter method for each at this point.
2020-03-08 10:57:40 +01:00