What I want to occur is to create two points whose locations are randomly generated along the x-axis. One point (A) will stay within -7 and 7. I want the other point (B) to have a minimum value of -8 and a max value set by the location of the first point so that its always to the left of A.
So, maybe we can take this a step further: I am working on an activity for segment addition. So, A and C need to be at the end and B in the middle. This is what I start with:
This is what I tried and it did not work:
a=r.int(-7,7)
b=r.int(-8,a-1)
c=r.int(a+1,7)
number(a):a
number(b):b
number(c):c
I am fairly certain there is something I need to do but I cannot figure out what. By the way, this is my first week learning CL language so I thank you for your assistance.
That works amazingly! Thank you. Is there somewhere in the CL documentation that talks about the use of ${ } that I could read more on? The last couple questions I have had have been answered with this notation.
Not sure. Use it to call variables into strings, otherwise it will just put the text in. Generally, I think if the variable’s output doesn’t match the input needed, you need to use ${ }.
For example, in the above, numericValue takes a string (indicated by the quotes), but “a” is a number, so you need to use ${ }. Without it, it would be undefined because “a” is just text. It doesn’t know where to look for the variable without the ${ }.