Use sketch as matching game

Just starting with CL and have no idea how to pull a single number from a numberList. I have a graph of 2 boxes and want student to connect the 2 with a sketch. I assumed I would compare the y-values at a given x and see if they fall within the box.

Welcome Norman,

You started off with a hard question. Are you saying that you want students to draw a line to connect two boxes in a Sketch component? That might get very tricky to check because of how crooked the lines might be. If so, you might be better off using a card sort or a graph with draggable points (something like Desmos | Graphing Calculator).

Here’s an activity that checks whether students have traced a figure that might give you some ideas about how to extract the values from a sketch component. Challenge 17: Untraceable • Activity Builder by Desmos
I can give more specific details if you would like, but I’ll wait to see if I am even understanding what you are after first.

Again, I’m just learning so as a practice I made 2 polygons (squares) and then have students draw a sketch connecting them. I was hoping to pull y values at specific x’s and compare them to the y values of my squares.

I still have concerns that students might not draw their lines all the way to your boxes, which would make checking difficult.

You can pass a list L of y-values from a sketch S to a graph (where the checking will take place) at x=0.1 using the code numberList("L"): sketchYValues(S.sketch, 0.1). You could then check to see if a value in L is close to 7 using an inequality involving min(|7-L|)

Here is an activity that does something similar. It displays the x-values of each point that is half-way up the sketch (just as an illustration).Sketch check • Activity Builder by Desmos

Might you not be better off using a graph and having them drag points connected by lines to the correct place. Then you can set the step value to ensure things click nicely into place.

Somewhat like I’ve done differently in screen 4 of this:

It doesn’t check for correctness, but it easily could. The reason I don’t is because there is significant discussion about what is the best answer in a couple of cases.