pymasep.dices ============= .. py:module:: pymasep.dices .. autoapi-nested-parse:: Module to launch many dices, any types, with modifiers. Functions --------- .. autoapisummary:: pymasep.dices.roll_dice pymasep.dices.roll_dices pymasep.dices.min_max_dice pymasep.dices.min_max_dices Module Contents --------------- .. py:function:: roll_dice(dice, random_seed = None) Roll one or many dices of one type and return the total and all the values :param dice: String format xDy with 0>> roll_dice('2D6') (4, [1, 3]) .. py:function:: roll_dices(dices, random_seed = None) Roll many dices and sum/substract all terms. No parenthesis is allowed. :param dices: Expression with format ``((\d+)?D(\d+)|([\+\-]\d+))+?`` (not totally sure of the regexp, see tests) :param random_seed: seed used in tests. Should not be used in a real scenario except for reproductible scenarios :return: (`result`, `details`). `Result` is the sum of all dices and modifiers and `details` is list of all details, including modifiers :Example:: >>> roll_dices('2D6+1D4+3') (13, [5, 4, 1, 3]) .. py:function:: min_max_dice(dice) get the min and max values of dice :param dice: string format xDy with 0>> min_max_dices('2D6+1D4+3') (6, 19)