示例#1
0
from Fleet import Fleet
from Thing import Thing

fleet = Fleet()
# Create a fleet of things to have this output:
# 1. [ ] Get milk
# 2. [ ] Remove the obstacles
# 3. [x] Stand up
# 4. [x] Eat lunch

fleet.add(Thing("Get milk"))
fleet.add(Thing("Remove the obstacles"))

thing1 = Thing("Stand up")
thing1.complete()
thing2 = Thing("Eat lunch")
thing2.complete()

fleet.add(thing1)
fleet.add(thing2)

print(fleet)
# nekem megoldotta az import problémát az,
# hogy a .vscode/settings.json -ön belül
# "python.languageServer": "Jedi" -re változtattam a
# "python.languageServer": "Microsoft" helyett

from Fleet import Fleet
from Thing import Thing

fleet = Fleet()

get_milk = Thing("Get milk")
remove_obstacles = Thing("Remove the obstacles")
stand_up = Thing("Stand up")
stand_up.complete()
eat_lunch = Thing("Eat lunch")
eat_lunch.complete()

fleet.add(get_milk)
fleet.add(remove_obstacles)
fleet.add(stand_up)
fleet.add(eat_lunch)

# Töltsd fel a fleet példányt olyan módon, hogy a következő legyen a kimenet:
# 1. [ ] Get milk
# 2. [ ] Remove the obstacles
# 3. [x] Stand up
# 4. [x] Eat lunch

print(fleet)
示例#3
0
# Create a fleet of things to have this output:

# 1. [ ] Get milk
c = Thing("Get milk")
milk = c.__str__()
fleet = Fleet()
fleet.add(milk)

# 2. [ ] Remove the obstacles
c = Thing("Remove the obstacles")
remove = c.__str__()
fleet.add(remove)

# 3. [x] Stand up
c = Thing("Stand up")
true_complete = c.complete()
stand = c.__str__()
fleet.add(stand)

# 4. [x] Eat lunch
c = Thing("Eat Lunch")
true_complete = c.complete()
stand = c.__str__()
fleet.add(stand)
print(fleet.__str__())

###### Roll dice
import random


class DiceSet(object):