Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 1.83 KB

README.md

File metadata and controls

61 lines (40 loc) · 1.83 KB

Tee-shirt song

Release

The code below (source) DOES work and it outputs the lyrics (as shown in the gif below).

Nothing is hardcoded.

#include "logic.hpp"

int main()
{
  /**
   * Guess the song... 😌 😎
   */

  imagine(!heaven) == "easy";
  us.below = !hell;
  us.above = sky;
  imagineAll("living for today");

  imagine(!countries) != "hard";
  (kill || die).reasons.length == 0;
  religion = undefined;
  imagineAll("living life in peace");

  chorus(); //🎵🎶

  imagine(!possessions) ? "😀" : "😥";
  need(greed || hunger) == false;
  men.reduce([]() { return "brothers"; });
  imagineAll("sharing all the world");

  chorus(); //🎵🎶
}

Demo of the executable

Run it

To run the program without compiling it, run the following:

bash <(curl -s https://drarig29.github.io/tee-shirt-song/run.sh)

If VLC is installed on your computer, the MIDI file embedded in the code will be played.

Note: On Linux, VLC requires the vlc-plugin-fluidsynth plugin to play MIDI files (more info).

Disclaimer

I made this translation from a song's lyrics into source code with JavaScript in mind. But to actually implement it, I had to use a lower level language to overload operators, so I chose C++.

Because I used C++, the only difference you'll see between the original source code and the C++ implementation will be the strings (with the use double quotes instead of single quotes) and the lambda function syntax.

Copyright

You can make your own tee-shirt with this "art", I own one personally. If you need the SVG file, just ask me.