The Bot Bikeshed
-
@PleegWat said in The Bot Bikeshed:
@error Infinite reroll again?
No, basically I plan to implement a TTL mechanism, where each step over the tree decrements some counter, and if it hits 0 it gives up.
-
@error_bot parse 1d5; 2d6; min(1 + 2, 2d5)
- multiple expressions in a statement!
- multiple arguments!
Comma and semicolons are interchangeable and always optional, just for readability. 2 adjacent expression nodes are sufficient for separator.
-
{ Ā type: 'statement', Ā expressions: [ Ā { type: 'diceExpression', sides: 5, count: 1, modifiers: [] }, Ā { type: 'diceExpression', sides: 6, count: 2, modifiers: [] }, Ā { Ā type: 'callExpression', Ā functionName: 'min', Ā arguments: [ Ā { Ā type: 'binaryExpression', Ā operator: { type: 'additionOperator', symbol: '+' }, Ā left: { type: 'numericLiteral', value: 1 }, Ā right: { type: 'numericLiteral', value: 2 } Ā }, Ā { type: 'diceExpression', sides: 5, count: 2, modifiers: [] } Ā ] Ā } Ā ] Ā}
-
No plans to implement e.g. 5d5d5. I don't see a purpose for it except .
-
Though I guess "sides" and "count" could just be expressions...
-
@error said in The Bot Bikeshed:
Comma and semicolons are interchangeable and always optional, just for readability. 2 adjacent expression nodes are sufficient for separator.
There may be some expectation that this implies multiplication, so I may reconsider...
Currently 2 ( 2d5 ) means "2; 2d5" not "2 * 2d5". Though if you mean that, write that.
-
@error said in The Bot Bikeshed:
2 ( 2d5 )
Reads like a function invocation to me. I say make it a syntax error.
-
@PleegWat said in The Bot Bikeshed:
@error said in The Bot Bikeshed:
2 ( 2d5 )
Reads like a function invocation to me. I say make it a syntax error.
:notsureif: - you get plenty of math geeks playing D&D and they'd call that multiplication. in fact, one of them would say that a bare constant in that position is implying a multiplication, and the constant effectively represents the curry of multiply with that constant. you should punch that one.
-
@Gribnit Nah, without any operators between the brackets it just looks weird.
-
-
@PleegWat said in The Bot Bikeshed:
@error said in The Bot Bikeshed:
2 ( 2d5 )
Reads like a function invocation to me. I say make it a syntax error.
Currently:
at the top level: it's 2 expressions that will be evaluated independently: you get
2
and eg5
.
nested inside another expression (except call): syntax error
child of call expression: 2 arguments
-
@error_bot eval round( pi * 10 ^ (2d6-2) )
-
3,141,593
-
@error_bot eval 100d22 / 100d7
-
3.049
-
@error_bot eval 22d100 / 7d100
-
2.5
-
@error_bot eval 1d100*sqrt(2)
-
24.042
-
@error_bot eval (22d100)^2 / (7d100)^2
-
13.969
-
@error_bot eval log(22d100) / log(7d100)
-
1.186
-
@error_bot eval log(22d100) + log(7d100)
-
5.688
-
@error_bot eval ln(e)
-
1
Ā
Ā
-
@error_bot eval log(log(1d1000))
-
0.361
-
@error_bot eval log(1d1000)^2
-
7.73
-
@error_bot eval (1d6)d(1d6)
-
Error: {(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)}[expr.functionName] is not a function
-
@error_bot eval ()d.prototype
-
Error: lex failed; remaining: .prototype; match: null
-
@error_bot eval (1d6)d6
-
Error: invalid count:
-
@error_bot eval 1d(1d6)
-
Error: {(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)}[expr.functionName] is not a function
-
@error_bot eval 1d
-
Error: result out of range
-
@error_bot eval 1d100 + (1d2-1) * 1d1000 + (1d2-1) * 1d9999
-
695
-
@error_bot eval signum(10-1d20)
-
Error: {(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)}[expr.functionName] is not a function
-
@error_bot eval prototype()
-
Error: {(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)(intermediate value)}[expr.functionName] is not a function
-
eval min(1,max(-1,10-1d20))
-
-