I'm trying to get my head around that example on screen 16:
It's easy enough to get it to automatically graph whatever rule the student types in, but I wonder:
How could I get it to only graph once the submit button is pressed? It doesn't seem to fit the When-otherwise scenario. Taking Jay's advice on writing it out in english first: When input2 is submitted then inject input2 into the graph otherwise do nothing. For the do nothing - just make the otherwise part "Type in the equation of the line that goes through these points." I tried typing "when" and seeing what the error code told me. It said it was expecting otherwise, but then when I put that in it said it wasn't expecting that...
Went back to trying exactly what Jay was doing with the T variable, and I got it to work. Unpacking the whole variable idea again. We needed T in the graph so that as it increased in value (which is done by moving the T slider to the right), the domain of the function f being graphed got wider, so the curve appears slowly from left to right. Clear, very clear. And we needed to connect that T value with the CL by calling a variable by the same name, so that however much that variable T is in the CL, that's how much T in the graph is. So in effect, changing the value of the variable T is equivalent to moving the T slider. And if we want to increase the value of the T variable in the CL, we make it equal to the number of seconds since the submit button was pressed. Got it.
Tracing the path of T - it starts having a value on submit, which gets sent to the graph, then overrides the value of T on the slider.
Jay says: "The basic structure of CL is we create something (the sink) FROM something (the source)." This is a good way to think of it.
Screen 20: Noticing something that has happened before. I am certain I've typed exactly what Jay typed but I'm getting these brackets (I've highlighted in grey) immediately after the timeSincePress
It doesn't seem to be a problem though, and the error was due to me mistyping timeSincePressed - shouldn't have had the -ed at the end.
I tried to make the second "when" include the current coordinates but it didn't work. Sigh.
Back to Jocelyn's collection. I'm going through it again from the beginning, one by one, to see if I can recreate them.
On example 2, the correct script was simpleFunction(table1.cellContent(1,2),"x") which also works without the x at the end. But I don't get why we don't have to put .latex anywhere like we did for example 1. The only difference between this one and example 1 was that there are 3 functions to type instead of 1, so we're using a table this time.
Maybe it IS better if I just drag and drop other peoples' stuff....
Post a Comment