Warning, /rolisteam/rolisteam-diceparser/README.md is written in an unsupported language. File is not indexed.

0001 [![Logo](https://invent.kde.org/rolisteam/rolisteam/-/raw/master/resources/rolistheme/1000-rolisteam.png)](http://www.rolisteam.org)
0002 
0003 # DiceParser
0004 
0005 Rolisteam Dice Parser run dice commands. It is available on several platforms.
0006 The syntax is simple and powerful.
0007 
0008 [Full documentation here](https://invent.kde.org/rolisteam/rolisteam-diceparser/-/blob/master/HelpMe.md)
0009 
0010 
0011 ## [Invite to Your Discord Server](https://discordapp.com/oauth2/authorize?&client_id=279722369260453888&scope=bot&permissions=0)
0012 
0013 [![Discord Bots](https://discordbots.org/api/widget/279722369260453888.svg)](https://discordbots.org/bot/279722369260453888)
0014 
0015 
0016 # Licensing 
0017 
0018 * GPL v3
0019 
0020 ## Features
0021 
0022 * `99.9%` uptime
0023 * Roll any kind of dice
0024 * Customizable prefix
0025 * Custom alias/macro to improve game experience
0026 * Manage colorized dice
0027 * Many operators
0028 
0029 ## Examples:
0030 
0031 ### 3D100
0032 Roll 3 dice with 100 faces
0033 
0034 ### 10D10e[=10]s
0035 Roll 10 dice with 10 faces, 10 explodes, and sort the result.
0036 
0037 ### 100291D66666666s
0038 roll 100291 dice with 66666666666 faces and sort result
0039 
0040 ### 15D10c[>7]
0041 roll 15 dice with 10 faces and it counts number of dice which are above 7
0042 
0043 ### 1D8+2D6+7
0044 roll 1 die with 8 faces and add the result to 2 dice with 6 faces and add 7.
0045 
0046 ### D25
0047 roll 1 die with 25 faces
0048 
0049 ### 88-1D20
0050 88 minus the value of 1 die of 20 faces
0051 
0052 ### 8+8+8
0053 compute: 24
0054 
0055 ### 100/28*3
0056 compute: 100/28 = 3
0057 3*3 = 9
0058 
0059 
0060 More examples at : https://invent.kde.org/rolisteam/rolisteam-diceparser/-/blob/master/HelpMe.md
0061 
0062 ## Grammar
0063 The grammar is something like this:
0064 
0065 ```
0066 Program =: Instruction [InstructionSeparator, Instruction]* Comment
0067 InstructionSeparator = ;
0068 Instruction =: Expression ([Operator, Expression]* | [Option]*)
0069 Operator =: ScalarOperator
0070 Expression =: OpenParenthesis Expression closeParenthesis
0071 | Option*
0072 | [Operator, Expression]*
0073 | Operand Dice
0074 | Command
0075 | function
0076 | NodeOperator [Option]*
0077 | ValuesList
0078 | Dice (Operand == 1)
0079 Operand =: DynamicVariable | Number | String
0080 OpenParenthesis = (
0081 closeParenthesis = )
0082 OpenList = [
0083 CloseList = ]
0084 ListSeparator = ,
0085 ValuesList=: OpenList (DynamicVariable | Number)? [ ListSeparator,(DynamicVariable | Number)]*  CloseList
0086 Dice =: DiceOperator [uniqueValue] DiceParameter
0087 DiceOperator =: D ParameterDice | L ParameterList
0088 DiceParameter =: ParameterDice | ParameterList
0089 ParameterDice =: Number|Range
0090 ParameterList =: List
0091 List=: OpenList String[Probability] [ListSeparator,String[Probability]]* CloseList
0092 Probability=: OpenList (Range|Percentage) CloseList
0093 Percentage =: number
0094 function =: functionName OpenParenthesis [function_args] closeParenthesis
0095 function_args =: Instruction [InstructionSeparator, Instruction] | Operand | ValidatorList
0096 functionName =: repeat
0097 Option =: Keep
0098 | KeepAndExplode
0099 | Filter
0100 | Sort
0101 | Count
0102 | Reroll
0103 | RerollUntil
0104 | RerollAndAdd
0105 | Explode
0106 | Merge
0107 | Bind
0108 | Occurences
0109 | Unique
0110 | Paint
0111 | If
0112 | Split
0113 | Group
0114 Range =: OpenList Number RangeSeparator Number CloseList
0115 RangeSeparator =: ..
0116 ScalarOperator =: [x,-,*,x,/,**]
0117 number =: [-] [0-9]+ | constantValue
0118 OpenVaribale=: ${
0119 CloseVariable=: }
0120 constantValue =: OpenVaribale (id | label) CloseVariable
0121 id=[_,a-z][_,A-z,0-9]* # must respect rules of QML id
0122 label=.*
0123 variable = OpenVaribale [0-9]+ CloseVariable
0124 ValidatorList =: OpenList CompareMethod Validator [LogicOpetator CompareMethod Validator]* CloseList
0125 LogicOpetator =: AND | XOR |  OR
0126 CompareMethod =: Each |  All | Scalar | ANY
0127 Each=:
0128 All=: *
0129 Scalar=: :
0130 ANY=: .
0131 AND =: &
0132 XOR =: ^
0133 OR =: |
0134 Ascendant=:l
0135 Validator =: BooleanValidator | RangeValidator | OperationValidator
0136 CompareOpetator =: = | > | >= | < | <= | !=
0137 RangeValidator =: Range
0138 OperationValidator =: Modulo operandNode BooleanValidator
0139 Modulo =: %
0140 BooleanValidator =: [=]Operand | [CompareOpetator Operand]
0141 ListOfValue=: String[Range],ListOfValue | String[Range]
0142 String =: .*[^ListSeparator]
0143 Keep =: k[Ascendant] Number
0144 KeepAndExplode =: K[Ascendant] number
0145 Filter =: f ValidatorList
0146 Sort =: s[Ascendant]
0147 Count =: c ValidatorList
0148 Reroll =: r ValidatorList
0149 RerollUntil =: R ValidatorList
0150 RerollAndAdd =: a ValidatorList
0151 Merge =: m
0152 Bind =: b
0153 Occurences =: OccurencesWidth ( ListSeparator  number | ValidatorList)
0154 OccurencesWidth =: number
0155 unique =: u
0156 Painter =: p PainterParameters
0157 PainterParameters =: OpenList PairColorOccurence [ListSeparator , PairColorOccurence]* CloseList
0158 PairColorOccurence =: Color PairSeparator Number
0159 PairSeparator =: :
0160 If =: i [compareMethod] ValidatorList Bloc[Bloc]
0161 compareMethod =: OnEach | OneOfThem | AllOfThem | onScalar
0162 OnEach =: ''
0163 OneOfThem = '.'
0164 AllOfThem = '*'
0165 onScalar = ':'
0166 Bloc =: OpenBranch Expression CloseBranch
0167 OpenBloc =: {
0168 CloseBloc =: }
0169 Split =: y
0170 Group =: g Number
0171 Sort =: s
0172 Group =: number
0173 Explode =: e ValidatorList
0174 NodeOperator = Jumpbackward
0175 Jumpbackward =: @
0176 Merge =: m | m Expression
0177 Command =: help | la
0178 uniqueValue = u
0179 Comment =: StartComment String
0180 StartComment =: #
0181 ```
0182 
0183 
0184 # Compilation
0185 
0186 ```
0187 git clone --recursive https://invent.kde.org/rolisteam/rolisteam-diceparser.git
0188 cd rolisteam-diceparser
0189 mkdir build
0190 cd build
0191 cmake ../ -DBUILD_CLI=ON
0192 make
0193 sudo make install
0194 ```