WebFund 2014W Lecture 10: Difference between revisions

From Soma-notes
Created page with " ===puzzle.js=== <source line lang="javascript"> y = "Yo"; var f = function(a) { var x = "hello "; var s = {}; s.g = function(b) { return x + b + ", " + a; ..."
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
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
puzzle = require("./puzzle.js");
q = puzzle.p;
assuming that puzzle.js is in the directory where you started node.




Line 4: Line 18:
<source line lang="javascript">
<source line lang="javascript">
y = "Yo";
y = "Yo";
var z = "ho ho";
 
var f = function(a) {
var f = function(a) {
     var x = "hello ";
     var x = "hello ";

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;