Last active
August 29, 2015 14:17
-
-
Save JanneSalokoski/f5916d598553dcc39363 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
### | |
# Copyright @ Janne Salokoski 2015 | |
### | |
import os | |
import time | |
import random | |
class Weed: | |
def __init__(self, id): | |
self.values = {} | |
self.set_values("id", id) | |
self.set_values("multiplication", 1) | |
self.set_values("water_consumption", 10) | |
self.set_values("light_blockage", 1) | |
self.set_values("min_water", 10) | |
self.set_values("min_light", 80) | |
self.set_values("max_water", 90) | |
self.set_values("max_light", 100) | |
def set_values(self, key, value): | |
self.values[key] = value | |
def main(): | |
plants = [] | |
for i in range(0, 9): | |
plants.append(Weed(len(plants))) | |
for plant in plants: | |
for key, value in plants[plant.values["id"]].values.items(): | |
print("{}: {}".format(key.capitalize(), value), end = " ") | |
print("") | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment