rocket-esi-package 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rocket_esi_package-0.1.0/PKG-INFO +7 -0
- rocket_esi_package-0.1.0/README.md +32 -0
- rocket_esi_package-0.1.0/rocket/__init__.py +1 -0
- rocket_esi_package-0.1.0/rocket/rocket.py +26 -0
- rocket_esi_package-0.1.0/rocket_esi_package.egg-info/PKG-INFO +7 -0
- rocket_esi_package-0.1.0/rocket_esi_package.egg-info/SOURCES.txt +8 -0
- rocket_esi_package-0.1.0/rocket_esi_package.egg-info/dependency_links.txt +1 -0
- rocket_esi_package-0.1.0/rocket_esi_package.egg-info/top_level.txt +1 -0
- rocket_esi_package-0.1.0/setup.cfg +4 -0
- rocket_esi_package-0.1.0/setup.py +10 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
\# Rocket ESI Package
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
A simple Python package for working with rockets.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
\## Example
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
|
|
17
|
+
from rocket import Rocket
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
r1 = Rocket(0, 0)
|
|
22
|
+
|
|
23
|
+
r2 = Rocket(3, 4)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
print(r1.get\_distance(r2))
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .rocket import Rocket
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
|
|
2
|
+
from math import sqrt
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class Rocket:
|
|
6
|
+
def __init__(self, x=0, y=0):
|
|
7
|
+
self.x = x
|
|
8
|
+
self.y = y
|
|
9
|
+
|
|
10
|
+
def move_up(self, x_increment=0, y_increment=1):
|
|
11
|
+
self.x += x_increment
|
|
12
|
+
self.y += y_increment
|
|
13
|
+
|
|
14
|
+
def get_distance(self, other_rocket):
|
|
15
|
+
return sqrt(
|
|
16
|
+
(self.x - other_rocket.x) ** 2
|
|
17
|
+
+ (self.y - other_rocket.y) ** 2
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
def __eq__(self, other):
|
|
21
|
+
if not isinstance(other, Rocket):
|
|
22
|
+
return NotImplemented
|
|
23
|
+
return self.x == other.x and self.y == other.y
|
|
24
|
+
|
|
25
|
+
def __str__(self):
|
|
26
|
+
return f"Rocket at ({self.x}, {self.y})"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rocket
|