Push the block under the arrow (x=0) and make it stop there. Write a JavaScript function that calculates the horizontal force on the block necessary to achieve this.
Note: Your code for each level is saved in your browser.
Level Complete!
You solved the level in seconds.
Copy URL:
Select a level
You can predict the future of the system by calling simulate(dt, controlFunc) on the model state. Example:
// Simulates for 0.5 seconds. The input for the model is set to be the negative of its `x`.
newState = state.simulate(0.5, function(s){ return -s.x ;})
simulate() returns a modified copy of the model state.
The control function will be evaluated only once at the start of a simulate() call
and held constant during the simulation, so choose a small dt.
You can view your own variables by calling `monitor(name,value)`.
If you need to, you can use global variables.
You will have to declare them outside your function with the 'var' keyword.