Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
20
Task/Active-object/JavaScript/active-object-2.js
Normal file
20
Task/Active-object/JavaScript/active-object-2.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<p><span id="a">Test running...</span> <code id="b">-</code></p>
|
||||
|
||||
<script type="text/javascript">
|
||||
var f = 0.5;
|
||||
|
||||
var i = new Integrator(1);
|
||||
var displayer = setInterval(function () { document.getElementById("b").firstChild.data = i.output() }, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
i.input(function (t) { return Math.sin(2*Math.PI*f*t) }); // test step 1
|
||||
setTimeout(function () { // test step 2
|
||||
i.input(function (t) { return 0 }); // test step 3
|
||||
setTimeout(function () { // test step 3
|
||||
i.shutdown();
|
||||
clearInterval(displayer);
|
||||
document.getElementById("a").firstChild.data = "Done, should be about 0: "
|
||||
}, 500);
|
||||
}, 2000);
|
||||
}, 1)
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue