Memento

<?php
    //Set up the base vars
    $sceneCount=23;
    $currentScene=1;
    $brainBlownCounter=0;
   
   
    //Assemble the scenes
    while($currentScene <= $sceneCount)
    {
        $scenes[] = 'Scene '.$currentScene;
        $currentScene++;
    }
   
    //Make this film special
    array_reverse($scenes);
   
    //Play
    $sceneCounter =0;
    foreach ($scenes as $somethingThatHappened)
    {
        $sceneCounter++;
   
        $leonardsMemory = $somethingThatHappened;
   
        echo 'We see '.$somethingThatHappened.'<br />';
        echo 'Your brain is now '.(($sceneCounter / count($scenes) * 100)).'% blown.<br /><br />';
   
        $leonardsMemory=NULL;
    }
   
   
    //TODO: Remember Stanley Ipkiss
?>
Vote up this code1
  • Anonymous

    This is awesome.

  • Thatbennyguy

    From what I understand from the movie and the code, isn’t this incorrect? Instead of the movie scenes being in reverse order, doesn’t the movie alternate between first and last scenes, in something of the order: 1-10-2-9-3-8-4-7-5-6? (assuming there are 10 scenes). Otherwise, pretty sweet idea.