Skip to content

Statistic

Exodia edited this page Jul 26, 2022 · 27 revisions

Statistic: Manages the relationship of possible patners. Using the dictionaries has in memory only the variables to use, I recommend changing the slo values with set(), change(), get()

The best solution is to extend this class to implement some other class ex: PhysicsStatistic(Statistic), GroceriesStatistic(Statistic)...

Get

(code-snippets: DR_StatisticGet)

$ mc_strength = mcStatistic.get("strength")

Improvment

(code-snippets: DR_StatisticImprovment)

$ mcStat.improve("strength")
$ mcStat.improve("strength", 2)

Compare

(code-snippets: DR_StatisticChallenge)

$ mc_strength = mcStatistic.get("strength")
$ fr_strength = frStatistic.get("strength")
if isGreaterThan(mc_strength, fr_strength ): # mc_strength > fr_strength
    "You have won"
else:
    "You lost"

(code-snippets: DR_StatisticCompareMenu)

$ mc_strength = mcStatistic.get("strength")
menu:
    "Can ..." if isGreaterThan(mc_strength, f0 ): # mc_strength > 0
        # ...

Sentimental Statistic

SentimentalStatistic: is a grosse example of an extension of Statistic() thought only of games for adults

Clone this wiki locally