Skip to content
Snippets Groups Projects
Commit e7ced56e authored by Thomas Röck's avatar Thomas Röck
Browse files

update main

parent db389277
No related branches found
No related tags found
No related merge requests found
......@@ -4,8 +4,8 @@ from fruit import Fruit
from plant import FruitBearingPlant
# %% Create objects
plants = [FruitBearingPlant("strawberry", 3, Fruit("strawberry", 55)),
FruitBearingPlant("tomato", 4, Fruit("tomato", 55))]
plants = [FruitBearingPlant("strawberry", 3, Fruit("strawberry", 33)),
FruitBearingPlant("tomato", 4, Fruit("tomato", 16))]
bed = Bed("in the garden")
......@@ -63,3 +63,21 @@ bed_yield = bed.harvest()
print(f"yield: {bed_yield}\n")
print(bed, end="\n\n")
# %%
# Same as above without prints
plants = [FruitBearingPlant("strawberry", 3, Fruit("strawberry", 33)),
FruitBearingPlant("tomato", 4, Fruit("tomato", 16))]
bed = Bed("in the garden")
amount = 9
bed.water(amount)
for plant in plants:
bed.plant_plant(plant)
periods = amount // len(plants)
for _ in range(periods):
bed.update()
bed.update()
bed_yield = bed.harvest()
# %%
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment