Sunday, August 01, 2010

Inception via recursion.

If you had no clue what the movie was all about, below is a simplified complicated explanation in Java that you probably will have no clue about unless you are an engineer and a geek !


public static void main(String[] args) {
int initialDreamLength = 300; // 5 minutes
boolean success = Inception(teamSize, initialDreamLength);
}

public boolean Inception(int noOfPeopleLeft, int timeLeft){
timeLeft = timeLeft * 12 ;
while(timeLeft > 0){
if(ideaImplanted)
return true;

if(subjectRealizesHeIsInADream)
return false;

if(noOfPeopleLeft <= 1)
return false;

if(personDies)
noOfPeopleLeft--;

if(sharingADream)
return Inception(noOfPeopleLeft - 1, timeLeft);

timeLeft--;
}
// Time's up !
return false;
}

Friday, April 30, 2010

Crash

Still reeling from shock after seeing a guy on a motorbike nearly crash to his death. Lucky he survived the crash. His sports bike was in tatters, but the important thing is that he is okay. He smelt of weed. I've hardly driven a bike before and after seeing today's accident, I don't regret it too much. The risk is too much for the speed-thrill.