# Randomized list

**URL:** <https://cl.desmos.com/t/randomized-list/1327>\
**Category:** Questions\
**Created:** [August 16, 2020, 8:38pm UTC](https://cl.desmos.com/t/randomized-list/1327 "2020-08-16T20:38:17Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![SeanMaths4EAL](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/seanmaths4eal/32/289_2.png) [@SeanMaths4EAL](https://cl.desmos.com/u/SeanMaths4EAL)\
**Post date:** [August 16, 2020, 8:38pm UTC](https://cl.desmos.com/t/randomized-list/1327/1 "2020-08-16T20:38:17Z")

</div>

Anyone have a way of reordering a list randomly?

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [August 17, 2020, 5:24am UTC](https://cl.desmos.com/t/randomized-list/1327/2 "2020-08-17T05:24:40Z")

</div>

Gotta love the new list functions  
[https://www.desmos.com/calculator/kkd2bkbjzt](https://www.desmos.com/calculator/kkd2bkbjzt)

---

<div class="post-metadata">

**Author:** ![Bryn](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/bryn/32/40_2.png) [@Bryn](https://cl.desmos.com/u/Bryn)\
**Post date:** [August 17, 2020, 11:40am UTC](https://cl.desmos.com/t/randomized-list/1327/3 "2020-08-17T11:40:05Z")

</div>

I didn’t know that sort takes a second argument! Is that documented somewhere?

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [August 17, 2020, 5:03pm UTC](https://cl.desmos.com/t/randomized-list/1327/4 "2020-08-17T17:03:49Z")

</div>

New CL functions were noted in the [api changelog](https://www.desmos.com/api/changelog)

and in these three articles:

> **[Lists](https://support.desmos.com/hc/en-us/articles/204990855-Lists)**
>
> Overview
> You can make lists in Desmos using square brackets like this:
> 
> You can create lists with evenly spaced elements. \[1,...,10\] is a list of the integers between 1 and 10. \[1,3,...,11\] is a li...

  

> **[Statistics](https://support.desmos.com/hc/en-us/articles/204311369-Statistics)**
>
> Overview
> Statistics functions like mean, median, min, max, and stdev take a list as an argument and return a number.
>  
> Supported Statistics Functions:
> total(x\_1) sum of all elements in a list
> lengt...

  

> **[Supported Functions](https://support.desmos.com/hc/en-us/articles/212235786-Supported-Functions)**
>
> Trigonometric Functions
> 
> 
> 
> Function
> Type in...
> 
> 
> Sine
> sin()
> 
> 
> Cosine
> cos()
> 
> 
> Tangent
> tan()
> 
> 
> Cosecant
> csc()
> 
> 
> Secant
> sec()
> 
> 
> Cotangent
> cot()
> 
> 
> 
>  
> 
> 
> 
> Function
> Type in...
> 
> 
> Inverse Sine
> arcsin()
> 
> 
> In...

Though, this extension of the sort function is not detailed.

---

<div class="post-metadata">

**Author:** ![Bryn](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/bryn/32/40_2.png) [@Bryn](https://cl.desmos.com/u/Bryn)\
**Post date:** [August 17, 2020, 10:44pm UTC](https://cl.desmos.com/t/randomized-list/1327/5 "2020-08-17T22:44:40Z")

</div>

Yes the details are what I want to see documented!

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [August 18, 2020, 8:13pm UTC](https://cl.desmos.com/t/randomized-list/1327/6 "2020-08-18T20:13:30Z")

</div>

Turns out I completely forgot about another list function:  
[https://www.desmos.com/calculator/auphl9qezw](https://www.desmos.com/calculator/auphl9qezw)

Much simpler, and as @aknauft pointed out to me, avoids the chance that two random numbers are the same.

---

<div class="post-metadata">

**Author:** ![Gail\_Anderson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/gail_anderson/32/373_2.png) [@Gail\_Anderson](https://cl.desmos.com/u/Gail_Anderson)\
**Post date:** [September 13, 2021, 1:18pm UTC](https://cl.desmos.com/t/randomized-list/1327/7 "2021-09-13T13:18:16Z")

</div>

Is there I way I could go from the Lordered here back to L? (ie, if I have a random list of numbers but I want to sort them lowest to highest?)

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [September 13, 2021, 4:31pm UTC](https://cl.desmos.com/t/randomized-list/1327/8 "2021-09-13T16:31:50Z")

</div>

Not sure I understand the question. If you’re responding to the post immediately before yours, each list is there to use in the graph. You can use L or L\_shuffle as you see fit. They don’t overwrite each other.

---

<div class="post-metadata">

**Author:** ![Gail\_Anderson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/gail_anderson/32/373_2.png) [@Gail\_Anderson](https://cl.desmos.com/u/Gail_Anderson)\
**Post date:** [September 13, 2021, 7:03pm UTC](https://cl.desmos.com/t/randomized-list/1327/9 "2021-09-13T19:03:43Z")

</div>

Thanks, Daniel - I figured it out; you actually can just do sort(L) to get a list in ascending order, which is what I was looking for. Perhaps that is new from the posts in this thread, which seemed to imply that you needed a 2nd term in the sort(L,?) syntax. Apparently that 2nd term is optional.

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [September 13, 2021, 8:26pm UTC](https://cl.desmos.com/t/randomized-list/1327/10 "2021-09-13T20:26:07Z")

</div>

There’s no second parameter for sort, but there can be for shuffle( ) or random( ). You can have a “seed” so when the second parameter changes a new list is generated. Easiest to use a variable for this situation.

Another function you may find use for in the future is unique( ), which basically eliminates any duplicates from a list.

---

<div class="post-metadata">

**Author:** ![JayChow](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/jaychow/32/1674_2.png) [@JayChow](https://cl.desmos.com/u/JayChow)\
**Post date:** [September 13, 2021, 8:42pm UTC](https://cl.desmos.com/t/randomized-list/1327/11 "2021-09-13T20:42:45Z")

</div>

You can actually sort one list according to another: [Untitled Graph](https://www.desmos.com/calculator/ayapdnojym)

But there’s also this other method: [Untitled Graph](https://www.desmos.com/calculator/cachkuyssp)

---

<div class="post-metadata">

**Author:** ![Nathan](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/nathan/32/3688_2.png) [@Nathan](https://cl.desmos.com/u/Nathan)\
**Post date:** [November 6, 2022, 1:08pm UTC](https://cl.desmos.com/t/randomized-list/1327/12 "2022-11-06T13:08:34Z")

</div>

I know I’m late to the game, I wanted to thank you for asking the question as I’m trying to do the same thing. I’m trying to make a card shuffler.

With the new advanced feature, clickable actions, you can create a clickable polygon that runs D\_0-\>shuffle(D\_0) which will reshuffle D\_0 from it’s latest shuffle.

My build looks more complicated than it is because the decimal points on the card values represent differences between 10, J, Q, K in the tenths place, Clubs, Diamonds, Hearts, Spades in the hundredths place, and Deck number in the thousandths place. The intention of coding the card type in the decimal is that I’ll later use round(D\_0[p\_0]) when calculating the value of a Blackjack hand.

> **[Shuffle n Decks on click](https://www.desmos.com/calculator/mycuo22x8j)**
>
> Shuffle n Decks on click

---

<div class="post-metadata">

**Author:** ![bhssingul](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/bhssingul/32/6761_2.png) [@bhssingul](https://cl.desmos.com/u/bhssingul)\
**Post date:** [March 8, 2025, 7:44pm UTC](https://cl.desmos.com/t/randomized-list/1327/13 "2025-03-08T19:44:55Z")

</div>

yall im new but is it posible to make platformer collisions
