Compare commits
3 Commits
515df4d452
...
ee9265d00c
| Author | SHA1 | Date | |
|---|---|---|---|
| ee9265d00c | |||
| c6b4d8f3d9 | |||
| da15c756d4 |
@ -19,3 +19,5 @@ Repository for CDS-2020 Programming and Promt Engineering II
|
|||||||
|-|-|-|-|
|
|-|-|-|-|
|
||||||
|Find the force of gravity between two objects|kata_force_of_gravity.py|test_force_of_gravity.py|[5b609ebc8f47bd595e000627](https://www.codewars.com/kata/5b609ebc8f47bd595e000627/)|
|
|Find the force of gravity between two objects|kata_force_of_gravity.py|test_force_of_gravity.py|[5b609ebc8f47bd595e000627](https://www.codewars.com/kata/5b609ebc8f47bd595e000627/)|
|
||||||
|The Lamp: Revisited|kata_the_lamp.py|test_the_lamp.py|[570e6e32de4dc8a8340016dd](https://www.codewars.com/kata/570e6e32de4dc8a8340016dd)|
|
|The Lamp: Revisited|kata_the_lamp.py|test_the_lamp.py|[570e6e32de4dc8a8340016dd](https://www.codewars.com/kata/570e6e32de4dc8a8340016dd)|
|
||||||
|
|OOP: Object Oriented Piracy|kata_object_oriented_piracy.py|test_object_oriented_piracy.py|[54fe05c4762e2e3047000add](https://www.codewars.com/kata/54fe05c4762e2e3047000add)|
|
||||||
|
|Vigenère Cipher Helper|kata_cipher_helper.py|test_cipher_helper.py|[52d1bd3694d26f8d6e0000d3](https://www.codewars.com/kata/52d1bd3694d26f8d6e0000d3)|
|
||||||
|
|||||||
9
src/codewars/kata_cipher_helper.py
Normal file
9
src/codewars/kata_cipher_helper.py
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
class VigenereCipher(object):
|
||||||
|
def __init__(self, key, alphabet):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def encode(self, text):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def decode(self, text):
|
||||||
|
pass
|
||||||
7
src/codewars/kata_object_oriented_piracy.py
Normal file
7
src/codewars/kata_object_oriented_piracy.py
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
class Ship:
|
||||||
|
def __init__(self, draft, crew):
|
||||||
|
self.draft = draft
|
||||||
|
self.crew = crew
|
||||||
|
|
||||||
|
def is_worth_it(self):
|
||||||
|
return self.draft - self.crew * 1.5 > 20
|
||||||
5
tests/codewars/test_cipher_helper.py
Normal file
5
tests/codewars/test_cipher_helper.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
"""from src.codewars.kata_cipher_helper import *
|
||||||
|
|
||||||
|
|
||||||
|
def test_cipher_helper():
|
||||||
|
pass"""
|
||||||
15
tests/codewars/test_object_oriented_piracy.py
Normal file
15
tests/codewars/test_object_oriented_piracy.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
from src.codewars.kata_object_oriented_piracy import Ship
|
||||||
|
|
||||||
|
|
||||||
|
def test_piracy():
|
||||||
|
empty_ship = Ship(0, 0)
|
||||||
|
assert not empty_ship.is_worth_it()
|
||||||
|
|
||||||
|
boat = Ship(15, 20)
|
||||||
|
assert not boat.is_worth_it()
|
||||||
|
|
||||||
|
worthy_ship = Ship(100, 20)
|
||||||
|
assert worthy_ship.is_worth_it()
|
||||||
|
|
||||||
|
big_boat = Ship(35, 20)
|
||||||
|
assert not big_boat.is_worth_it()
|
||||||
Loading…
x
Reference in New Issue
Block a user