Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

[harlowe] How to get the "random" command to substract/add a random percentage from a value?

I'm trying to cause it to give me a number stored in $variable1, to which it should either add or substract a random percentage. In this case, something in between -25% and + 25%.
($variable1 + ($variable1 * (random: 0.75,1.25)))

Is there a way to do it?

Comments

  • I'm very new to this, but it looks like
    (set:$variable1=$variable1*((random:75,125)*0.01))
    
    (print:$variable1)
    

    could work, or something similar at least.
  • It was actually this, but your answer helped.
    $variable1 to ($value * ((random: 75,125) * 0.01))
    
Sign In or Register to comment.