Errors & Warnings
[Description]
Note: Your code for each level is saved in your browser.
You solved the level in seconds.
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.