Random Number Generator in a Note

Hello!

I’m new to the Desmos CL forum so apologies in advance if this question doesn’t fit this forum. I tried looking for similar questions but didn’t see one that fits exactly what I’m looking for.

I basically want to generate a new problem for each student by using the random integer generator in a note. I want the question to be the same for each student, but I have two values in the note I want to change. It seems to me I should be able to have students click a button that will change the numbers in the note, but I’m not sure how exactly to implement this. I can create random integers on a graph, but if I don’t have a graph component on my slide is it still possible to just generate random integers into my note?

Thanks for the help! :slight_smile:

Actually, I’m pretty sure random numbers in a graph just get calculated once for the graph itself, so students actually still get the same values. CL will give students random values.

seed=buttonName.pressCount
r=randomGenerator(seed)
n=r.int(5,25)

n is a randomly generated number between 5 and 25. The first line uses the pressCount to seed the generator, so it will change values each time the button is pressed.

Hi…

I want an activity to generate a random # for my students that is assigned to a specific shape I will add later. I just want the students to hit a button and get a number. I created a slide with a button and note component with the code above…but nothing happens. Can you tell me what I am missing?

Thanks in Advance

You haven’t “told” the note to display anything. The variable, n, just exists in the code.

If you push the {#} at the bottom right, then select n. The number will display (and change) each time you press the action button.

Thank You! This forum is a life saver for this beginning CL Learner

You can put other text around that, FYI. It doesn’t need to just be that variable. Just to clarify.