Created
March 28, 2012 12:36
Revisions
-
leecrossley revised this gist
Mar 28, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ var panda = (function () { var panda = {}, bambooLevel = 0, isAsleep = false; function wakeUp() { isAsleep = false; -
leecrossley created this gist
Mar 28, 2012 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ var panda = (function () { var panda, bambooLevel = 0, isAsleep = false; function wakeUp() { isAsleep = false; } panda.eatBamboo = function () { bambooLevel = bambooLevel + 1; }; panda.goToSleep = function () { isAsleep = true; setTimeout(wakeUp, 1000); }; return panda; })(); panda.eatBamboo(); panda.goToSleep();