Last active
August 29, 2015 14:08
-
-
Save erichosick/d036582d9b9b28a11e01 to your computer and use it in GitHub Desktop.
Gist of stuff done in youtube video here: http://youtu.be/3gSiYtBEMjY
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
First Setup (command Line): | |
mkdir mech | |
cd mech | |
npm install mech-core | |
npm install mech-scope-cell | |
npm install mech-math | |
npm install mech-emit | |
node | |
Within node: | |
var m = require('./node_modules/mech-core/dist/mech-core'); | |
var sp = require('./node_modules/mech-scope-cell/dist/mech-scope-cell'); | |
var math = require('./node_modules/mech-math/dist/mech-math'); | |
var emit = require('./node_modules/mech-emit/dist/mech-emit'); | |
// define two cells | |
sp.cell("A:1", 45); // Cell A:1 contains 45 | |
sp.cell("A:2", 23); // Cell A:2 contains 23 | |
sp.cellGet("A:2").go; // Just return 23 | |
sp.cell("A:3", math.add(sp.cellGet("A:1"), sp.cellGet("A:2"))); // Define an add in cell A:3 | |
sp.cellGet("A:3").go; // Run A:3 as numberic | |
sp.cellGet("A:3").goStr; // Run A:3 as a string | |
sp.cellSet("A:1",2).go; // Set cell A:1 to 2 | |
sp.cellGet("A:3").goStr; // It's reactive. Notice Add is now 2 + 23 | |
sp.cellWorkBook; // Yep! That is the entire program | |
sp.cell("A:5", emit.emitFromRange(1,2000,2,true)); // Define an emitter in cell A:5 | |
sp.cellWorkBook["A:5"].go; // Run multiple times to see the cell emit. | |
sp.cell("A:7", math.add(sp.cellGet("A:5"), sp.cellGet("A:3"))); // Yep! | |
sp.cellGet("A:7").goStr; // Run multiple times to see it emit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment