WebFund 2014W Lecture 10: Difference between revisions

From Soma-notes
No edit summary
No edit summary
 
Line 1: Line 1:
The video from the lecture given on February 7, 2014 is available:
* [http://www.screencast.com/t/L6gPWyZ5pQO Small from screencast.com]
* [http://www.screencast.com/t/IT8cWnaecI Large from screencast.com]
* [http://dl.cuol.ca/capture/Anil.Somayaji/COMP_2406_2014W_Lecture_10_-_20140207_142741_27.mp4 Original from CUOL]
==Notes==


To play with puzzle.js, run "node" at the command line and then say
To play with puzzle.js, run "node" at the command line and then say

Latest revision as of 14:22, 8 February 2014

The video from the lecture given on February 7, 2014 is available:

Notes

To play with puzzle.js, run "node" at the command line and then say

puzzle = require("./puzzle.js");
q = puzzle.p;

assuming that puzzle.js is in the directory where you started node.


puzzle.js

y = "Yo";
var z = "ho ho";

var f = function(a) {
    var x = "hello ";
    var s = {};
 
    s.g = function(b) {
	return x + b + ", " + a;
    }
 
    s.h = function(c) {
	return a = c;
    }
 
    s.j = function(x) {
	return eval(x);
    }
 
    return s;
}
 
var p = f("do I know you?");
 
exports.p = p;