# Activate Randomize on Button Press

**URL:** <https://cl.desmos.com/t/activate-randomize-on-button-press/5350>\
**Category:** Questions\
**Created:** [February 10, 2024, 5:08pm UTC](https://cl.desmos.com/t/activate-randomize-on-button-press/5350 "2024-02-10T17:08:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ProfessorPi](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/professorpi/32/4793_2.png) [@ProfessorPi](https://cl.desmos.com/u/ProfessorPi)\
**Post date:** [February 10, 2024, 5:08pm UTC](https://cl.desmos.com/t/activate-randomize-on-button-press/5350/1 "2024-02-10T17:08:47Z")

</div>

I am using random() in my graph component. Everything works as intended when I click the “randomize” button while working on the graph. However, I’d like my students to be able to click the action button to activate this “randomize” so that it generates new seeds within the graph component. Any assistance with this will be much appreciated.

> **[\[Copy of\] Right Triangle Trigonometry • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/65c6f4e0f7af5d51a7a24664)**
>
> by Professor Pi

---

<div class="post-metadata">

**Author:** ![Daniel\_Wekselgreene](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_wekselgreene/32/1819_2.png) [@Daniel\_Wekselgreene](https://cl.desmos.com/u/Daniel_Wekselgreene)\
**Post date:** [February 10, 2024, 5:52pm UTC](https://cl.desmos.com/t/activate-randomize-on-button-press/5350/2 "2024-02-10T17:52:16Z")

</div>

You use a seed for the random generator that is the presscount of the button. So when the button is pressed, the changing seed value re-rolls the random number.

Here are a set of repeated practice triangle screens if you want to see some ways I’ve used it. [Right Triangle Repeated Practice Screens (Trigonometry and Pythagorean Theorem) • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/6373e17b46c24efc1cc0384b)

---

<div class="post-metadata">

**Author:** ![ProfessorPi](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/professorpi/32/4793_2.png) [@ProfessorPi](https://cl.desmos.com/u/ProfessorPi)\
**Post date:** [February 10, 2024, 6:51pm UTC](https://cl.desmos.com/t/activate-randomize-on-button-press/5350/3 "2024-02-10T18:51:30Z")

</div>

Yep!! Thanks so much!!
