{"id":2550,"date":"2013-08-13T03:31:30","date_gmt":"2013-08-13T03:31:30","guid":{"rendered":"http:\/\/www.mrericsir.com\/blog\/?p=2550"},"modified":"2023-07-13T16:56:37","modified_gmt":"2023-07-13T16:56:37","slug":"song-lyrics-in-c","status":"publish","type":"post","link":"https:\/\/www.mrericsir.com\/blog\/technology\/song-lyrics-in-c\/","title":{"rendered":"Song lyrics in C++"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The other day while hacking away on some C++ code and listening to music, something occurred to me: if I&#8217;m programming in C++, shouldn&#8217;t the music I&#8217;m listening to be in the same language?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So I took a few verses from various random songs and coded up C++ translations of the lyrics. Here&#8217;s what I was able to hack together.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;<br><strong>2Pac &#8211; Dear Mama<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">English:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">When I was young me and my mama had beef<br>Seventeen years old kicked out on the streets<br>Though back at the time, I never thought I&#8217;d see her face<br>Ain&#8217;t a woman alive that could take my mama&#8217;s place<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">C++:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ When I was young me and my mama had beef\nif (this-&gt;young()) {\n    this-&gt;append(new Beef());\n    mama.append(new Beef());\n}\n\n\/\/ Seventeen years old kicked out on the streets\n\/\/ Though back at the time, I never thought I'd see her face\nif (this-&gt;getAge() == 17) {\n    this-&gt;remove(getShelter());\n    this-&gt;seeFace(false);\n}\n\n\/\/ Ain't a woman alive that could take my mama's place\nmama.replacement = NULL;<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;<br>&nbsp;<br><strong>The Beatles &#8211; Hey Jude<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">English:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Hey Jude, don&#8217;t make it bad<br>Take a sad song and make it better<br>Remember to let her into your heart<br>Then you can start to make it better<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">C++:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ Hey Jude, don't make it bad\njude.it-&gt;make(!JudeState::BAD);\n\n\/\/ Take a sad song and make it better\nsadSong.improve();\n\n\/\/ Remember to let her into your heart\njude.setReminder(new Event(JudeState::ENTER, jude.getHeart()));\n\n\/\/ Then you can start to make it better\njude.it-&gt;make(JudeState::BETTER);<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;<br>&nbsp;<br><strong>David Bowie &#8211; Man Who Sold The World<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">English:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Oh no, not me<br>I never lost control<br>You&#8217;re face to face<br>With The Man Who Sold The World<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">C++:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ Oh no, not me\n\/\/ I never lost control\nassert(this-&gt;control != NULL);\n\n\/\/ You're face to face\n\/\/ With The Man Who Sold The World\nMan m;\nm.sell(world);\nyou-&gt;setFacing(&amp;m);\nm.setFacing(you);<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;<br>&nbsp;<br><strong>Lady Gaga &#8211; Born This Way<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">English:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Don&#8217;t hide yourself in regret<br>Just love yourself and you&#8217;re set<br>I&#8217;m on the right track, baby<br>I was born this way<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">C++:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ Don't hide yourself in regret\nif (!you-&gt;visible &amp;&amp; you-&gt;regret)\n    you-&gt;visible = true;\n\n\/\/ Just love yourself and you're set\nyou-&gt;love(you);\n\n\/\/ I'm on the right track, baby\ngetTrack(Track::RIGHT)-&gt;set(this);\n\n\/\/ I was born this way\nassert(this-&gt;state == this-&gt;creationState);<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;<br>&nbsp;<br><strong>The Police &#8211; Every Breath You Take<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">English:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Every breath you take<br>Every move you make<br>Every bond you break<br>I&#8217;ll be watching you<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">C++:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">while(true) {\n    switch(you-&gt;getEvent()) {\n\n    \/\/ Every breath you take\n    case BREATH:\n\n    \/\/ Every move you make\n    case MOVE:\n\n    \/\/ Every bond you break\n    case BOND_BREAK:\n\n    \/\/ Every step you take\n    case STEP:\n\n        \/\/ I'll be watching you\n        this-&gt;watch(you);\n        break;\n\n    default:\n        assert(false);\n    }\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;<br>&nbsp;<br><strong>Kanye West &#8211; Power<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">English:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">No one man should have all that power<br>The clocks tickin&#8217; I just count the hours<br>Stop trippin&#8217; I&#8217;m tripping off the power<br>Till then, fuck that the world&#8217;s ours<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">C++:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ No one man should have all that power\nfor(int i = 0; i &lt; men.size(); i++) {\n    Man* man = men.get(i);\n    if (man-&gt;has(allThatPower))\n        man-&gt;remove(allThatPower);\n}\n\n\/\/ The clocks tickin' I just count the hours\nsetTimer(1, &amp;countHours);\n\n\/\/ Stop trippin' I'm tripping off the power\nyou-&gt;tripping = false;\nbool power = true;\nthis-&gt;tripping = power;\n\n\/\/ Till then, fuck that the world's ours\nif (getCurrentTime() != then) {\n    that-&gt;fuck();\n    world.setOwner(this);\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The other day while hacking away on some C++ code and listening to music, something occurred to me: if I&#8217;m programming in C++, shouldn&#8217;t the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","slim_seo":{"title":"Song lyrics in C++ - MrEricSir.com","description":"The other day while hacking away on some C++ code and listening to music, something occurred to me: if I'm programming in C++, shouldn't the music I'm listening"},"autoblue_enabled":true,"autoblue_custom_message":"","autoblue_shares":[],"autoblue_post_url":"","autoblue_publish_document":false,"footnotes":""},"categories":[3],"tags":[40,1423],"class_list":["post-2550","post","type-post","status-publish","format-standard","hentry","category-technology","tag-c","tag-music"],"_links":{"self":[{"href":"https:\/\/www.mrericsir.com\/blog\/wp-json\/wp\/v2\/posts\/2550","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrericsir.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mrericsir.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrericsir.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrericsir.com\/blog\/wp-json\/wp\/v2\/comments?post=2550"}],"version-history":[{"count":24,"href":"https:\/\/www.mrericsir.com\/blog\/wp-json\/wp\/v2\/posts\/2550\/revisions"}],"predecessor-version":[{"id":10112,"href":"https:\/\/www.mrericsir.com\/blog\/wp-json\/wp\/v2\/posts\/2550\/revisions\/10112"}],"wp:attachment":[{"href":"https:\/\/www.mrericsir.com\/blog\/wp-json\/wp\/v2\/media?parent=2550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mrericsir.com\/blog\/wp-json\/wp\/v2\/categories?post=2550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mrericsir.com\/blog\/wp-json\/wp\/v2\/tags?post=2550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}