# Launched: 3 new formulas to help you get random and/or reversed

In the immortal words of Missy Elliott, sometimes you just need to “Put my thing down, flip it, and reverse it.” We’ve heard that’s been true for your Coda docs, and while some of you have already discovered these, we’re excited to confirm 3 new formulas with you today!

ReverseList()

Can you guess what this one does by its name? That’s rightーnow you can automatically structure your outputs as a list in the reverse order. Previously, it took some complex formulas to do this, but now you can simply use ReverseList() to reverse the order of an unsorted table or list.

RandomInteger()

Ever need a random number for your code tests, statistical analysis, app, game, or just for fun? The RandomInteger() formula has you covered. This new formula allows you to set min and max bounds, as well as whether the value should update continuously (true) or not (false).

RandomItem()

Similar to to the above formula, the RandomItem() formula lets Coda handle the randomization of your list for you. With RandomItem(), you can designate a list or array as the selection set, and indicate whether the random selection should update continuously or not. This one is especially helpful for building tables to decide where to order dinner from when you and your partner can’t choose.

A fun experiment is to try writing these without the new formulas and then with the new formulas. We hope these additions make life much easier.

39 Likes

Wonderful ! These additions are very useful for sure.

6 Likes

They do make life easier. Thank you!

I never knew whether the `Random()` was 1-inlcusive or not (i.e. `[0, 1)` or `[0, 1]`). Normally in programming languages it’s exclusive but Coda is making these departures sometimes for the sake of casual users. And, of course, I never had a chance to test it for sure, given the Random()'s nature

1 Like

For those wondering, `RandomInteger` is inclusive (`[x, y]`).

This means that `RandomInteger(0, 2)` can return 0, 1, or 2.

3 Likes

`Random` is not 1-inclusive (i.e. it returns in the range `[0,1)` ). Also @cnr is correct that `RandomInteger` is inclusive. Thanks for the feedback on the formula documentation: I’m updating the descriptions for both formulas, and those updates should be visible in a few days.

5 Likes

Thanks for the clarification, name-fellow, and welcome to the Community!

2 Likes

Thanks, fellow Paul! I’m looking forward to building many more things in the weeks and months to come.

3 Likes

I just came here to say that the opening line is what made me click to learn more.

But, seriously - exciting! I’ve been waiting for a real solution to the RandomItem() … but now it exists!

1 Like