/*
* Fabrizio Calderan, twitter @fcalderan, 2010.11.02
* I had an idea: could Inception movie be explained by a few javascript closures
* and variable resolution scope (just for fun)?
*
* Activate javascript console =)
*/
console.group("inception movie");
var inception = (function() {
/* on flight: arianna's dream */
var timerate = 1;
var team = ["Yusuf", "Arthur", "Eames", "Saito", "Arianna", "Dominic", "Mr.Fischer"];
console.log("Real world", team);
console.log("Time Rate is ", timerate);
console.log("1 second is %d second (what else?)", 1/timerate);
(function(timerate) {
/* Yusuf escape */
console.group("1th level: arianna's dream");
var kick = "fall in the water";
console.log("1th level team", team);
console.log("Time Rate is ", timerate);
console.log("1 second is %d second, about %d minutes", 1/timerate, 1/timerate/60);
(function(team, timerate) {
/* Arthur hotel escape */
console.group("2nd level: Hotel escape");
var kick = "elevator wreck";
console.log("2nd level team", team);
console.log("Time Rate is ", timerate);
console.log("1 second is %d second, about %d minutes", 1/timerate, 1/timerate/60);
(function(team, timerate) {
/* Mountain */
console.group("3rd level: Mountain's fortress");
var kick = "fortress destruction";
console.log("3rd level team", team);
console.log("Time Rate is ", timerate);
console.log("1 second is %d second, about %d minutes", 1/timerate, 1/timerate/60);
(function(team, timerate) {
console.group("4th level: the Limbo");
/* Limbo */
var kick = "skyscrapes collapse";
...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.