aboutsummaryrefslogtreecommitdiffstats
path: root/2016/tangle_demo.txt
blob: 463abe11d9315b43b3ca03b37aba17a9ff43dbe7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31


/experiments/%model/tangle.html
/experiments/%model/tangle-model.js

<script type="text/javascript" src="Tangle.js"></script>

this part in body's onLoad; after live script has downloaded.
var table = new Tangle (document.getElementById("MODELNAME"), {
    initialize: function () {
        this.CONSTANT = INIT;
        this.IN_VAR = INIT;
    },
    update: function () {
        var vals = model();
        this.OUT_VAR = vals[0];
        this.OUT_VAR = vals[1];
        [...]
    },
});

<p id="MODELNAME">
<!-- TODO: some built-in js that checks if in/out vars are the same, and
     alerts if not? -->
<!-- EDIT ME: this part is template -->
When the parameters are <span data-var="VARSLUG"> for VARSLUG</span>, [...],
    and the variables are <span data-var="cookies" class="TKAdjustableNumber">
    for VAR</span>, then you get <span data-var=OUTVAR> for OUTVAR</span>
<!-- END EDIT ME -->