From 72c43ac66494454fc5cdd127ada7721abbd0c0e2 Mon Sep 17 00:00:00 2001 From: Manu Raghavan Date: Wed, 11 Jan 2012 13:37:15 -0500 Subject: [PATCH] hooks for magical (move) method --- lesson.html | 6 +++++- lisp.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lesson.html b/lesson.html index 098d95f..1fc06e4 100644 --- a/lesson.html +++ b/lesson.html @@ -119,6 +119,7 @@ var handler = function(command) { if (command) { try { + // if(command[0] = '(') jqconsole.Write('==> ' + interpret(command) + '\n'); } catch (e) { jqconsole.Write('ERROR: ' + e.message + '\n'); @@ -158,7 +159,7 @@ } void draw() { - background(226); + background(24); image( a, 0, 0 ); // output = interpret($('#program').val()); @@ -192,6 +193,9 @@ if (target_y < 0) target_y += height; + if(typeof(move) != 'undefined') { + interpret('(move)'); + } ellipse(target_x, target_y, 10, 10); x = target_x; y = target_y; diff --git a/lisp.js b/lisp.js index 5463b3a..607c6c8 100644 --- a/lisp.js +++ b/lisp.js @@ -218,7 +218,7 @@ this["and"] = function() return cond; }; - +this["if"] = this["cond"]; this["or"] = function() { var ret = NIL;