# Merging button click count

**URL:** https://cl.desmos.com/t/merging-button-click-count/1654
**Category:** Questions
**Created:** [October 7, 2020, 9:52pm UTC](https://cl.desmos.com/t/merging-button-click-count/1654 "2020-10-07T21:52:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Samuel\_Williams](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/samuel_williams/32/996_2.png) [@Samuel\_Williams](https://cl.desmos.com/u/Samuel_Williams)
#### Post date: [October 7, 2020, 9:52pm UTC](https://cl.desmos.com/t/merging-button-click-count/1654/1 "2020-10-07T21:52:11Z")

</div>

Making an activity where student clicks on “Right Face” to make a -90 degree turn. “Left Face” to make a 90 degree turn.

Goal is to use the tool to confirm student hypothesis on some long chain command: RF, RF, RF, LF, LF = -90º final position.

I’ve used the modulus to break it down into eight possible position states. Next step seems to be creating a variable that subtracts “Left Face” click count from “Right Face” click count, winnowing it down to four position states.

Is this possible?

> **[ROTC Angles • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/5f7e29f65d45e3328dc4d953)**
>
> by Sam Williams

---

<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: [October 7, 2020, 10:02pm UTC](https://cl.desmos.com/t/merging-button-click-count/1654/2 "2020-10-07T22:02:56Z")

</div>

You could just use the pressCount for each.

```auto
RF=RFbutton.pressCount
LF=LFbutton.pressCount
final = numericValue("\mod(${RF}-${LF},4)")

```

---

<div class="post-metadata">

### Author: ![Samuel\_Williams](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/samuel_williams/32/996_2.png) [@Samuel\_Williams](https://cl.desmos.com/u/Samuel_Williams)
#### Post date: [October 7, 2020, 11:34pm UTC](https://cl.desmos.com/t/merging-button-click-count/1654/3 "2020-10-07T23:34:18Z")

</div>

Thanks! I hacked it by pushing the values into the graphing calculator where I’m a little more comfortable.

The final line is helpful, though, as I’m forcing myself to get more comfortable with the CL code.

---

<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: [October 8, 2020, 1:53am UTC](https://cl.desmos.com/t/merging-button-click-count/1654/4 "2020-10-08T01:53:11Z")

</div>

> [@Samuel\_Williams](#):
>
> Thanks! I hacked it by pushing the values into the graphing calculator where I’m a little more comfortable.

It’s frequently more convenient to do calculations in a graph than in CL. Generating random numbers works more easily in CL than in graphs, but other than that…
