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)...

Compare

(code-snippets: DR_StatisticChallenge)

menu:
    "Challenge":
        $ 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