Skip to content

Instantly share code, notes, and snippets.

@designbyadrian
Last active November 19, 2020 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save designbyadrian/2184eb9c9c679b7a753be9e583bce0f5 to your computer and use it in GitHub Desktop.
Save designbyadrian/2184eb9c9c679b7a753be9e583bce0f5 to your computer and use it in GitHub Desktop.
The well known tune transcribed into JavaScript, based on an image I found on the Internet. Please link me the source and author if you have it.
/**
* @author Freddie Mercury
* @copyright Sony/ATV Music Publishing LLC
*/
let BohemianRhapsody = function(){
// Is this the real life?
// Is this just fantasy?
try {
if(!this typeof RealLife || !this typeof Fantasy) {
throw LandslideException;
}
// Caught in a landslide
} catch(e) {
// No escape from reality
while(true) {
// Open your eyes
// Look up to the skies and see
you.eyes.forEach(eye => eye.open().look(
skies.map((sky)=>sky.location);
).see());
// I'm just a poor boy
me.wealth = 0;
me.sex = sex.male;
// I need no sympathy
me.sympathies = [];
// Because I'm easy come, easy go
// A little high, little low
if(
me.come.difficulty == 'easy' &&
me.go.difficulty == 'easy' &&
me.high < 0.1 &&
me.low < 0.1
) {
// Anyway the wind blows
switch(wind.direction) {
case 'north':
case 'east':
case 'south':
case 'west':
default:
// doesn't really matter to me
me.matter = false;
// to me
console.log(me);
piano.start().then(()=>{
let man = new Man();
// Mama, just killed a man
mama.notify({
target: man,
status: 410,
caller: me
});
// Put a gun against his head
me.push(new Gun(/*aim*/man.head));
// Pulled my trigger, now he's dead
me.gun.trigger();
console.log(man.dead); //true
// Mama, life had just begun
// But now I've gone and thrown it all away
let life = new Promise();
mama.notify({
life: life
});
life.reject();
// Mama, ooo
mama.notify(0).then(()=>{
// Didn't mean to make you cry
mama.crying = !me.intent;
});
let today = new Date();
let currentLocation = me.location;
setTimeout(()=>{
// If I'm not back again this time tomorrow
if(currentLocation != me.location) {
// Carry on
mama.carryOn();
// carry on, as if nothing really matters
mama.carryOn(everything.filter(()=>{return false}));
}
},today.getDate()+1);
piano.continue().then(()=>{
// Too late, my time has come
let time = new Date(∞);
me.time = time.now();
// Sends shivers down my spine
me.skeleton.spine.trigger(shivers);
me.body.map((part)=>{
part.ache = true;
part.timestamp = const;
});
// Goodbye everybody I've got to go
me.friends.forEach((friend) => {
friend.notify({
message: 'goodbye',
status: 404
// Gotta leave you all behind
}).position('behind');
});
// and face the truth
me.direction = true;
// Mama, ooo (anyway the wind blows)
mama.notify(0);
console.log(wind.direction);
// I don't want to die
mama.notify({
caller: me,
message: me.wishes.die = false
});
// I sometimes wish I'd never been born at all
mama.notify({
caller: me,
message: me.wishes.born = Math.random()>0.5?true:false
});
piano.continue().then(()=>{
// I see a little silhouetto of a man
me.look().view(man.silhouetto);
// Scaramouch, scaramouch will you do the fandango
for(let i=0;i<1;i++) {
alert("Scaramouch");
}
scaramouch.fandango();
// Thunderbolt and lightning very very frightening me
let frightening = [new Thunderbolt(), new Lightning()];
me.fright.source = frightening;
// Gallileo Figaro - magnifico
for(let i=0;i<4;i++) {
setTimeout(()=>{
alert('Gallileo');
},i);
}
setTimeout(()=>{alert('Gallileo Figaro')},i+1);
setTimeout(()=>{alert('Magnifico!')},i+1.5);
});
});
});
}
}
} // reality
}
};
BohemianRhapsody();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment