# Randomly pick one variable

**URL:** <https://discourse.processing.org/t/randomly-pick-one-variable/21304>\
**Category:** Beginners\
**Created:** [May 26, 2020, 4:58am UTC](https://discourse.processing.org/t/randomly-pick-one-variable/21304 "2020-05-26T04:58:05Z")\
**Posts on this page:** 1\
**Showing post:** 12

<div class="post-metadata">

**Author:** ![Adi](https://avatars.discourse-cdn.com/v4/letter/a/4da419/32.png) [@Adi](https://discourse.processing.org/u/Adi)\
**Post date:** [May 27, 2020, 11:21pm UTC](https://discourse.processing.org/t/randomly-pick-one-variable/21304/12 "2020-05-27T23:21:53Z")

</div>

I am trying to the heads or tails method. I understand the first method and the last one, but I don’t get this:

> [@jeremydouglass](#):
>
> …or `(int)random(2)` : 0 1 0 0 1 1 1 0 1 0 1 1 0 0 …  
> `2 * round(random(1))` : 0 2 0 0 2 2 2 0 2 0 2 2 0 0 …  
> `2 * round(random(1)) - 1` : -1 1 -1 -1 1 1 1 -1 1 -1 1 1 -1 -1

Can you please explain it for me?

---

_[View the full topic](https://discourse.processing.org/t/randomly-pick-one-variable/21304)._
