Divine Programming 101: EndOfUniverse()

Deleting everything makes it better!!
Deleting everything makes it better!!
/*
I've been toying with the idea of cataclysmic annihilation for some time now, but never got around to completing it. Something always got in the way - famines, floods, planting dinosaur bones around the place - and I was only able to make the most modest of adjustments. 

So much for spare time! 

But I'm finally proud to announce the release of a beta candidate. After several thousands of years, we're ready to test Armageddon, people! 

The code probably needs a tidy up here and there, but then so does the Universe. Ha ha!

I considered pair-programming with Allah, but he's a terrible coder, and would have probably just copied and pasted some awful snippet straight from Stack Overflow.

(Note to the wise: running this code will only affect your current reality. This system doesn't yet support parallel universe programming, if you believe in that sort of thing anyway.)

Thanks to everyone who believed in me, and kept rooting for the final destruction of time, space and all matter, dark or otherwise.

Yours in theoretical eternity,
God.

*/
/**
 * @description: This class, when instantiated, 
 * will trigger the end of the known Universe.
 * @version: 1.0.0
 * @author God
 */

class EndOfUniverse extends BeginningOfUniverse{
 
    constructor(super) {
       
        // first pause the
        // ongoing universe
        super.pause();
       
       // assign the current universe
       // to this instance
       this.universe = super.universe;

       // let's save the 
       // date so we know
       // exactly when
       // Armageddon took place.
       this.endTime = new Date();

       this.forgiveAllSins();
       this.startTheRapture();
       this.bigReverseBang();
    }

    forgiveAllSins() {
       console.warn('Hi! You are all forgiven!');
    }

    startTheRapture() {
       this.universe.filter(atom => {
          // filter out Christians from 
          // the universe
          // before destroying it.
          // Sorry in advance to all
          // other faiths, but
          // after the Jesus() update
          // there was no going back!
          return atom.contains('Christian') === false;
        }); 
    }

    bigReverseBang() {
       // this is the method
       // that basically
       // reduces everything to
       // nothing
       this.universe = this.universe.reduce(
          (reducedUniverse, atom) => {
              if (atom === undefined) {
                  return atom;
              }
          }, 
       []);
    }

    reset() {
        // Sorry, I haven't found a way 
        // to build a reset function
        // that doesn't take 14 billion years
        // of CPU time, let alone seven days! :)
    } 
} 

Leave a Reply