A random output

Options
I would like to know how to make an api that allows us to enter 2 or more texts and that chooses 1 randomly to give us an answer, among those recorded 

And also if it is possible to define a rate of chance that a value record appears more than another 

Comments

  • Facundo Lucci
    Options
    So this probably isn’t the only way to do this but I took it on as puzzle to figure out. This method is rather basic, so in order to favor an outcome would be to simply duplicate that value in the input. for example texts[“a”,”b”,”c”,”b”] - here “b” has a 50 percent chance of being selected. You could probably use this as a foundation and build something more complex.

    [597FBB21-106A-4CAB-BF49-C6341B019218]
  • Yoann Akabassi
    Options
    Thank Youuuu very much
  • Yoann Akabassi
    Options
    If I want to put in bravo studio I choose get or posts as it is an api.