updated to experimental in development version of serenity and component V2 messages
This commit is contained in:
parent
4a4f3671e7
commit
0ebe9e3be3
4 changed files with 649 additions and 479 deletions
16
src/dice.rs
16
src/dice.rs
|
|
@ -33,20 +33,6 @@ pub struct DiceFormula {
|
|||
pub(crate) x: bool,
|
||||
}
|
||||
|
||||
impl DiceFormula {
|
||||
pub fn new(size: AstNodeId) -> Self {
|
||||
Self {
|
||||
count: None,
|
||||
size,
|
||||
kh: None,
|
||||
kl: None,
|
||||
dh: None,
|
||||
dl: None,
|
||||
x: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Expression {
|
||||
pub fn evaluate(&self, mut rng: impl Rng) -> anyhow::Result<String> {
|
||||
let mut result = String::new();
|
||||
|
|
@ -59,7 +45,7 @@ impl Expression {
|
|||
return Ok(avg);
|
||||
}
|
||||
let mut average = self.node_sample(rng, self.root)?;
|
||||
for idx in 1..1000 {
|
||||
for idx in 1..3000 {
|
||||
average =
|
||||
(average * idx as f64 + self.node_sample(rng, self.root)?) / (idx as f64 + 1f64);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue