rocket-Bouabdellah 1.0.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_bouabdellah-1.0.0/LICENSE.txt +0 -0
- rocket_bouabdellah-1.0.0/PKG-INFO +19 -0
- rocket_bouabdellah-1.0.0/README.md +0 -0
- rocket_bouabdellah-1.0.0/rocket/__init__.py +1 -0
- rocket_bouabdellah-1.0.0/rocket/rocket.py +55 -0
- rocket_bouabdellah-1.0.0/rocket_Bouabdellah.egg-info/PKG-INFO +19 -0
- rocket_bouabdellah-1.0.0/rocket_Bouabdellah.egg-info/SOURCES.txt +10 -0
- rocket_bouabdellah-1.0.0/rocket_Bouabdellah.egg-info/dependency_links.txt +1 -0
- rocket_bouabdellah-1.0.0/rocket_Bouabdellah.egg-info/requires.txt +1 -0
- rocket_bouabdellah-1.0.0/rocket_Bouabdellah.egg-info/top_level.txt +1 -0
- rocket_bouabdellah-1.0.0/setup.cfg +4 -0
- rocket_bouabdellah-1.0.0/setup.py +15 -0
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rocket-Bouabdellah
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: An awesome package that does something
|
|
5
|
+
Home-page: http://pypi.python.org/pypi/rocket/
|
|
6
|
+
Author: Beloued Bouabdellah
|
|
7
|
+
Author-email: b.beloued@esi-sba.dz
|
|
8
|
+
License: LICENSE.txt
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE.txt
|
|
11
|
+
Requires-Dist: rocket
|
|
12
|
+
Dynamic: author
|
|
13
|
+
Dynamic: author-email
|
|
14
|
+
Dynamic: description-content-type
|
|
15
|
+
Dynamic: home-page
|
|
16
|
+
Dynamic: license
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
Dynamic: requires-dist
|
|
19
|
+
Dynamic: summary
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import rocket
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import random
|
|
2
|
+
|
|
3
|
+
# define the class of rocket
|
|
4
|
+
class Rocket():
|
|
5
|
+
# Rocket simulates a rocket ship for a game,
|
|
6
|
+
# or a physics simulation.
|
|
7
|
+
|
|
8
|
+
def __init__(self, x=0, y=0):
|
|
9
|
+
# Each rocket has an (x,y) position.
|
|
10
|
+
self.x = x
|
|
11
|
+
self.y = y
|
|
12
|
+
|
|
13
|
+
def move_up(self, x_increment=0, y_increment=1):
|
|
14
|
+
# Move the rocket according to the paremeters given.
|
|
15
|
+
# Default behavior is to move the rocket up one unit.
|
|
16
|
+
self.x += x_increment
|
|
17
|
+
self.y += y_increment
|
|
18
|
+
|
|
19
|
+
def __str__(self):
|
|
20
|
+
return f"A Rocket positioned at ({self.x},{self.y})"
|
|
21
|
+
|
|
22
|
+
def __repr__(self):
|
|
23
|
+
return f"Rocket({self.x},{self.y})"
|
|
24
|
+
|
|
25
|
+
# define __eq__ method
|
|
26
|
+
def __eq__(self, other):
|
|
27
|
+
if isinstance(other, Rocket):
|
|
28
|
+
return self.x == other.x and self.y == other.y
|
|
29
|
+
return False
|
|
30
|
+
|
|
31
|
+
# define get distance method that represent this rocket to another rocket
|
|
32
|
+
def get_distance(self, other):
|
|
33
|
+
if isinstance(other, Rocket):
|
|
34
|
+
return ((self.x - other.x) ** 2 + (self.y - other.y) ** 2) ** 0.5
|
|
35
|
+
else:
|
|
36
|
+
raise ValueError("The other object must be an instance of Rocket.")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class Shuttle(Rocket):
|
|
41
|
+
def __init__(self, x=0, y=0, flight_completed=0):
|
|
42
|
+
super().__init__(x, y)
|
|
43
|
+
self.flight_completed = flight_completed
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
class CircleRocket(Rocket):
|
|
47
|
+
def __init__(self, x=0, y=0, radius=1):
|
|
48
|
+
super().__init__(x, y)
|
|
49
|
+
self.radius = radius
|
|
50
|
+
|
|
51
|
+
def get_area(self):
|
|
52
|
+
return 3.14159 * (self.radius ** 2)
|
|
53
|
+
|
|
54
|
+
def get_circumference(self):
|
|
55
|
+
return 2 * 3.14159 * self.radius
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rocket-Bouabdellah
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: An awesome package that does something
|
|
5
|
+
Home-page: http://pypi.python.org/pypi/rocket/
|
|
6
|
+
Author: Beloued Bouabdellah
|
|
7
|
+
Author-email: b.beloued@esi-sba.dz
|
|
8
|
+
License: LICENSE.txt
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
License-File: LICENSE.txt
|
|
11
|
+
Requires-Dist: rocket
|
|
12
|
+
Dynamic: author
|
|
13
|
+
Dynamic: author-email
|
|
14
|
+
Dynamic: description-content-type
|
|
15
|
+
Dynamic: home-page
|
|
16
|
+
Dynamic: license
|
|
17
|
+
Dynamic: license-file
|
|
18
|
+
Dynamic: requires-dist
|
|
19
|
+
Dynamic: summary
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
LICENSE.txt
|
|
2
|
+
README.md
|
|
3
|
+
setup.py
|
|
4
|
+
rocket/__init__.py
|
|
5
|
+
rocket/rocket.py
|
|
6
|
+
rocket_Bouabdellah.egg-info/PKG-INFO
|
|
7
|
+
rocket_Bouabdellah.egg-info/SOURCES.txt
|
|
8
|
+
rocket_Bouabdellah.egg-info/dependency_links.txt
|
|
9
|
+
rocket_Bouabdellah.egg-info/requires.txt
|
|
10
|
+
rocket_Bouabdellah.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rocket
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
rocket
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from setuptools import setup
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name='rocket-Bouabdellah',
|
|
5
|
+
version='1.0.0',
|
|
6
|
+
author='Beloued Bouabdellah',
|
|
7
|
+
author_email='b.beloued@esi-sba.dz',
|
|
8
|
+
packages=['rocket'],
|
|
9
|
+
url='http://pypi.python.org/pypi/rocket/',
|
|
10
|
+
license='LICENSE.txt',
|
|
11
|
+
description='An awesome package that does something',
|
|
12
|
+
long_description=open('README.md').read(),
|
|
13
|
+
long_description_content_type="text/markdown",
|
|
14
|
+
install_requires=['rocket']
|
|
15
|
+
)
|