Hello,
I just learned about CL and action on Desmos activity this week.
Currently, I’m trying to build an activity where the user can add an image or polygon by clicking a button (a clickable item on Graph).
Here’s the activity.
Can anyone help me with how the action should be that the button adding a new square instead of moving it?
Hello, I really like the activity so far!
Try changing just line 4 to:
The key change is the part that says ‘for i=[…]’. Here is a support article that explains more about how it works in the section called ‘List Comprehension.’ I hope this helps!
Instead of creating a new polygon each time, you could use the lists of polygons you made in your first graph, and just use the n+1 and n-1 actions to reference only part of the list:
I just googled color picker, and there’s a tool that pops up that lets you pick a color, and you can copy-paste the rgb numbers. Here’s an example of using a list of colors:
You’ll need enough elements in the color list to match your polygon list
join( ) is very handy. It literally joins 2 or more lists in the order entered. rgb( ) is the red green blue code. hsv( ) is hue, saturation, value which can allow for some gradients using lists for one of the first two parameters, but I haven’t messed with that.