# Question
Title: Sing Happy Birthday to your favourite programming language
Your favourite programming language has just had a birthday. Be nice and sing it the **Happy Birthday** song.

Of course you should accomplish this by writing a program in that language. The program takes no input, and writes the following text to the standard output or an arbitrary file:

```
Happy Birthday to You
Happy Birthday to You
Happy Birthday Dear [your favourite programming language]
Happy Birthday to You

```

You should substitute the bracketed part (and omit the brackets).

This is a code golf — shortest code wins.

## UPDATE

I'm glad that the question aroused great interest. Let me add some extra info about scoring. As stated originally, this question is a code golf, so the shortest code is going to win. The winner will be picked at the end of this week (19th October).

However, I'm also rewarding other witty submissions with up-votes (and I encourage everybody to do so as well). Therefore although this is a code-golf contest, not-so-short answers are also welcome.

## Results

Congratulations to Optimizer, the winner of this contest with his 42 byte long, CJam submission.

## Leaderboard

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

```
/* Configuration */

var QUESTION_ID = 39752; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 48934; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

function answersUrl(index) {
  return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });
}

getAnswers();

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

var OVERRIDE_REG = /^Override\s*header:\s*/i;

function getAuthorName(a) {
  return a.owner.display_name;
}

function process() {
  var valid = [];

  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      if(OVERRIDE_REG.test(c.body))
        body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>';
    });

    var match = body.match(SCORE_REG);
    if (match)
      valid.push({
        user: getAuthorName(a),
        size: +match[2],
        language: match[1],
        link: a.share_link,
      });

  });

  valid.sort(function (a, b) {
    var aB = a.size,
        bB = b.size;
    return aB - bB
  });

  var languages = {};
  var place = 1;
  var lastSize = null;
  var lastPlace = 1;
  valid.forEach(function (a) {
    if (a.size != lastSize)
      lastPlace = place;
    lastSize = a.size;
    ++place;

    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    var lang = a.language;
    if (/<a/.test(lang)) lang = jQuery(lang).text();

    languages[lang] = languages[lang] || {lang: a.language, user: a.user, size: a.size, link: a.link};
  });

  var langs = [];
  for (var lang in languages)
    if (languages.hasOwnProperty(lang))
      langs.push(languages[lang]);

  langs.sort(function (a, b) {
    if (a.lang > b.lang) return 1;
    if (a.lang < b.lang) return -1;
    return 0;
  });

  for (var i = 0; i < langs.length; ++i)
  {
    var language = jQuery("#language-template").html();
    var lang = langs[i];
    language = language.replace("{{LANGUAGE}}", lang.lang)
                       .replace("{{NAME}}", lang.user)
                       .replace("{{SIZE}}", lang.size)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
```

```
body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

#language-list {
  padding: 10px;
  width: 290px;
  float: left;
}

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}
```

```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">
<div id="answer-list">
  <h2>Leaderboard</h2>
  <table class="answer-list">
    <thead>
      <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr>
    </thead>
    <tbody id="answers">

    </tbody>
  </table>
</div>
<div id="language-list">
  <h2>Winners by Language</h2>
  <table class="language-list">
    <thead>
      <tr><td>Language</td><td>User</td><td>Score</td></tr>
    </thead>
    <tbody id="languages">

    </tbody>
  </table>
</div>
<table style="display: none">
  <tbody id="answer-template">
    <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
  </tbody>
</table>
<table style="display: none">
  <tbody id="language-template">
    <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
  </tbody>
</table>
```

# Answer
> 49 votes
## CJam, ~~46~~ 42 bytes

```
"Happy Birthday to You
"___F<"Dear CJam
"@

```

**How it works:**

```
"Happy Birthday to You
"___                          "Push "Happy Birthday to You\n" string to stack 4 times";
    F<                        "From the last string, take only first 15 characters. F is a";
      "Dear CJam              "preinitialized variable whose value is 15";
"                             "Push "Dear CJam\n" to stack";
 @                            "Take the third string from end and put it to end";

```

This leaves the stack as following at the end of the code:

```
["Happy Birthday to You
" "Happy Birthday to You
" "Happy Birthday " "Dear CJam
" "Happy Birthday to You
"]

```

which are printed automatically to output as

```
Happy Birthday to You
Happy Birthday to You
Happy Birthday Dear CJam
Happy Birthday to You

```

Try it here (Copy the code and run it)

# Answer
> 121 votes
# LOLCODE: 109 (105 with "correct" spelling)

LOLCODE is not a great language for golfing, especially since you lose all the beauty and expressiveness when shortening the code.

```
HAI
H R "HAPPY BIRTHDAY "
T R SMOOSH H "TO YOU"
VISIBLE T
VISIBLE T
VISIBLE SMOOSH H "DEAR LOLCODE"
VISIBLE T

```

Test it using loljs

This is my preferred rendition, weighing in at 187 characters (spaces added for clarity):

```
HAI
H R "HAPPY BERFDAY "
IM IN YR LOOP UPPIN YR N TIL BOTH SAEM N AN 4
  VISIBLE H!
  BOTH SAEM N AN 2, O RLY?
    YA RLY
      VISIBLE "DEER LOLCODE"
    NO WAI
      VISIBLE "2U"
    OIC
IM OUTTA YR LOOP
KTHXBAI

```

# Answer
> 92 votes
# Mathematica- barcode birthday wishes--way too many bytes

This prints the verses and reads them aloud.

> Happy Birthday to You
> Happy Birthday to You
> Happy Birthday Dear Mathematica
> Happy Birthday to You

`StringReplace` replaces each comma with a NewLine. Barcodes cannot contain control characters.

# Answer
> 60 votes
# TI-Basic, 53 bytes

Well, since everyone is putting their favorite programming language up, I might as well add one of my old favorites. I spent a lot of time over the years (before I graduated to actual programming languages) typing commands into a window half the size of a smart phone.

```
"HAPPY BIRTHDAY TO YOU
Disp Ans,Ans,sub(Ans,1,15)+"DEAR TI-BASIC
Ans

```

My calculator doesn't support lowercase letters, and the only variables that can be strings are Str1, Str2 etc.

# Answer
> 46 votes
# Sed, ~~60~~ 55 bytes

(1 character added because there is no way to make `sed` to work without input.)

```
s/^/Happy Birthday To You/
h
G
G
G
s/To You/Dear sed/3

```

Certainly not a winner, posted to demonstrate `sed`'s rare `s///` feature of replacing just the *n*th occurrence.

```
bash-4.3$ sed 's/^/Happy Birthday To You/;h;G;G;G;s/To You/Dear sed/3' <<< ''
Happy Birthday To You
Happy Birthday To You
Happy Birthday Dear sed
Happy Birthday To You

```

## Sed (shorter but not interesting): 52 characters

```
s/^/Happy Birthday To You/
h
G
p
s/To You/Dear sed/

```

Sample run:

```
bash-4.3$ sed 's/^/Happy Birthday To You/;h;G;p;s/To You/Dear sed/' <<< ''
Happy Birthday To You
Happy Birthday To You
Happy Birthday Dear sed
Happy Birthday To You

```

# Answer
> 30 votes
# C, 73 bytes

```
main(c){for(;c-5;)printf("Happy Birthday %s\n",++c-4?"To You":"Dear C");}

```

# Answer
> 29 votes
## Python, ~~61~~ ~~60~~ 59

```
H="\nHappy Birthday to You"
print(H*3)[:60]+"Dear Python"+H

```

# Answer
> 26 votes
# sh, 52

```
H()(echo Happy Birthday ${@-to You});H;H;H Dear sh;H

```

# Answer
> 22 votes
# ArnoldC, 228 bytes

Lets make Arnold Schwarzenegger singing...

```
IT'S SHOWTIME
TALK TO THE HAND "Happy Birthday to You"
TALK TO THE HAND "Happy Birthday to You"
TALK TO THE HAND "Happy Birthday Dear ArnoldC"
TALK TO THE HAND "Happy Birthday to You"
YOU HAVE BEEN TERMINATED

```

output:

```
Happy Birthday to You
Happy Birthday to You
Happy Birthday Dear ArnoldC
Happy Birthday to you

```

# Answer
> 22 votes
## Shakespeare Programming Language, 3429 bytes

> no one is going to be demented enough to enter a challenge with SPL, so...

My own words, a while ago. And yet, someone was demented enough to do it. Yes, yes, I know. Too much bytes. But SPL deserves to be included here, I think. And *believe* me, I've done a gargantuan effort to "golf" this program, which is why it's a bit repetitive and uses mostly the same words (I could always have followed DLosc's suggestion, but that would be too extreme even for me).

```
A Happy Birth Day

Ajax, a hero
Ford, a man

          Act I: 1

          Scene I: 1

[Enter Ajax and Ford]

Ajax:
 You are nothing!

          Scene II: 2

Ford:
 Am I nicer than the sum of a big cow and a son?

Ajax:
 If so, we shall go to Scene V. You are as big as the sum of thyself and a cat!

          Scene III: 3

Ford:
 You are as red as the sum of a big red warm rich bold fair cat and a big rich fine son.
 Speak thy mind! You are as big as the sum of thyself and the sum of a cute fair fine
 rich cat and a hog! Speak thy mind! You are as big as the sum of thyself and the sum
 of a cute fair fine rich cat and a hog. Speak thy mind. Speak thy mind! You are as bold as
 the sum of thyself and the sum of a big fine fair cat and a cow. Speak thy mind! You are
 as big as a red old fair fine tiny cow. Speak thy mind! You are as old as the sum of
 thyself and the sum of a red old fair fine tiny cow and a big joy. Speak thy mind.
 You are as red as the sum of thyself and the sum of the sum of a red old fair fine
 tiny cow and a rich old red sky and a pig. Speak thy mind! You are as old as the sum
 of thyself and the sum of a big fine fair joy and a son. Speak thy mind. You are as
 red as the sum of thyself and a cute son. Speak thy mind! You are as cute as the sum
 of thyself and the sum of a bad fat vile pig and a fat bad lie. Speak thy mind! You are
 as fat as the sum of thyself and a vile evil war. Speak thy mind! You are as vile as the
 sum of thyself and the sum of a pig and a toad. Speak thy mind! You are as fair as the
 sum of thyself and the sum of a big fair hard fine son and a red fine fair joy. Speak
 thy mind! Are you as old as a big cow?

Ajax:
 If so, we shall go to Scene IV.

Ford:
 You are as big as a red old fair fine tiny cow. Speak thy mind! You are as old as the sum
 of thyself and the sum of the sum of a big red warm rich bold fair cat and a red old fair
 fine tiny cow and a bad hog. Speak thy mind! You are as big as the sum of thyself and the
 sum of a fat bad hog and a war. Speak thy mind! You are as big as a red old fair fine tiny
 cow. Speak thy mind! You are as old as the sum of thyself and the sum of a big red warm
 rich bold fair cat and a fat foul bad hog and a son. Speak thy mind. You are as fat as
 the sum of thyself and the sum of the sum of a big fair hard fine son and a big fine
 fair joy and a bad pig. Speak thy mind.

Ajax:
 Let us return to Scene II.

          Scene IV: 4

Ford:
 You are as big as a red old fair fine tiny cow. Speak thy mind! You are as old as the
 sum of thyself and a big red warm rich bold fair cat and a warm sky. Speak thy mind.
 You are as fat as the sum of thyself and the sum of a red old fair fine tiny cow and a
 cat. Speak thy mind. You are as fat as the sum of thyself and a bad foul hog. Speak
 thy mind. You are as cute as the sum of thyself and the sum of a big fair hard fine
 son and a sky. Speak thy mind. You are as big as a red old fair fine tiny cow. Speak thy
 mind! You are as old as the sum of thyself and the sum of thyself and the sum of the sum
 of the sum of a red old fair fine tiny cow and a big fair hard fine son and a big joy and
 a son. Speak thy mind. You are as bad as the sum of thyself and the sum of a fat pig and a
 hog. Speak thy mind. You are as fat as the sum of thyself and a lazy pig. Speak thy mind.

Ajax:
 Let us return to Scene II.

          Scene V: 5

[Exeunt]

```

### The meaning of all this?

OK, if you're curious about how all of this is supposed to work, let me try and explain my reasoning. Firstly, the variables. They have to come from Shakesperian plays and, since tharacter count is important, we have to choose the small ones; thus, `Ajax` and `Ford` appear. They need a description after being declared (which is ignored, but still); I could've used a single letter, but heh.

### Act I, Scene I

`var Ajax, Ford;
Ford = 0;`

We bring the variables into the stage and make `Ajax` tell `Ford` that his value will be 0.

### Act I, Scene II

`if (Ford > 2*1+1)
 goto Scene V;
Ford = Ford + 1;`

OK, if the value stored in `Ford` is bigger than 3, the program jumps to Scene V; otherwhise, its value is incremented.

### Act I, Scene III

`Ford = 2*2*2*2*2*2*1+2*2*2*1;
print((char) Ford);
Ford = Ford+2*2*2*2*1-1;
print((char) Ford);
Ford = Ford+2*2*2*2*1-1;
print((char) Ford);
print((char) Ford);
Ford = Ford+2*2*2*1+1;
print((char) Ford);
Ford = 2*2*2*2*2*1;
print((char) Ford);
Ford = Ford+2*2*2*2*2*1+2*2*2*1+(-1);
print((char) Ford);
Ford = Ford+2*2*2*1+1;
print((char) Ford);
Ford = Ford+2*1;
print((char) Ford);
Ford = Ford+2*2*2*(-1)+2*2*(-1);
print((char) Ford);
Ford = Ford+2*2*(-1);
print((char) Ford);
Ford = Ford+2*(-1)+(-1);
print((char) Ford);
Ford = Ford+2*2*2*2*1+2*2*2*1;
print((char) Ford);
if (Ajax == 2*1)
 goto Scene IV;
Ford = 2*2*2*2*2*1;
print((char) Ford);
Ford = Ford+2*2*2*2*2*2*1+2*2*2*2*2*1+2*(-1);
print((char) Ford);
Ford = Ford+2*2*(-1)+(-1);
print((char) Ford);
Ford = 2*2*2*2*2*1;
print((char) Ford);
Ford = Ford+2*2*2*2*2*2*1+2*2*2*(-1)+1;
print((char) Ford);
Ford = Ford+2*2*2*2*1+2*2*2*1+2*(-1);
print((char) Ford);
Ford = Ford+2*2*2*1+2*-1;
print((char) Ford);
goto Scene II;`

Loads and loads of lines. The idea is to fiddle with the value stored on `Ford`, doing loads and loads of arithmetic operations in order to get the ASCII number of the desired letters, then we tell the compiler to output the number in character form. That's how you write `Happy Birthday`. There's an `if` inside this scene: the idea is to check if this is the third phrase of the song; if it is, we jump to Scene IV; otherwise we keep on forward, to write `to You`. After that, we jump back to Scene II.

### Act I, Scene IV

`Ford = 2*2*2*2*2*1;
print((char) Ford);
Ford = Ford+2*2*2*2*2*2*1+2*2*1;
print((char) Ford);
Ford = Ford+2*2*2*2*2*1+1;
print((char) Ford);
Ford = Ford+2*2*(-1);
print((char) Ford);
Ford = Ford+2*2*2*2*1+1;
print((char) Ford);
Ford = 2*2*2*2*2*1;
print((char) Ford);
Ford = Ford+2*2*2*2*2*1+2*2*2*2*1+2*1+1;
print((char) Ford);
Ford = Ford+2*(-1)+(-1);
print((char) Ford);
Ford = Ford+2*2*(-1);
print((char) Ford);
goto Scene II;`

The way this works is similar to the Scene above: the idea is to write `Dear SPL`.

### Act I, Scene V

`End.`

Just like that.

I still haven't found any place where this can be tested, unfortunately...

# Answer
> 21 votes
## APL (48)

```
↑1⌽'Happy birthday '∘,¨(3/⊂'to you'),⊂'dear APL'

```

# Answer
> 16 votes
## Ruby, 54 bytes

I just thought "Hey, there's no Ruby answer yet", but then one appeared a few seconds before this one. Oh well...

```
puts h="Happy Birthday to You",h,h[0,15]+"Dear Ruby",h

```

# Answer
> 16 votes
## Any love for PHP? ~~61~~ ~~59~~ 58 bytes

```
$s="
Happy Birthday";echo$t="$s to You","$t$s Dear PHP$t";

```

See it in action @ http://sandbox.onlinephpfunctions.com/

# Answer
> 16 votes
I just can't decide on just one language :/

# BrainBack: 68

```
4 ["Happy birthday ">2 ->![<0 "to You
"]<[<0 "Dear BrainBack
"]<1 -]

```

*BrainBack is a mix between BrainFuck and Forth, made for a PCG challenge Mar 7, 2014*

# Extended BrainFuck: 79

```
{h|"Happy Birthday ">}{t|"to You
">}&h&t&h&t&h|"Dear Extended BrainFuck
">&h&t

```

*EBF's birthday is Jul 16, 2010*

# Scheme: 96

(R5RS, Racket, R6RS REPL)

```
(map(lambda(e)(display"Happy Birthday ")(display(if e "to You\n" "Dear Scheme\n")))'(1 1 #f 1))

```

*Scheme was born Dec, 1975 (NB: PDF)*

# Zozotez: 96

```
((:'R(\(l)(p'|Happy birthday |())(p(?(a l)'|to You|'|Dear Zozotez|))(?(d l)(R(d l)))))'(t t()t))

```

However, It feels more right doing this one in French (86):

```
((:'A(\(l)(p'|Joyeux anniversaire|())(p(a l))(?(d l)(A(d l)))))'(, , | Zozotez,| |.|))

```

Output:

```
Joyeux anniversaire,
Joyeux anniversaire,
Joyeux anniversaire Zozotez,
Joyeux anniversaire.

```

*Zozotez' birthday is Jul 19, 2011*

# Answer
> 16 votes
# Deadfish (2610 2391 chars)

What's this? An output only challenge? Sound like it's a job for Deadfish!

```
iiisdsiiiiiiiioiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiiiiiiiiooiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoddddddddddddddddddddddddsiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiioiioddddddddddddoddddodddoiiiiiiiiiiiiiiiiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddodddddddddddddddddddddsdddddodddddodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddodddddddddddddddddddddddsiiiiiiiioiiiiiiiiiiiiiiiiiiiiiioiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoddsiiiiiiiioiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiiiiiiiiooiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoddddddddddddddddddddddddsiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiioiioddddddddddddoddddodddoiiiiiiiiiiiiiiiiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddodddddddddddddddddddddsdddddodddddodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddodddddddddddddddddddddddsiiiiiiiioiiiiiiiiiiiiiiiiiiiiiioiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoddsiiiiiiiioiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiiiiiiiiooiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoddddddddddddddddddddddddsiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiioiioddddddddddddoddddodddoiiiiiiiiiiiiiiiiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoddddddddddddddddddddddddsiiiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioddddoiiiiiiiiiiiiiiiiioddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoddddddddddddddddddddddddsiiiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioddddoiiioiioiiioiiiiiiiiiiodddddddddddoddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoddsiiiiiiiioiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiiiiiiiiooiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoddddddddddddddddddddddddsiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiioiioddddddddddddoddddodddoiiiiiiiiiiiiiiiiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddodddddddddddddddddddddsdddddodddddodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddodddddddddddddddddddddddsiiiiiiiioiiiiiiiiiiiiiiiiiiiiiioiiiiiio

```

Unfortunately, because Deadfish only outputs integers, the code above outputs the ASCII representations of each character in the song.

If we use the specification that

> Errors are not acknowledged: the shell simply adds a newline character!

then we can golf this down to 2391 chars:

```
iiisdsiiiiiiiioiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiiiiiiiiooiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoddddddddddddddddddddddddsiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiioiioddddddddddddoddddodddoiiiiiiiiiiiiiiiiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddodddddddddddddddddddddsdddddodddddodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddodddddddddddddddddddddddsiiiiiiiioiiiiiiiiiiiiiiiiiiiiiioiiiiiiofdddddddddddddddddddddddddddddddddddddddddddddoiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiiiiiiiiooiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoddddddddddddddddddddddddsiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiioiioddddddddddddoddddodddoiiiiiiiiiiiiiiiiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddodddddddddddddddddddddsdddddodddddodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddodddddddddddddddddddddddsiiiiiiiioiiiiiiiiiiiiiiiiiiiiiioiiiiiiofdddddddddddddddddddddddddddddddddddddddddddddoiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiiiiiiiiooiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoddddddddddddddddddddddddsiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiioiioddddddddddddoddddodddoiiiiiiiiiiiiiiiiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoddddddddddddddddddddddddsiiiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioddddoiiiiiiiiiiiiiiiiioddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoddddddddddddddddddddddddsiiiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioddddoiiioiioiiioiiiiiiiiiiodddddddddddofddddddddddddddddddddddddddddddddoiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiiiiiiiiooiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddoddddddddddddddddddddddddsiioiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiioiiiiiiiiioiioddddddddddddoddddodddoiiiiiiiiiiiiiiiiiiiiiiiiodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddodddddddddddddddddddddsdddddodddddodddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddodddddddddddddddddddddddsiiiiiiiioiiiiiiiiiiiiiiiiiiiiiioiiiiiio

```

Note: Deadfish isn't *actually* my favourite language, but I couldn't resist :P. Also golfing in Deadfish is a fun puzzle on its own.

# Answer
> 13 votes
## JS, 83 bytes

```
h="Happy Birthday to You\n",console.log(h,h,h.replace("to You\n","Dear")+" JS\n",h)

```

**or 79 bytes by @Ingo Bürk**

```
h="Happy Birthday ",t="to You\n",console.log(h+t,h+t,h+"Dear Javascript\n",h+t)

```

**or 71 bytes by @kapep**

```
console.log(a=(b="Happy Birthday ")+"to You\n",a,b+"Dear Javascript\n",a)

```

*or run on the console this page (42 bytes)*

```
eval($("#answer-39759 code:first").text())

```

# Answer
> 12 votes
# T-SQL, ~~89~~ 87 bytes

**Edit:** Probably shouldn't be dredging these old things up, but I just noticed an obvious change to this to reclaim a couple of bytes.

Using STUFF to remove unwanted parts of the string, the starting index is provided by the values in the `FROM` clause multiplied by 3

```
SELECT STUFF('Happy Birthday to You  Dear SQL',N,8,'')FROM(VALUES(24),(24),(15),(24))S(N)

```

# Answer
> 11 votes
# R: 70 bytes

Takes advantage of `paste` and vector recycling.

```
writeLines(paste(rep("Happy Birthday",4),c(rep("to You",2),"Dear R")))

```

# Answer
> 11 votes
# Python 507 bytes

```
print """
H  a     p     py-  Bir  t   h    day  -to-Y ou=  Happy -  B irt       h     d   a y
-  t    o -    Y  o u  =  H a     p  p   y   -  B   i   r  t h  d     a y     - D  e
ar-P   ython   =Ha  ppy    -      Bir    t   hda    y   -to- Y   o   uHapp     y   -
B  i  r     t  h    d      a      y  -   t   o -    Y   o  u =  H   a     p    p
y  - B       i r    t      h      day  -to-Y o  u   =   H  a ppy   -       B   i   r
""".replace("\n","").replace(" ","").replace("-"," ").replace("=","\n")[:92]

```

Not winning any prizes ... but if you look at it carefully, there is some ASCII art:

```
#  #     #     ###  ###  #   #    ###  ##### ###  ##### #  # ###       #     #   # #
#  #    # #    #  # #  #  # #     #  #   #   #  #   #   #  # #  #     # #     # #  #
####   #####   ###  ###    #      ###    #   ###    #   #### #   #   #####     #   #
#  #  #     #  #    #      #      #  #   #   # #    #   #  # #  #   #     #    #
#  # #       # #    #      #      ###  ##### #  #   #   #  # ###   #       #   #   #

```

# Answer
> 9 votes
# GNU dc, 51

```
[Happy Birthday to You]d[Happy Birthday Dear dc]rdf

```

# Answer
> 9 votes
# Perl - 58

```
say"Happy Birthday ".($_?"Dear Perl":"To You")for(0,0,1,0)

```

Run with:

```
perl -E'say"Happy Birthday ".($_?"Dear Perl":"To You")for(0,0,1,0)'

```

Just for fun:

```
perl -E'for(<HappyBirthday{0,1,2,3}>){s/B/ B/;s/2/ Dear Perl\n/;print s/\d/ To You\n/r}'

```

# Answer
> 9 votes
# Excel VBA, ~~687~~ ~~686~~ ~~686~~ 681 Bytes

From the problem statement:

> However, I'm also rewarding other witty submissions with up-votes (and I encourage everybody to do so as well). Therefore although this is a code-golf contest, not-so-short answers are also welcome.

## Code

Full `sub`routine that takes no input and outputs a happy birthday song for VBA onto the range `[A1:CM23]` of the `ActiveSheet` object.

```
Global l
Sub a
Cells.RowHeight=48
For l=0To 3
p[A1:A5,B3,C1:C5,F1,E2:E5,G2:G5,F3,I1:I5,J1,K2,J3,M1:M5,N1,O2,N3,Q1:Q2,R3:R5,S1:S2]
p[Y1:Y5,Z1,AA2,Z3,AA4,Z5,AC1:AE1,AD2:AD4,AC5:AE5,AG1:AG5,AH1,AI2,AH3,AI4:AI5,AK1:AM1,AL2:Al5,AO1:AO5,AP3,AQ1:AQ5,AS1:AS5,AT1,AU2:AU4,AT5,AX1,AW2:AW5,AY2:AY5,AX3,BA1:BA2,BB3:BB5,BC1:BC2]
If l-2Then p[BI1:BK1,BJ2:BJ5,BN1,BM2:BM4,BN5,BO2:BO4,BU1:BU2,BV3:BV5,BW1:BW2,BZ1,BY2:BY4,BZ5,CA2:CA4,CC1:CC4,CD5,CE1:CE5]Else p[BI1:BI5,BJ1,BK2:BK4,BJ5,BM1:BM5,BN1:BO1,BN3,BN5:BO5,BR1,BQ2:BQ5,BS2:BS5,BR3,BU1:BU5,BV1,BW2,BV3,BW4:BW5,CC1:CC4,CD5,CE1:CE4,CG1:CG5,CH1,CI2,CH3,CI4,CH5,CL1,CK2:CK5,CM2:CM5,CL3]
Next
End Sub
Sub p(r)
r.Offset(6*l).Interior.Color=0
End Sub

```

## Output

# Answer
> 7 votes
# PowerShell - ~~69~~ ~~64~~ 59

```
1,1,0,1|%{"Happy Birthday "+("Dear $ShellId","To You")[$_]}

```

and 91

```
$a,$b,$c="Happy Birthday.To You.Dear PowerShell".Split(".");1..2|%{"$a $b"};"$a $c";"$a $b"

```

and 108

```
$a=@();$b,$c="To You.Dear PowerShell".Split(".");1..4|%{$a+="Happy Birthday $b"};$a[2]=$a[2]-replace$b,$c;$a

```

# Answer
> 6 votes
# Ruby, 56

```
x="Happy Birthday To You
"*4
x[59,6]="Dear Ruby"
puts x

```

# Answer
> 6 votes
# Var'aQ - 121

```
"Happy Birthday " ~ a cher "to you\n" tlheghrar ~ b cher b tlheghrar a "dear Var'aQ" tlheghrar tlheghrar b tlheghrar cha'

```

# Answer
> 6 votes
# Marbelous, 151

Prints `Happy Birthday` every time `hb` is called, with either `to you` or `Dear Marbelous` appended, based on whether the input is `0` or `1`. The passed marble in `hb` will not be outputted, as it will get stuck in the synchroniser `&0`.

```
03
00
02
01
hb
:hb
}0
=0&0
&1
&2//
746F20596F7544656172204D617262656C6F75730A
&0&0&0&0&0&0&1&1&1&1&1&1&1&1&1&1&1&1&1&1&2
486170707920426972746864617920

```

Below is the board `hb`, with hex converted to ascii text:

# Answer
> 5 votes
## CJam, 46 bytes

```
4,{"Happy Birthday "\2="Dear CJam""to You"?N}%

```

Try it here.

```
4,                                             "Push [0,1,2,3].";
  {                                         }% "Map...";
   "Happy Birthday "                           "Push the string.";
                    \                          "Swap top two stack elements (string and
                                                array element)";
                     2=                        "Check equality with 2.";
                       "Dear CJam""to You"     "Push two more strings.";
                                          ?    "Select string based on result of 2=.";
                                           N   "Push a line break";

```

This leaves the following array on the stack:

```
["Happy Birthday " "to You" "\n" "Happy Birthday " "to You" "\n" "Happy Birthday " "Dear CJam" "\n" "Happy Birthday " "to You" "\n"]

```

Whose contents are automatically printed back-to-back at the end of the program.

Alternatively, with a for-loop and the same character count:

```
4{"Happy Birthday "I2="Dear CJam""to You"?N}fI

```

# Answer
> 5 votes
# GolfScript: 54 characters

```
4,{"Happy Birthday "["To You""Dear GolfScript"]@2==n}%

```

Sample run:

```
bash-4.3$ golfscript.rb <<< '4,{"Happy Birthday "["To You""Dear GolfScript"]@2==n}%'
Happy Birthday To You
Happy Birthday To You
Happy Birthday Dear GolfScript
Happy Birthday To You

```

# Answer
> 5 votes
## T-SQL (MS compliant): 75

```
print stuff(replicate('Happy Birthday to You '+char(10),4),62,6,'Dear SQL')

```

# Answer
> 5 votes
# **C# (75) (73)**

Using `System.Diagnostics` for the purpose of `Debug.Print`

Upgrade to @Abbas' code

```
string x="\nHappy Birthday ",y=x+"to You";Debug.Print(y+y+x+"Dear C#"+y);

```

Upgrade to @Tyress' code **(83) (76)**

```
for(int i=0;i++<4;)Debug.Print("Happy Birthday "+(i!=3?"to You":"Dear C#"));

```

Output:

```
Happy Birthday To You
Happy Birthday To You
Happy Birthday Dear C#
Happy Birthday To You

```

# Answer
> 5 votes
# Retina, 47 ~~49~~ ~~50~~ ~~52~~ bytes

The program is encoded as ISO-8559-1 (which the official interpreter accepts). The leading newline is significant.

```

¶¶x¶

Happy Birthday to You
.{27}u
Dear Retina
```

Try it online.

# Explanation

Step 1: Replace the (empty) input with “newline, newline, x, newline”.

Step 2: In between every character, insert `Happy Birthday to You`. We now have:

```
Happy Birthday to You
Happy Birthday to You
Happy Birthday to YouxHappy Birthday to You
Happy Birthday to You

```

Step 3: replace a 28-character string ending in `u` and not containing a newline with `Dear Retina`. The only occurrence of that is `to YouxHappy Birthday to You`.

# Answer
> 5 votes
# Reng, 66 bytes

Noncompeting.

```
A"uoY ot yadhtriB yppaH"¤ao;A"gneR raeD yadhtriB yppaH ~"S0gO0gao;

```

Simple enough. `A` is 10, or a newline. `"uoY ot yadhtriB yppaH"` pushes that string, `¤` duplicates the string, `ao;` outputs everything. The second part is more interesting. `"A"gneR raeD yadhtriB yppaH ~"` pushes that string. `S` pushes 28, and `0g` sets the character at (0, 28) to the top of stack, or a `~`, the end program signal. This sets the last `A` to a tilde. Then, `O0g` sets the character at`(0, 24)` to a space/nop, removing the duplicate stack command. We print the third line using `ao;`. Then, we wrap around to the beginning of the line and print the last line again.

Here's a GIF, because who doesn't like those?

# Answer
> 5 votes
# 05AB1E, 36 bytes

```
”ŽØ¢©”©" to You"«Ð®" Dear 05AB1E"«s»

```

TIO Nexus

Try it online!

**Output:**

```
Happy Birthday to You
Happy Birthday to You
Happy Birthday Dear 05AB1E
Happy Birthday to You

```

**Explanation:**

```
”ŽØ¢©”                                Push "Happy Birthday"
                                       STACK: ["Happy Birthday"]
      ©                               Store in register w/o popping
       " to You"«                     Append " to You"
                                       STACK: ["Happy Birthday to You"]
                 Ð                    Triplicate the string
                                       STACK: ["Happy Birthday to You", "Happy Birthday to You", "Happy Birthday to You"]
                  ®                   Push "Happy Birthday" from register
                                       STACK: ["Happy Birthday to You", "Happy Birthday to You", "Happy Birthday to You", "Happy Birthday"]
                   " Dear 05AB1E"«    Append " Dear 05AB1E"
                                       STACK: ["Happy Birthday to You", "Happy Birthday to You", "Happy Birthday to You", "Happy Birthday Dear 05AB1E"]
                                  s   Swap top two strings
                                       STACK: ["Happy Birthday to You", "Happy Birthday to You", "Happy Birthday Dear 05AB1E", "Happy Birthday to You"]
                                   »  Join by newlines

```

# Answer
> 4 votes
## Java, ~~127~~ 125 bytes

```
class h{public static void main(String[]a){String b="\nHappy Birthday ",d=b+"to You";System.out.print(d+d+b+"Dear Java"+d);}}

```

However, if you ignore all of the excess stuff, it is only ~~82~~ 80 bytes:

```
String b="\nHappy Birthday ",d=b+"to You";System.out.print(d+d+b+"Dear Java"+d);

```

Oh, and it starts with a newline, saving 2 bytes.

# Answer
> 4 votes
# BBC BASIC, 81 / 76 ASCII characters

Download interpreter at http://www.bbcbasic.co.uk/bbcwin/bbcwin.html

Unfortunately, it's not possible to choose between strings within an expression, so the line endings are repetitively encoded in a `DATA` statement. On the other hand, when you read the last line, it does sound quite musical.

```
FORk=1TO4READa$PRINT"Happy Birthday ";a$:NEXT
DATAto You,to You,Dear BASIC,to You

```

We can, however, choose what substring to select from a given string, for a saving of 5 characters (note that `k=3` evaluates to `-1` when true):

```
FORk=1TO4PRINT"Happy Birthday ";MID$("Dear BASICto You",11+(k=3)*10,10):NEXT

```

# BBC BASIC, 69 ASCII characters

A shorter way:

```
a$="Happy Birthday "b$="to You"PRINTa$;b$'a$;b$'a$;"dear BASIC"'a$;b$

```

# Answer
> 4 votes
## J (44)

```
2|.'Happy birthday ',"1'dear J',>3#<'to you'

```

# Answer
> 4 votes
## Groovy (64)

```
4.times{println"Happy Birthday ${it==2?'Dear Groovy':'to You'}"}

```

# Answer
> 4 votes
# Common Lisp (~~62~~ 60 chars)

```
(format t"~@{Happy Birthday ~[to You~;dear CL~]~%~}"0 0 1 0)

```

# Output

```
Happy Birthday to You
Happy Birthday to You
Happy Birthday dear CL
Happy Birthday to You

```

# Answer
> 4 votes
# VBA 99

Why VBA? Why not?

```
Sub H(): For i = 0 To 3: MsgBox "Happy Birthday " & IIf(i = 2, "Dear VBA", "to You"): Next: End Sub

```

Ungolfed

```
Sub H()
    For i = 0 To 3
        MsgBox "Happy Birthday " & IIf(i = 2, "Dear VBA", "to You")
    Next
End Sub

```

# Answer
> 4 votes
# Casio CFX-9850G, 121 bytes ~~96~~

Just for the fun of it, the Happy Birthday song for the CFX-9850G graphing calculator.

Some instructions are just displayed as multiple bytes, but as far as I know they are encoded as 1 or 2 bytes. I marked them with colors. Edit: I checked the memory, so the program uses 121 bytes in the calculator.

The song text would not fit in a line, especially line 3 because in text mode the calculator can only display 7 rows and 21 columns. So I print the lyrics in graphing mode, which uses a tiny font.

Here is the output:

# Answer
> 4 votes
**Qt 5.4 qmake pro file, 119 bytes**

Since the winner has already been announced, I thought I'd give a try for the *witty* category.

```
O=$$escape_expand(\n)
A=Happy Birthday
B=$$A to you$$O
CONFIG(debug,debug|release){log($$A dear qmake$$O)}log($$B)

```

This abuses **qmake** horribly.

qmake under default settings will parse a script 3 times over. For debug, release, and a build\_pass. So we just let it throw out the "Happy Birthday" for all logs, with an extra "To you..." when a debug makefile is being generated.

```
Happy Birthday to you
Happy Birthday to you
Happy Birthday dear qmake
Happy Birthday to you

```

# Answer
> 3 votes
# JavaScript, ~~74~~ 73

```
for(i=5;--i;)console.log('Happy birthday',i-2?'to you':'dear JavaScript')

```

Thanks to Dancrumb for the byte-saving tip. It would be ~~68~~ 67 bytes if I could use 4 `alert`s instead of newlines.

```
for(i=5;--i;)alert('Happy birthday',i-2?'to you':'dear JavaScript')

```

# Answer
> 3 votes
# Brainfuck, 593 characters

Used this

```
++++++++++[>+>+++>++++++>+++++++>++++++++>+++++++++>++++++++++>+++++++++++>++++++++++++<<<<<<<<<-]>>>>++.>>+++++++.>>++..>+.<<<<<<<++.>++++++.>>>>+++++.>++.++.<-.----.<.>>>.<<<<<<<.>>>>>>.-----.<<<<<<.>>>+++++++++.>>>.++++++.<<<<<<<.>>>.>>.>>-----..>.<<<<<<<.>.>>>>+++++.>++.++.<-.----.<.>>>.<<<<<<<.>>>>>>.-----.<<<<<<.>>>.>>>.++++++.<<<<<<<.>>>.>>.>>-----..>.<<<<<<<.>.>>>>+++++.>++.++.<-.----.<.>>>.<<<<<<<.>++.>>>>+.<.>>--.<<<<<<.>--.>>>>>.<<.>++++.>----.<---.>+++++++.<<++.>+++++.<<<<<<.>>>.>>--.>>-----..>.<<<<<<<.>.>>>>--.>++.++.<-.----.<.>>>.<<<<<<<.>>>>>>.-----.<<<<<<.>>>.>>>.++++++.

```

# Answer
> 3 votes
**Powershell one liner: ~~73~~ 71**

`1..4|%{"Happy Birthday $(if($_-eq3){"Dear Powershell"}else{"to You"})"}`

# Answer
> 3 votes
# Swift, 83

Run this in Xcode Playground

```
let h="\nhappy birthday"
let t=" to you"
let f=h+t+h+t+h+" dear Swift"+h+t
print(f)

```

# Answer
> 3 votes
# Lua, 96 bytes

I was trying to be cool about this and make use of all the best Lua tricks I know but the guy who wrote a simple for loop with an `if i==3` beat me by 20+ bytes \>.\<

Still, I think this is pretty cool in terms of Golfing:

```
a='Happy Birthday to you\ndear Lua\n'print(a:sub(0,-10):rep(3):sub(0,-8)..a:rep(2):sub(23,-10))

```

I was looking at recursively building the string `a` from a number using string.char() but I couldn't compress it anywhere near the length of `a='Happy Birthday to you\ndear Lua\n'`

# Answer
> 3 votes
# Vim, 90 45 bytes

```
i
Happy Birthday to you
[ESC]
yypppPWWd$adear Vim

```

90 chars version:

```
i
Happy Birthday to you dear Vim
[ESC]
:%s/\(.* .* \)(.. .*\) \(.* .*\)/\1\2\r\1\2\r\1\3\r\1\2

```

I'm certain there is a quicker way but this is what I just came up with :)

Puts out

```
Happy Birthday to you
Happy Birthday to you
Happy Birthday dear Vim
Happy Birthday to you

```

# Answer
> 3 votes
**APL: 45**

```
4 23⍴'Dear APL',⍨61⍴'Happy birthday to you  '

```

**Explanation:**

61⍴ reapeats the string up to length 61, after which "Dear APL" is concatenated (,)

Note that ⍨ inverts arguments, so it's added at the end.

4 23⍴ just makes a matrix 4x23 using the string on the right, starting from the beginning of the string each time it reaches the end.

# Answer
> 3 votes
# Pyth, 42

```
V4+"Happy Birthday "?"to You"nN2"Dear Pyth

```

Demonstration:

```
$ pyth -c 'V4+"Happy Birthday "?"to You"nN2"Dear Pyth'
Happy Birthday to You
Happy Birthday to You
Happy Birthday Dear Pyth
Happy Birthday to You

```

How it works:

`V4` sets up a for loop, with N iterating over `0, 1, 2, 3`.

Then, we create the string starting with `"Happy Birthday "`, and ending with `"to You"` if `N` does not equal `2` (`nN2` calculates this), or ending with `"Dear Pyth"` otherwise.

Exact tie with CJam - language name and character count.

---

Alternative, 43 character solution:

```
J"Happy Birthday to You"JJ+<J15"Dear Pyth"J

```

It's one character longer because it needs an end quote.

# Answer
> 3 votes
# Julia, ~~75~~ ~~67~~ 65 characters

~~`a,b,c="Happy Birthday ","To You\n","Dear Julia\n";print("$a$b$a$b$a$c$a$b")`~~

~~`a="Happy Birthday";b=("$a To You\n");print("$b$b$a Dear Julia\n$b")`~~

`a="Happy Birthday To You\n";print("$a$a$(a[1:15])Dear Julia\n$a")`

Just for fun, here is an ungolfed version, with a loop (114 characters):

```
for i = 1:4
    a,b,c = "Happy Birthday ","To You","Dear Julia"
    i != 3 ? println("$a$b") : println("$a$c")
end

```

# Answer
> 3 votes
# Bubblegum, 42 bytes

```
0000000: f3 48 2c 28 a8 54 70 ca 2c 2a c9 48 49 ac  .H,(.Tp.,*.HI.
000000e: 54 28 c9 57 88 cc 2f e5 22 4a d4 25 35 b1  T(.W../."J.%5.
000001c: 48 c1 a9 34 29 29 27 35 bd 34 17 bb 1e 00  H..4))'5.4....

```

Note that this answer is non-competing, since Bubblegum is a lot younger than this challenge.

# Answer
> 3 votes
# Fishing, 116 bytes

```
v+CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
  `Happy Birthday `P{`to You`N}P{N}P{{`Dear Fishing`N}}P{N

```

# Answer
> 3 votes
# Seriously, ~~59~~ 57 bytes (non-competitive)

`"Happy Birthday to You";"Happy Birthday Dear Seriously"@;`

**Explanation**

Push "Happy Birthday to You", duplicate, push "Happy Birthday Dear Seriously", rotate the two top elements, duplicate, and implicit popping and printing.

# Answer
> 3 votes
# ///, 48 bytes

```
/U/Happy Birthday //T/Uto You/T
T
UDear \/\/\/
T

```

# Answer
> 3 votes
# Japt, ~~41~~ 38 bytes

```
`Happy Bir»y  Y
`
³h58Ui` De Japt

```

Test it

# Answer
> 3 votes
## Underload, 59 Bytes

```
(to You
):(Happy Birthday ):S~S:S~:S~:S(Dear Underload
)SSS

```

I was hindered by Underload's lack of stack manipulation commands. I had to push stuff in a strange order and swap a bit more than I would have preferred, but oh well...

Stack trace:

```
(...) | (to You)
:     | (to You)(to You)
(...) | (to You)(to You)(Happy Birthday )
:S    | (to You)(to You)(Happy Birthday )         ; output "Happy Birthday "
~     | (to You)(Happy Birthday )(to You)
S     | (to You)(Happy Birthday )                 ; output "to You"
:S    | (to You)(Happy Birthday )                 ; output "Happy Birthday "
~     | (Happy Birthday )(to You)
:S    | (Happy Birthday )(to You)                 ; output "to You"
~     | (to You)(Happy Birthday )
:S    | (to You)(Happy Birthday )                 ; output "Happy Birthday "
(...) | (to You)(Happy Birthday )(Dear Underload)
S     | (to You)(Happy Birthday )                 ; output "Dear Underload"
S     | (to You)                                  ; output "Happy Birthday "
S     |                                           ; output "to You

```

# Answer
> 3 votes
# C++, 135 bytes

**Great thanks to Steadybox and DJMcMayhem for shortening this code by 55 characters! :)**

```
#include<iostream>
#include<string>
std::string s="Happy Birthday ",t="to you\n",u="Dear C++\n";int main(){std::cout<<s+t+s+t+s+u+s+t;}

```

# Answer
> 2 votes
# Rust, 98 bytes

```
fn main(){for i in range(0i,4){println!("Happy birthday {}",match i{2=>"dear Rust",_=>"to you"})}}

```

# Answer
> 2 votes
# Lua: ~~91~~ 72 characters

First pass:

```
for i=1,4 do io.write'Happy Birthday 'if i==3 then print'Dear Lua'else print'to You'end end

```

Demo

Even smaller:

```
for i=1,4 do print('Happy Birthday '..(i==3 and'Dear Lua'or'to You'))end

```

Demo

# TI-BASIC: 65

```
:PROGRAM:H
:"HAPPY BIRTHDAY TO YOU
:Disp Ans,Ans,sub(Ans,1,15)+"DEAR TI-BASIC
:Disp Ans

```

In TI-BASIC, all built-in commands (even multi letter ones) are either one or two bytes on the calculator. The size I used represents the (minimum, since names take space) space taken by this code on my TI-84+SE running OS version 2.53MP. Seemingly wrong syntax (unclosed strings) is intentional.

# TI-68k: 90

```
:h()
:Prgm
:"Happy Birthday to You"→a
:Disp a,a,mid(a,1,15)&"Dear TI-68k",a
:EndPrgm

```

Again, the size I used is the minimum real size on the calc (in this case, a TI-92).

# Answer
> 2 votes
# Scala, 89 bytes (also it is not my favourite)

```
(1 to 4).map{i=>"Happy Birthday "+(if(i==3)"dear SCALA" else "to You")}.foreach{println}

```

Maybe it could be less, it is just a default example, so feel free to improve.

**Regarding Java:**

If ignoring the excess stuff it is also possible to do a "import static java.lang.System.\*;" and then use out.println. So something like this is possible (87 chars):

```
int i=0;while(i<=3){out.println("Happy Birthday "+((i==2)?"dear Java":"to you"));i++;}

```

(also it is longer than the solution from Stretch Maniac - see https://codegolf.stackexchange.com/a/39768)

# Answer
> 2 votes
## R, 69 chars

```
for(i in 1:4)cat('Happy Birthday',ifelse(i==3,'Dear R','to You'),'\n')

```

Or

```
for(i in 1:4)cat('Happy Birthday',if(i==3)'Dear R' else 'to You','\n')

```

All output:

```
Happy Birthday to You
Happy Birthday to You
Happy Birthday Dear R
Happy Birthday to You

```

Otherwise with 66 characters there was, without the `for` loop:

```
a=rep('to You',4);a[3]='Dear R';cat(paste('Happy Birthday',a,'\n'))

```

But it outputs:

```
Happy Birthday to You
 Happy Birthday to You
 Happy Birthday Dear R
 Happy Birthday to You

```

# Answer
> 2 votes
# C#

**LINQPad (69):**

```
string x="\nHappy Birthday ",y=x+"to You";(y+y+x+"Dear C#"+y).Dump();

```

**Console (75):**

```
string x="\nHappy Birthday ",y=x+"to You";Console.Write(y+y+x+"Dear C#"+y);

```

**Ungolfed:**

```
string x = "\nHappy Birthday ";
string y = x + "to You";

//LINQPad
(y + y + x + "Dear C#" + y).Dump();

//Console
Console.Write(y+y+x+"Dear C#"+y);

```

# Answer
> 2 votes
## PHP ~~67~~ ~~63~~ 62

```
echo$z=($s="Happy Birthday").$t=" to You
","$z$s Dear PHP
$z";

```

EDIT: As @manatwork pointed out, without the second echo I have 4 chars less!!

EDIT2: Other improvement according to @manatwork

# Answer
> 2 votes
## Visual FoxPro - 77

Not really my favorite language, but makes golfing somewhat interesting. Here is my greetings to it:

```
a="Happy Birthday "
b="to You"
?a+b
?a+b
?a+"Dear "+_screen.Caption
?a+b

```

This abuses the fact that `_screen.Caption` (the main window title) initially contains *Microsoft Visual FoxPro*, handy here. If I'm allowed to call the language by its "friendly name", I can just replace that for "Fox" and save 10 characters.

# Answer
> 2 votes
# PowerShell 62

```
0..3|%{"Happy Birthday "+("to You","Dear PowerShell")[$_-eq2]}

```

# Answer
> 2 votes
**Mathematica (65)**

```
Print["Happy Birthday "<>#]&/@{s="to you",s,"dear Mathematica",s}

```

# Answer
> 2 votes
# Delphi, 154 146 139

```
uses{$APPTYPE CONSOLE}SysUtils,StrUtils;var i:byte;begin
for i:=0to 3do WriteLn('Happy birthday '+IfThen(i=2,'dear Delphi','to you'))end.

```

# Answer
> 2 votes
## C (74 characters)

```
main(i){for(i=4;i;)printf("Happy birthday %s\n",i---2?"to You":"Dear C");}

```

## Python 2 (72 characters)

```
for k in range(4):print"Happy birthday",k==2 and"Dear Python"or"to You"

```

Python 3 would need parentheses around the printed string, so two character more, so 74.

## PHP (66 characters)

```
for($i=4;$i;)echo"Happy birthday ".($i---2?"to You\n":"Dear PHP\n");

```

# Answer
> 2 votes
# TeX - 70

```
\def\h{Happy Birthday }\def\y{to You}\h\y

\h\y

\h Dear TeX

\h\y\bye

```

Note that the line breaks are intentional and actually required.

# Answer
> 2 votes
# LaTeX, 182

This isn't intended to be a serious competitive entry, but just to do something fun. Therefore, disregard the char count. I don't need any golfing tips for this, because it is intentionally ungolfed.

```
\documentclass{article}
\newcommand{\h}[1]{Happy Birthday to {#1}}
\newcommand{\g}{\h{You}}
\begin{document}
\begin{verse}
\g \\
\g \\
\h{\LaTeX} \\
\g \\
\end{verse}
\end{document}

```

# Answer
> 2 votes
# Cardinal, ~~113~~ ~~107~~ ~~88~~ 82 characters

I fixed the errors in the original interpreter, so the operators work as specified. This enabled me to shrink down the code by another ~~19~~ 25 characters:

4th version:

```
v8888#;++"lanidraC raeD " <
8%+++>>"Happy Birthday"-jv^
>8888@^        ;"uoY oT "<

```

Output, using my interpreter fixes:

```
Executing program..

Happy Birthday To You
Happy Birthday To You
Happy Birthday Dear Cardinal
Happy Birthday To You

Execution complete.
>

```

Second version, saving 6 chars: I changed the o’s and O’s to v^\<\> because the available interpreter has some errors with the handling of the rotation operators o and O, j and J and some other errors. One has to use the wrong rotation operators to make it work, but I prefer using a version that works according to specification. The length of the code stays the same. This version works properly with the interpreter provided at the link given at the bottom of my comment: (107 characters)

```
%->"Happy Birthd"v
x ^D+;"uoY oT ya"<
   >"Happy Birthday D"v
v"ppaH";"lanidraC rae"<
>"y Birthday To You"@

```

Output, using the "original" faulty interpreter:

```
Executing program..

Happy Birthday To You
Happy Birthday To You
Happy Birthday Dear Cardinal
Happy Birthday To You

Execution complete.
>

```

You can test the program if you save it as txt file and drag it onto the interpreter exe for Windows.

http://esolangs.org/wiki/Cardinal

Here is the interpreter: http://floatation.webs.com/Cardinal.zip

# Answer
> 2 votes
## CMD - 84 Bytes

```
cmd/v/c"set 1=to You&set 2=Dear CMD&for %a in (1,1,2,1)do @echo Happy Birthday !%a!"

```

# Answer
> 2 votes
# jq: ~~54~~ 52 characters

(49 characters code + 3 characters command line option.)

```
0,0,1,0|"Happy Birthday "+["to You","Dear jq"][.]

```

Sample run:

```
bash-4.3$ jq -n -r '0,0,1,0|"Happy Birthday "+["to You","Dear jq"][.]'
Happy Birthday to You
Happy Birthday to You
Happy Birthday Dear jq
Happy Birthday to You

```

On-line test (Passing `-r` through URL is not supported – check Raw Output yourself.)

# Answer
> 2 votes
# Crayon, ~~48~~ 46 bytes

```
"Happy Birthday to You
"4*q2Y15X"Dear¤Crayon"q

```

Try it online!

### Explanation

Crayon's output is built on a 2-dimensional "canvas", which makes it ideal for ASCII art challenges. Text is drawn with a "crayon", which is a sort of cursor that moves around the canvas. Here's how this program works:

```
"Happy Birthday to You
"                        Push this string to the stack.
 4*                      Repeat the string 4 times.
   q                     Draw the string at the crayon (at (0,0) by default).
    2Y15X                Move the crayon to the "to" in the third line.
         "Dear¤Crayon"q  Push this string and draw it at the crayon.
                         Implicit: Output canvas

```

The `¤` represents byte `\x1F`; Crayon does not distinguish between the two. By default, a space does not overwrite the character underneath, so `¤` exists as a sort of "overwriting space".

# Answer
> 2 votes
# Vim, ~~40~~ 36 bytes

```
4OHappy Birthday to You<esc>k2bCDear Vim

```

*4 bytes saved thanks to @DJMcMayhem by using `O` instead of `i...\n` and `k2bC` instead of `kd2bC`*

This uses a completely different approach to the previous Vim answer and hence I posted it as a separate answer. Outputs a trailing newline, but can be removed at the cost of one extra byte by using `Jk` instead of `k`.

Since V is reverse compatible with V, you can Try it online!

Take that CJam!

# Answer
> 2 votes
# ;#, 11644 bytes

```
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;#

```

Code generated by this brainfuck program

# Answer
> 2 votes
# Minecraft, 120 bytes

```
tellraw @a {"text":"Happy Birthday to You\nHappy Birthday to You\nHappy Birthday Dear Minecraft\nHappy Birthday to You"}

```

Can be run by pasting into a command block and supplying power to it, or pasting into the chat with a slash at the start.

# Answer
> 2 votes
# IDL (Interactive Data Language) – 47

Late entry (my first time here), but this looks like 3rd place after CJam and J!

Using IDL's Implied Print feature (since version 8.3), typing this at the command prompt:

```
'Happy Birthday '+[(u='to You'),u,'Dear IDL',u]

```

… will print the desired result to the console:

```
IDL> 'Happy Birthday '+[(u='to You'),u,'Dear IDL',u]
Happy Birthday to You
Happy Birthday to You
Happy Birthday Dear IDL
Happy Birthday to You

```

It works by creating (and implicitly printing) a four-element array, with `'Happy Birthday '` appended to each of the four desired endings, made more concise/cryptic by assigning a variable `u` the value `'to You'` in the first instance, and reusing it twice later!

# Answer
> 2 votes
# Brachylog, 52 bytes

```
"Happy Birthday to You"k₆,"Dear Brachylog"g,?,?↺,?ẉᵐ

```

Try it online!

-1 thanks to Fatalize.

# Answer
> 2 votes
# Unary, 2.715E2345 bytes

A string of zeroes with a length of `271544303753521374345784023617462447448766796991634195623271771343788064494033932467809637777433783261069835136468316635541569006957484008922172956907493623220358279584621153727394685316177875072717611870164011317998138133192412590581118711745080372132354520144049887264020357596958970682508119612069072184789433001139110110044141818883356102010044766108874743534376722033752443907309500308124800880956659496453762860029730933467190897780852535562502370486347488149358821225254933647032473098015846900520720300239993510123716590092279978630211422199772105659685365124211730629429856761187973769267382198582572968422104301126603859498501185917608874757741610893482041977003001381483481251619529628722427408338582339527157335234122942381275923949390605570564504822082772136057434464671123507495503027121245882553216512907124492451345153924551954324886539679044057026572440371334484657248811556813671966134409423451672608237773610848374597757496223902091127753821502096156978576733667670645804932685651998882744625271805968408192138003017383834286411465787825657955474390895833048578431020834761999769245058175985114327604667460675218915598066545717356728963407131382225834981689192053204022543453105950548359569307644293248265610511261123308873236361708287888512920927207140733264710153499926338085521461180344119631268486929440101264937117199882754841067458895376078972797675755102211602033168204711199744629239139853151734765325982327999734282103666604630769384354544377780974557091020653916122475973344426958326542939871981389127350485205414017350058299535652163085166091203298279054857159449355550278205308529995426116266317622349698148579685752377806473014344962213328458584663395562552762790574493037199848761427965675120816268240569132735553272845975553355819867289784427736974879735152861965319683108949477353673024614920892135291073944764379263817004591234093204928220689300382675729272978243082941205866127086587758323575891345926945843642967213885479373059430434109978135813970824413339027287055293233734939242557385167820253321966087885920624040254325137166864535273452145628538868866835395916784107310616214635120965693431403440614294637759561044455445706647271846433473546725069631283599186867863795122114084809385455487348989575611753135663244291563170055464760084089978670081473032469603515349502029160880861825869931824089974215244`

# Answer
> 2 votes
# Aceto, 57+1 for `-l` flag = 58 bytes

```
"Happy Birthday "ddd"to you"ddQJpnQJpn"Dear Aceto"QJpnsJp

```

Try it online!

```
"Happy Birthday "                           push that string
                 ddd                        duplicate three times
                    "to you"                   push that string
                            dd                    duplicate twice
                              Q                    Pull from bottom of stack
                               Jpn                 Join, print, & newline
                                  QJpn               pull from bottom, &Join,print&\n
                                      "Dear Aceto"        push that string
                                                  QJpn      Pull,Join,print,\n
                                                      sJp     swap, Join, and print
```

# Answer
> 2 votes
# Stax, 30 bytes

```
ï■σ∞úφ♂mê▌δ↓T┌C▒7w↓√éº┌│╦╫C∩█ï

```

Run and debug online!

## Explanation

Uses ASCII representation to explain:

```
`=%5#`GG`!0 ZrO"`GdG}`I#aq5J^oD}(`pQ

                    }                   Define a subroutine after the bracket
                     `I#aq5J^oD}(`      Push "Happy Birthday "
                                  p     Pop the string and print without newline
                                   Q    Peek the stack and print with newline

`=%5#`                                  Push "to You"
      GG                                Call the subroutine twice
        `!0 ZrO"`                       Push "Dear Stax"
                 G                      Call the subroutine
                  d                     Pop and discard "Dear Stax"
                   G                    Call the subroutine again

```

# Answer
> 2 votes
# , 56 bytes

```
cat("",u<-"to You
",u,"Dear R
",u,sep="Happy Birthday ")

```

Try it online!

The old `sep=` trick.

# Answer
> 2 votes
# brainfuck, 377 bytes

```
--->-->->>>>>->->>>>>>>>->-->>>->>>>-->->>>>->>>>>>>>>>+[-[>+++++++<-]<+++]>---->+>++>->+>+>++>--->++>>+>++>>->->++>--->->++>+>--->-->+>++>->++>>->+>--->->+>->>+>>++>->>++++[----[>+++++++<-]<++++]>---->--->+++>>+>+>+++>-->--->+>+++>-->>+++>>+++>-->+>-->>-->->>->+>->--->>+++>-->+>+++>>+>->-->->++>+++>--[++<++++]>>[.>]>[.>]<<[<<]>[.>]>[.>]<<[<<]>[.>]>[>]>[.>]<[[<]<]>>[.>]>[.>]

```

Try it online!

Most of the code sets up `"\nHappy Birthday \0to You\0Dear brainfuck"`. The last 64 instructions print it.

# Answer
> 2 votes
# C (gcc) and aplay, ~~360~~, ~~175~~, ~~167~~, 151 bytes

Generates the contents of a WAV file onto `stdout`, singing the melody of Happy Birthday. The output can then be piped to, for example, `aplay` to listen to it.

Including `-lm` causes a +4 to score.

Also, thanks to ceilingcat for golfing a couple dozen bytes.

```
c,i;main(t,T){for(;i<25;i++)for(t=T="$$(((0$$(((0$$((((($$(((0"[i]-32<<9;t--;)putchar(c=sin(exp("!!#!&%!!#!(&!!-*&%#++*&(&"[i]/17.-2)*t)*9*t/T+9);}

```

Try it online! (won't produce sound, duh...)

Now available on Clyp for listening. Amplified for convenience, may be *loud* and/or pop on some devices.

### Try it offline!

Compile and listen with `gcc -w src.c -lm && ./a.out | aplay`

### Degolf

```
c,i;
main(t,T) {
    for(;i<25;i++) // 25 notes of the song in the loop, 25 notes of the song
        for(t=T="$$(((0$$(((0$$((((($$(((0"[i]-32<<9; // Select number of samples
                t--;)
            // See below, this has been mutilated quite a bit to golf it.
            // Assign to c for implicit cast to int.
            // A small shortcut is made by only dampening the sine-part of the wave.
            putchar(c=sin(exp("!!#!&%!!#!(&!!-*&%#++*&(&"[i]/17.-2)*t)*9*t/T+9);
}

```

A sine wave is defined as \\$s(t)=A\cdot\sin 2\pi t\\$. A sine wave with frequency \\$f\\$ can thus be expressed as \\$s(ft)\\$. Now, in this case \\$\\{t\in\mathbb N \mid0\leq t \leq T \\}\\$ and \\$T:=n\cdot2^{11}\\$, so we have to divide \\$t\\$ with 2048, in order to make the signal function work. Our function is now \\$s(2^{-11}\cdot ft)\\$.

Since listing the frequencies would take a significant amount of bytes, I have encoded the frequencies as halfsteps relative to A4, represented by 40 or `(` in the string. The frequency is thus obtained \\$f=440Hz \cdot 2^{c-40\over12}\\$. Finally, putting it all together, adding in some dampening and ensuring outputs greater than zero, we get:

$$ f(t)= \Bigg({T - t\over T}\Bigg) \Bigg({A\over2}+{A\over2}\sin \Big({880 \pi t \cdot 2^{c-40\over12}\cdot2^{-11}} \Big)\Bigg) $$

$$ f(t)= \Bigg({T - t\over T}\Bigg) \Bigg({A\over2}+{A\over2}\sin \Big({880 \pi t \cdot \exp\Big({{c\ln 2-40\ln 2\over12} - 11 \ln 2}}\Big) \Big)\Bigg) $$

$$ f(t)= \Bigg({T - t\over T}\Bigg) \Bigg({A\over2}+{A\over2}\sin \Big({ t \cdot \exp\Big({{c\ln 2-40\ln 2\over12} - 11 \ln 2 + \ln 880 \pi}}\Big) \Big)\Bigg) $$

$$ f(t)\approx \Bigg({T - t\over T}\Bigg) \Bigg({A\over2}+{A\over2}\sin \Big({t \cdot \exp \Big({c\over17}-2\Big)} \Big)\Bigg) $$

And finally, we select \\${A\over2}=9\\$ to conserve bytes.

# Answer
> 2 votes
# International Phonetic Esoteric Language (IPEL), 96 or 60 bytes

I call this language both "International Phonetic Esoteric Language" and "IPEL". So, 2 answers:

```
"Happy Birthday ""to You"dbudbodbudbodbud"Dear International Phonetic Esoteric Language"odbudbod

```

```
"Happy Birthday ""to You"dbudbodbudbodbud"Dear IPEL"odbudbod

```

## Explanation

```
"Happy Birthday ""to You"dbudbodbudbodbud"Dear IPEL"odbudbod
"Happy Birthday ""to You"                                    (push strings)
                         dbudbodbudbo                        (print "Happy Birthday to You" twice)
                                     dbud"Dear IPEL"o        (print "Happy Birthday to [lang]")
                                                     dbudbod (one more "Happy Birthday to You")

```

# Answer
> 2 votes
# JavaScript (Node.js), 79 bytes

```
for(i=0;++i<5;)console.log(`Happy Birthday ${i==3?'Dear JavaScript':'to You'}`)

```

Try it online!

# Answer
> 2 votes
# Vyxal `j`, 30 bytes

```
`†‟ ¨ǎ to λ•`D:⌈2ẎṄ` βṄ ₴ŀ`+$W

```

Try it Online!

# Answer
> 2 votes
# PowerShell, 66 bytes

> *I was determined to beat Dave Neeley's answer of 71 bytes*

```
$h="Happy Birthday";($b="$h to You`r")*2;"$h Dear PowerShell`r";$b

```

Try it online!

# Answer
> 1 votes
**PHP - 87 80 78 chars**

```
<? $h="<br>Happy birthday ";$t="to you";$d="dear PHP";echo "$h$t$h$t$h$d$h$t";

```

I don't think that PHP is a good language for golfing, but I'm still practicing. And I love PHP :)

For the command line (strip off the short tags and replace the `<br>` with `\n`) **73 chars**:

```
$h="\nHappy birthday ";$t="to you";$d="dear PHP";echo "$h$t$h$t$h$d$h$t";

```

# Answer
> 1 votes
## PowerShell 79

```
$a = 'Happy Birthday '
$b = 'to You'
"$a$b`n$a$b`n$($a)Dear PowerShell`n$a$b"

```

# Answer
> 1 votes
## Railo CFML (79 characters)

```
for(i=1;i<5;i++){writeoutput("<br>Happy Birthday "&(i<>3?"to you":"dear CF"));}

```

## Just having some fun creating a ridiculous mess:

```
  variables.endings = ["H,a,p,p,y, ,B,i,r,t,h,d,a,y, ,t,o, ,y,o,u","H,a,p,p,y, ,B,i,r,t,h,d,a,y, ,t,o, ,y,o,u","H,a,p,p,y, ,B,i,r,t,h,d,a,y, ,d,e,a,r, ,C,o,l,d, ,F,u,s,i,o,n,n,n,n,n","H,a,p,p,y, ,B,i,r,t,h,d,a,y, ,t,o, ,y,o,u"];
  variables.iVerse = '';
  for (i = 1; i <= ArrayLen(variables.endings); i++) {
    variables.iLine = '';
    for (i2 = 1; i2 <= ListLen(variables.endings[i]); i2++) {
      iLine = iLine & ListGetAt(variables.endings[i],i2);
    }
    variables.iVerse = variables.iVerse & variables.iLine;
    if (i < ArrayLen(variables.endings)) {
      variables.iVerse = variables.iVerse & "<br />";
    }
  }

  writeOutput(variables.iVerse);

```

# Answer
> 1 votes
## Clojure : 87 chars

Golfed:

```
(let[h"Happy Birthday "s(str h"to You\n")t(str h"Dear Clojure\n")](print(str s s t s)))

```

Ungolfed:

```
(let [ h "Happy Birthday "
       s (str h "to You\n")
       t (str h "Dear Clojure\n") ]
(print (str s s t s)))

```

# Answer
> 1 votes
# C: 87

```
#define p(a)printf("Happy birthday %s\n",a?a:"to you");
main(){p(0)p(0)p("dear C")p(0)}

```

Demo

Compiles fine, but since it doesn't return, it might not exit correctly. If you want it to return 0, it'll cost another seven characters:

```
#define p(a)printf("Happy birthday %s\n",a?a:"to you");
main(){p(0)p(0)p("dear C")return!p(0)}

```

Demo

# Answer
> 1 votes
# Common LISP, 169 bytes

```
(defun birthday ()
   (princ "Happy Birthday to You")
   (princ "Happy Birthday to You")
   (princ "Happy Birthday dear Common LISP")
   (princ "Happy Birthday to You"))

```

**Output:**

```
Happy Birthday to You
Happy Birthday to You
Happy Birthday dear Common LISP
Happy Birthday to You

```

# Answer
> 1 votes
# Burlesque - 55 Characters

```
"Happy Birthday to You"4.*g_15.+"Dear Burlesque".+2iauN

```

Test it here.

# Answer
> 1 votes
**Python 85**

```
[print('Happy Birthday %s'%('dear Python' if x==2 else 'to you')) for x in range(4)]

```

# Answer
> 1 votes
# Cobra - 78

```
class P
    def main
        print (t=(l='Happy Birthday ')+'to You\n')+t+l+'Dear Cobra\n'+t

```

# Answer
> 1 votes
# Python 3 - 61

Based on @Falko's answer I made one for Python 3.3. I slightly improved his code by removing the space at the beginning of "Dear Python" and using the space between 'Birthday' and 'to'.

```
H="\nHappy Birthday to You"
print((H*3)[:60]+"Dear Python"+H)

```

Total number of characters is 60 61.(thanks for the recount @manatwork)

### Edit:

Two slightly different approaches, all with the same number of characters:

```
T="\nHappy Birthday to You"
print(T*2+T[:-6]+"Dear Python"+T)

```

or

```
print(T*2+T[:16]+"Dear Python"+T)

```

BTW: I would like to post this as a comment, but I do not have the rep.

# Answer
> 1 votes
# Befunge: 103

```
 >"yadhtriB yppaH"67+>:#,_1g:"0"-v
2^_@#-"0"g20p10-1,,,,,,," to You"_1+01p"egnufeB raeD ">:#,_"0"02p#
1

```

# Answer
> 1 votes
# J Script(63)

```
alert((a=(x="\nHappy Birthday ")+"to You")+a+x+"Dear JScript"+a)

```

Why J Script and not Java Script? -3 bytes:)

# Answer
> 1 votes
# Befunge, 90

Try it out here or here

```
4v>$"uoY ot"     v
v>0" yadhtriB yppaH" >:#,_$
< |-2\+49\0:
 v>"egnufeB raeD">:#,_$1-:!#@_

```

# Answer
> 1 votes
## C# (83)

```
using System;

for(int i=0;i<4;i++)Console.WriteLine("Happy Birthday "+(i!=2?"to You":"Dear C#"));

//Happy Birthday To You
//Happy Birthday To You
//Happy Birthday Dear C#
//Happy Birthday To You

```

Equally short (83 Bytes of code) is:

```
int i=0;while(i<4)Console.WriteLine("Happy Birthday "+(i++!=2?"to You":"Dear C#"));

```

# Answer
> 1 votes
# Bc: 62 characters

(This demonstrates the language's only golfing strength: string literals are displayed even without the `print` statement.)

```
while(i++<4){"Happy Birthday "
if(i-3)"To You
"else"Dear bc
"}

```

Sample run:

```
bash-4.3$ bc <<< 'while(i++<4){"Happy Birthday "
> if(i-3)"To You
> "else"Dear bc
> "}'
Happy Birthday To You
Happy Birthday To You
Happy Birthday Dear bc
Happy Birthday To You

```

# Answer
> 1 votes
## J : 53 bytes

```
'Dear J'(57+i.6)"_}'to You',"1~,~,:~'Happy Birthday '

```

`,"1~,~,:~` and `(57+i.6)"_` can probably be golfed further.

# Answer
> 1 votes
## Pascal (83) in maXbox

```
  const H='Happy Birthday to You';
  Speak(H+H+DelString(H,'to You')+'Dear Pascal'+H);

```

See more: https://github.com/maxkleiner/maXbox3/releases

# Answer
> 1 votes
## Clojure -- 79

```
(map #(println"Happy Birthday"%)(assoc(vec(repeat 4"to You"))2"Dear Clojure"))

```

# Answer
> 1 votes
# Clojure (~~104~~ 76 characters)

```
(let[h "Happy Birthday" t "to You\n"](print h t h t h "Dear Clojure\n" h t))

```

which prints

```
Happy Birthday to You
 Happy Birthday to You
 Happy Birthday Dear Clojure
 Happy Birthday to You

```

# Answer
> 1 votes
# Falcon: 61

```
for i in[:4]:>"Happy Birthday "+(i==2?"Dear Falcon":"to You")

```

# Answer
> 1 votes
# VBScript (75)

```
h="Happy Birthday "
l=vbLF
t="to You"&l
x=h&t
WScript.Echo x&x&h&"Dear VBS"&l&x

```

69 bytes if replacing `WScript.Echo` with `MsgBox` would be allowed.

# Answer
> 1 votes
**Rexx: 87**

```
p='a'x;h='Happy Birthday';i='to you';ooray='dear Rexx'p;!=h i;say h i p   h i p   h ooray !

```

Output:

```
Happy Birthday to you
 Happy Birthday to you
 Happy Birthday dear Rexx
 Happy Birthday to you

```

# Answer
> 1 votes
# C# (Full program) - 162

```
namespace O{class P{static void Main(string[] a){for(int i=0;i<4;)System.Console.Write("Happy Birthday {0}\n",++i==3?"Dear god why do I golf in C#?":"to you");}}}

```

# Answer
> 1 votes
**Javascript, 82**

Yet another different js entry

```
a='Happy Birthday %s';b='to You\n';console.log(a+a+a+a,b,b,'Dear Javascript\n',b)

```

# Answer
> 1 votes
# Delphi - 124 122 115

Another Delphi XE2 try, this time without a loop.

```
{$APPTYPE CONSOLE}const l=#13#10;y='to you'+l;h='Happy birthday ';d='dear Delphi'+l;begin
Write(h+y+h+y+h+d+h+y)end.

```

# Answer
> 1 votes
# Rant, ~~58~~ 54 chars

```
[r:4]{Happy Birthday [alt:[nth:3;Dear Rant];to You]\N}

```

Online Version

**How it Works:**

* `[r:4]` \- Sets repetitions of next block to 4.
* `[alt: ... ; ...]` \- Executes alternate code if a primary pattern prints nothing.
    + `[nth:3;Dear Rant]` \- Prints "Dear Rant" on the third iteration.
    + If the `nth` condition is not satisfied, the `alt` function prints `to You`.

# Answer
> 1 votes
**Intersystems Cache M, *(71)***

```
S X="Happy Birthday "
S Y="to You"
S Z="Dear M"
W X,Y,!,X,Y,!,X,Z,!,X,Y

```

Sample run...

```
USER>S X="Happy Birthday "

USER>S Y="to You"

USER>S Z="Dear M"

USER>W X,Y,!,X,Y,!,X,Z,!,X,Y
Happy Birthday to You
Happy Birthday to You
Happy Birthday Dear M
Happy Birthday to You

```

# Answer
> 1 votes
# C++, 107

Nice:

```
#include <iostream>
int main(){[](){}();//<-Good Luck Charm
    for (auto b : {false, false, true, false})
        std::cout << "Happy Birthday " << (b ? "Dear C++" : "To You") << '\n';
}

```

Golfed:

```
#include <iostream>
int main(){for(int b:"\0\0?")std::cout<<"Happy Birthday "<<(b?"Dear C++":"To You")<<'\n';}

```

# Answer
> 1 votes
# sh - 59

```
echo "${h=Happy Birthday }${y=to You}
$h$y
${h}Dear sh
$h$y

```

I thought this solution would be worth sharing too, even though there's a shorter one.

# Answer
> 1 votes
# K, 45 bytes

No one has sung Happy Birthday for everyone's favorite in-memory columnar database language? There, there:

```
`0:4 21#(57#"Happy Birthday to You"),"Dear K"

```

Very similar to the APL approach by @Moris Zucca- repeat the string `Happy Birthday to You` slightly more than two times and then glue on the `Dear K`. Reshaping into a 4x21 matrix repeats the initial line. In K, sending text to stdout requires the `0:` IO verb. Without it (for 3 fewer characters), we would print:

```
  4 21#(57#"Happy Birthday to You"),"Dear K"
("Happy Birthday to You"
 "Happy Birthday to You"
 "Happy Birthday Dear K"
 "Happy Birthday to You")

```

An alternate 47 character solution I considered was:

```
`0:("Happy Birthday ",("to You";"Dear K")2=)'!4

```

This is about as straightforward as it gets- map a function over the sequence `0 1 2 3` given by `!4`, select the second half of the verse based on whether this index is equal to 2, glue on the start of the verse and then print the whole list out.

# Answer
> 1 votes
# JMP/JSL, 67

Like the Mathematica example by David Carraher, this will 'sing' (...read) the Happy Birthday message to you out loud.

```
speak(x="\!nHappy Birthday";y=x||" to You";y||y||x||" Dear JSL"||y)

```

Output:

```
Happy Birthday to You
Happy Birthday to You
Happy Birthday Dear JSL
Happy Birthday to You

```

For 7 less bytes you will have the Happy Birthday message printed for you in the log

# Answer
> 1 votes
# SAS, 66 bytes

```
data;a='Happy Birthday';b=a||' to You';put b/b/a 'Dear SAS'/b;run;

```

# Answer
> 1 votes
# Lua - 72 bytes

Straightforward, but none of the other Lua programs work this way.

```
a,b,c='Happy Birthday ','to You\n','Dear Lua\n'io.write(a,b,a,b,a,c,a,b)

```

# Answer
> 1 votes
# \>\<\>, 157

```
v
\0&
v                                   <
\&:&2(?v
       >"Happy Birthday to you"a&1+&^
\"Happy Birthday dear ><>"a\
v  a"uoy ot yadhtriB yppaH"/
r
>l?!;o

```

Big, but I wanted it to be different from the Befunge answer.

# Answer
> 1 votes
# G\*, 76 bytes

G\* is a golfing language I made but it seems it failed miserably :P (Note that this isn't even close to my favorite language but I wanted to give it a try at code golf.)

```
l 2 p Happy birthday to you;p Happy birthday dear G*;p Happy birthday to you

```

Here's another (longer) one:

```
1=Happy birthday to you;@ 1;@ 1;p Happy birthday dear G*;p Happy birthday to you

```

# Answer
> 1 votes
## C#, 91 bytes

```
var s="Happy Birthday to You\n";System.Console.Write(s+s+s.Substring(0, 15)+"Dear C#\n"+s);

```

# Answer
> 1 votes
# beeswax, 66 chars

I created beeswax in December 2015. This solution is just for fun.

```
>`y Dear beeswax`5Np
pb"M`adhtriB yppaH`<3~4_
>`y To You`N~L;~   d

```

You can clone the beeswax interpreter, language specifications and instructions from my GitHub repository.

# Answer
> 1 votes
# Milky Way 1.6.5, 56 bytes

```
I"Happy Birthday ":"Dear Milky Way"+;"to You"+::>>J§{!}

```

---

### Explanation

```
I                                                        ` empty the stack
 "Happy Birthday "                                       ` push the string
                  :"Dear Milky Way"+                     ` make the 3rd line
                                    ;"to You"+::         ` make the 1st, 2nd and 4th lines
                                                >>       ` put the lines in order
                                                  J§{!}  ` print each line

```

---

### Usage

```
$ ./mw <path-to-code>

```

# Answer
> 1 votes
## F#, 76 bytes

```
for i=0 to 3 do printfn"Happy Birthday %s"<|if i=2 then"Dear F#"else"to You"

```

# Answer
> 1 votes
## Golisp, ~~102~~ 100 bytes

EDIT: Removed 2 bytes by changing the last `writeln` to `write`

```
write@*["Happy Birthday to You\n"2]writeln@"Happy Birthday Dear Golisp"write@"Happy Birthday to You"

```

Ungolfed & commented version:

```
write @ *["Happy Birthday to You\n" 2] # Call write with "Happy Birthday to You\n" repeated 2 times (f@x == f[x]) #
writeln @ "Happy Birthday Dear Golisp" # Write "Happy Birthday Dear Golisp" to stdout #
write @ "Happy Birthday to You" # Write "Happy Birthday to You" to stdout #

```

# Answer
> 1 votes
# Jelly, 31 bytes

```
“Ñƒẉ%VİỊ½żƒ»µ,;“©ʋ⁶ẓsŀKɗʠØ»,⁸¤Y

```

Try it online!

# Answer
> 1 votes
# Pushy, 44 bytes

Pushy doesn't actually have a string type. However, it has the command `"`, which interprets the current stack as a character list and prints it.

```
`Happy Birthday `V`to You`""F`dear Pushy`"F"

```

It's quite simple:

```
`Happy Birthday `      % Push chars
V                      % Copy into stack 2
`to You`               % Push chars
""                     % Print stack 1 twice ("Happy Birthday to You")
F                      % Go to stack 2
`dear Pushy`           % Push chars
"                      % Print stack ("Happy Birthday dear Pushy")
F"                     % Print other stack again to complete the song.

```

Basically, it uses the two stacks to construct the two needed strings, and prints them as it goes along. Here's the output:

```
$ pushy happybday.pshy

Happy Birthday to You
Happy Birthday to You
Happy Birthday dear Pushy
Happy Birthday to You

```

# Answer
> 1 votes
# PHP, ~~68~~ 65 bytes

There are already 4 PHP answers, most of them shorter than this, but none using this feature, so:

```
for(;$i++<4;)echo"
Happy Birthday ",["to You","Dear PHP"][$i==3];

```

Am I the only one noticing that there´s a comma missing?

# Answer
> 1 votes
# ZPL (Zebra Programming Language), 112 bytes

This is a just for fun answer.

```
^XA^FB137,4^FDHappy Birthday to You\&Happy Birthday to You\&Happy Birthday Dear ZPL\&Happy Birthday to You^FS^XZ

```

**Try It Online**

**Explanation:**

```
^XA                                # Start Format
    ^FB                            # Field Block
        137,                       # Width of text block line (in dots)
        4                          # Maximum number of lines in text block
    ^FD                            # Field Data
        Happy Birthday to You      # Hardcoded String
        \&                         # New Line (as allowed by the ^FB command)
        Happy Birthday to You      # Hardcoded String
        \&                         # New Line (as allowed by the ^FB command)
        Happy Birthday Dear ZPL    # Hardcoded String
        \&                         # New Line (as allowed by the ^FB command)
        Happy Birthday to You      # Hardcoded String
    ^FS                            # Field Separator
^XZ                                # End Format

```

**Note:** *The Zebra Programming Language is a printer control language that is not Turing complete.*

# Answer
> 1 votes
## COBOL, 185 Bytes

```
IDENTIFICATION DIVISION.
PROGRAM-ID. H.
PROCEDURE DIVISION.
PERFORM X.
PERFORM X.
DISPLAY 'Happy Birthday Dear COBOL'.
PERFORM X.
STOP RUN.
X.
DISPLAY 'Happy Birthday to You'.
STOP RUN.

```

I'm sure there is a shorter way but I don't know COBOL that well ;-)

# Answer
> 1 votes
# tcl, ~~69 68~~ 65

```
puts "[set t [set h Happy\ Birthday]\ To\ You]
$t
$h Dear tcl
$t"

```

demo

# Answer
> 1 votes
# VBA, 58 Bytes

Anonymous VBE immediate window function that takes no input and makes VBA sing its own happy birthday song, alone.

```
h="Happy Birthday ":t="to You":?h;t:?h;t:?h"Dear VBA":?h;t

```

# Answer
> 1 votes
# T-SQL, 78 bytes

```
SELECT a+b+a+b+a+c+a+b
FROM(SELECT'Happy Birthday 'a,'to You
'b,'Dear SQL
'c)t

```

SQL strings can include line breaks. If you are using SSMS, make sure to use "Results to Text" instead of "Results to Grid"

I used a different technique than the two excellent SQL answers already here:

If a *leading* newline is allowed (not mentioned in the rules or addressed in the comments), I can save one byte by moving the line break to the beginning of the 'Happy Birthday' string.:

```
SELECT a+b+a+b+a+c+a+b
FROM(SELECT'
Happy Birthday 'a,'to You'b,'Dear SQL'c)t

```

# Answer
> 1 votes
# AWK, 70 64 bytes

```
BEGIN{for(;++x<5;)print"Happy Birthday",x~3?"Dear AWK":"to You"}

```

Thanks for the suggestion @PedroMaimere :)

Try it online!

# Answer
> 1 votes
**REXX: 73 bytes**

```
n='Happy Birthday to You'
m='Happy Birthday Dear REXX'
say n
say n
say m
say n

```

**SAY** echoes the data and the output is

```
Happy Birthday to You
Happy Birthday to You
Happy Birthday Dear REXX
Happy Birthday to You

```

# Answer
> 1 votes
## Python 3, 74 bytes *i know it's too much*

```
b="Happy Birthday to You\n"
print(b+b+b.replace("to You","Dear Python")+b)

```

So like... I made the string, and then printed it, tore some off, added some more, and printed it. There ya go.

# Answer
> 1 votes
# Whitespace, 373 bytes

```
[N
S T S
N_Call_Label_to_You\n][N
S T
N_Call_Label_Happy_Birthday_][S S T T   S T T   T   S S N
_Push_-92_newline][S S T    T   N
_Push_-1_e][S S T   T   T   N
_Push_-3_c][S S T   T   S T N
_Push_-5_a][S S S T S T S N
_Push_10_p][S S S T T   S T N
_Push_13_s][S S T   T   N
_Push_-1_e][S S S T T   T   S N
_Push_14_t][S S S T T   N
_Push_3_i][S S S T  S N
_Push_2_h][S S T    T   T   T   T   N
_Push_-15_W][S S T  T   S S S T T   S N
_Push_-70_space][S S S T    T   S S N
_Push_12_r][S S T   T   S T N
_Push_-5_a][S S T   T   N
_Push_-1_e][S S T   T   S S S T S N
_Push_-34_D][N
S T
N_Call_Label_Happy_Birthday_][N
S T S
N_Call_Label_to_You\n][N
S T
N_Call_Label_Happy_Birthday_][N
S T S
N_Call_Label_to_You\n][N
S T
N_Call_Label_Happy_Birthday_][N
S S T   N
_Create_Label_LOOP][S S S T T   S S T   T   S N
_Push_102][T    S S S _Add][T   N
S S _Print_as_character][N
S N
T   N
_Jump_to_Label_LOOP][N
S S N
_Create_Label_Happy_Birthday_][S S T    T   S S S T T   S N
_Push_-70_space][S S S T    S S T   T   N
_Push_19_y][S S T   T   S T N
_Push_-5_a][S S T   T   S N
_Push_-2_d][S S S T S N
_Push_2_h][S S S T  T   T   S N
_Push_14_t][S S S T T   S S N
_Push_12_r][S S S T T   N
_Push_3_i][S S T    T   S S T   S S N
_Push_-36_B][S S T  T   S S S T T   S N
_Push_-70_space][S S S T    S S T   T   N
_Push_19_y][S S S T S T S N
_Push_10_p][S N
S _Duplicate_top][S S T T   S T N
_Push_-5_a][S S T   T   T   T   T   S N
_Push_-30_H][N
T   N
_Return][N
S S S N
_Create_Label_to_You\n][S S T   T   S T T   T   S S N
_Push_-92_newline][S S S T  T   T   T   N
_Push_15_u][S S S T S S T   N
_Push_9_o][S S T    T   T   S T N
_Push_-13_Y][S S T  T   S S S T T   S N
_Push_-70_space][S T    S S T   S N
_Copy_2nd_o][S S S T    T   T   S N
_Push_14_t][N
T   N
_Return]

```

Letters `S` (space), `T` (tab), and `N` (new-line) added as highlighting only.
`[..._some_action]` added as explanation only.

Try it online.

**Explanation in pseudo-code:**

```
Call function to_You\n
Call function Happy_Birthday_
Push values for "\necapsetihW raeD" (reversed of "Dear Whitespace\n") to the stack
Call function Happy_Birthday_
Call function to_You\n
Call function Happy_Birthday_
Call function to_You\n
Call function Happy_Birthday_
Start LOOP:
  Integer i = top value of the stack
  i = i + 102
  Print i as character to STDOUT
  Go to next iteration of LOOP

function Happy_Birthday_:
  Push values for " yadhtriB yppaH" (reversed of "Happy Birthday ") to the stack
  Return

function to_You\n:
  Push values for "\nuoY ot" (reversed of "to You\n") to the stack
  Return

```

Constant 102 was generated with this Java program, and used with this Whitespace tip of mine to print the text by putting the values reversed to the stack, and looping over them (adding the contant value, and printing them as character to the stack; which also exits as soon as we don't have any more values on the stack).

In addition, the functions with return are used to prevent duplicated code for the repeated parts of the output-text. And there were two more things to golf:

1. The value for the second `p` in `"Happy"` (which was `SSSTSTSN` \- push 10) has been replaced with `SNS` (duplicate top).
2. The value for the second `o` in `"to You"` (which was `SSSTSSTN` \- push 9) has been replaced with `STSSTSN` (copy 2nd \[1-indexed\]). (Relevant Whitespace tip of mine.)

# Answer
> 1 votes
# Pyth - ~~42~~ 40 bytes

```
J." y-÷\n3ª¼öj"K+J"to you"KK+J"dear Pyth"K

J." y-÷\n3ª¼öj"                            Assign J to "Happy Birthday "
               K+J"To you"                 Assign K to J + "to you"
                          KK               Print K twice
                            +J"dear Pyth"  Print J+"dear Pyth"
                                         K Print K

```

# Answer
> 1 votes
# 05AB1E, 29 bytes

```
”to€î”Ð”¬Ž 05AB1E”s)”ŽØ¢© ”ì»

```

Try it online!

```
”to€î”                 # dictionary string "to You"
      Ð                # triplicate
”¬Ž 05AB1E”            # dictionary string "Dear 05AB1E"
           s           # swap
            )          # wrap entire stack in an array
”ŽØ¢© ”                # dictionary string "Happy Birthday "
       ì               # prepend to each string in the array
        »              # join array by newlines

```

# Answer
> 1 votes
## Keg, 74 bytes

```
(2|Happy Birthday to You\
)
Happy Birthday Dear Keg\
Happy Birthday to You

```

# Answer
> 1 votes
# Stax, 28 bytes

```
▄Jÿø•2╜x!╨¬r├^↑#8╕Γ☺°7¿5⌠☻U▄

```

Run and debug it at staxlang.xyz!

I'm two weeks late. Alas. But it's short, at least...

### Unpacked (34 bytes) and explanation:

```
`/&tpz/b}"=J:J=P*``!0 ZrO"`n)ncLmT

`/&tpz/b}"=J:J=P*`                    Literal "Happy Birthday to You   "
                  `!0 ZrO"`           Literal "Dear Stax"
                           n          Copy the first line to the top of the stack
                            )         Overwrite end with "Dear Stax"
                             nc       Copy the first line twice more to the top
                               L      Collect stack in a list
                                mT    Print each, trimmed of trailing spaces, on its own line

```

If you're fine with those three trailing spaces, drop the `T` for 33 bytes unpacked. Still 28 packed, unfortunately.

# Answer
> 1 votes
## `d`, 34 bytes

Short language name to the rescue!

W is just 0.0833 years old but I'm still posting this ... Insanely long but oh well.

```
♣∙♥ª¬^╗Γë├ΦñtQOi▼!◙╖☼▓Φ◙ï╔♀EÞr!R╫J

```

## Explanation

```
4                                       E % Foreach in the range from 1 to 4:
 "Happy Birthday "                        % Append the string "Happy Birthday "
                  a3=                     % If this is the third line:
                     "Dear W"&            % Output "Dear W"
                              "to You"|   % Otherwise, output "to You"
                                       +  % Join the two strings.
                                          % Output a newline.

```

# Answer
> 1 votes
# **JavaScript (~~84~~ 76 bytes)**

```
x=`Happy Birthday To You\n`,alert(x+x+`Happy birthday Dear JavaScript\n`+x)
```

Output:

```
Happy Birthday To You
Happy Birthday To You
Happy Birthday Dear JavaScript
Happy Birthday To You

```

# Answer
> 1 votes
# ///, 46 bytes

```
/~/
Happy Birthday //-/~to You/--~Dear \/\/\/-

```

Try it online!

# Answer
> 1 votes
# Julia, 63 bytes

```
a="Happy Birthday To You\n";print(a^2*a[1:15]*"Dear Julia\n"*a)

```

Try it online!

# Answer
> 1 votes
# naz, 210 bytes

```
1x1f0m9a8m1o9a9a7a1o9a6a2o9a1o4d2a1o2d4m2a1o5d8m1a1o9a1o2a1o9s3s1o4s1o3s1o9a9a6a1o4d2a1o0x1x2f2d7m4a1o5s1o3d5s1o3m7s1o3d4m5s1o6a1o9d3s1o0x1f2f1f2f1f2m4a1o3d5m9s1o4s1o9a8a1o3d6s1o3m9a5a1o9s4s1o9a9a7a1o9d3s1o1f2f

```

I haven't had much time for code golf lately, but I had to get this challenge knocked out: at the time of writing, naz's GitHub repo was created exactly 1 year and a few minutes ago. Happy birthday, my child.

Output includes an extra trailing newline.

**Explanation** (with `0x` commands removed)

```
# Function 1
# Output "Happy Birthday "
1x1f0m9a8m1o9a9a7a1o9a6a2o9a1o4d2a1o2d4m2a1o5d8m1a1o9a1o2a1o9s3s1o4s1o3s1o9a9a6a1o4d2a1o
# Function 2
# Output "to You\n"
1x2f2d7m4a1o5s1o3d5s1o3m7s1o3d4m5s1o6a1o9d3s1o

1f2f1f2f1f                                                 # Output the first 2.5 lines
2m4a1o3d5m9s1o4s1o9a8a1o3d6s1o3m9a5a1o9s4s1o9a9a7a1o9d3s1o # Output "Dear naz\n"
1f2f                                                       # Output the last line

```

# Answer
> 1 votes
# Duocentehexaquinquagesimal, ~~433~~ 211 bytes

*-222 thanks to ovs.*

```
3∞н5Ćf–γúpïJ₂BΛ™H&¬¡ÌÿD"çÑ^oºvÄv»Ö{ž£&B#žà₆?àë”%₄J€Ba{‹Ƶiê)Jkí:¼Ω3ÃzjWÝ„|†rвávĀÜΛ°λöyÅÍ`mΣ×>K$λÜ—∍¯zÏΔ!#äy½´`в²!ÚÉ¡]5мô₃^Íp÷‰Ê)ûEîTº8E&sÙγüíθ4®₄ñтšиćÙA4ºÚIÜζ∍õ+¦ôι«$ι<yf·¶ê‹žƵ=v™>jg¥¢¦ŽнhΔÐŽÎΩć7∞ñè₄ćDç¥ƒ¨=ŽαxO,š

```

Try it online! This answer was posted on the same day that I created Duocentehexaquinquagesimal. Happy birthday!

# Answer
> 1 votes
# BRASCA, ~~72~~ 67 bytes

I really should add string compression...

```
l`uoY ot yadhtrib yppaH`58S[$:om{]xl`ACSARB raeD `L[$o{]x8p21S[$o{]

```

Try it online!

## Explanation

```
l`uoY ot yadhtrib yppaH`                                                 - Push "Happy birthday to You\n"
                        58S[$:om{]x                                      - Output it twice followed by "Happy birthday"
                                   l`ACSARB raeD `                       - Push " Dear BRASCA\n"
                                                  L[$o{]x                - Output it
                                                         8p              - Shift the stack so the top is "Happy birthday to You"
                                                           21S[$o{]      - Output that.

```

# Answer
> 1 votes
# Barrel, 112 bytes

All this jumping eats up the bytes, I'm afraid.

```
→1→2→3→1→2→3→1→4→3→1→2'!'!¤'Happy birthday'↑¤' to you'↑¤','¶↑¤', dear Barrel'↑

```

Basically, it defines a bunch of functions whose purpose is to implicitly print strings and calls them in the appropriate order before exiting. The second `!` (the first one is a string for ending the song) exits the program so that barrel doesn't continue executing the program. If the `!` were not there, barrel would implicitly print 'Happy birthday' and then exit, seeing that the  instruction doesn't have any more location pointers to pop, and therefore "pops" to the program that ran barrel.

# Answer
> 1 votes
# Quipu, ~~123~~ 115 bytes

```
'H'D't[][][]
'a'e'o/\/\/\
'p'a' 2&1&2&
'p'r'Y[][][]
'y' 'o/\/\/\
' 'Q'u
'B'u\n
'i'i/\
'r'p
't'u
'h\n
'd
'a
'y
'
/\

```

Try it online!

### Explanation

Each pair of columns in a Quipu program is a "thread." Execution proceeds from the top of each thread to the bottom, left to right from one thread to the next. Each thread also stores a value, which can be referenced by other threads.

* Thread 0 outputs `Happy Birthday`  with a trailing space and sets its value to that string.
* Thread 1 sets its value to `Dear Quipu` with a trailing newline.
* Thread 2 outputs `to You` with a trailing newline and sets its value to that string.
* Thread 3 outputs the value of thread 0, then outputs the value of thread 2.
* Thread 4 outputs the value of thread 0, then outputs the value of thread 1.
* Thread 5 outputs the value of thread 0, then outputs the value of thread 2.

# Answer
> 1 votes
# tinylisp, ~~120~~ 114 bytes

```
(load library
(d x(q(Happy Birthday
(d y(join(concat x(q(to You)))spc
y
y
(join(concat x(q(Dear tinylisp)))spc
y

```

Try it online!

# Answer
> 1 votes
# Zsh, 51 bytes

```
set Happy\ Birthday to You
<<.
$@
$@
$1 Dear zsh
$@

```

Attempt This Online!

Beats vanilla shell by one byte, despite having a one-byte longer name!

# Answer
> 1 votes
# Uiua, 45 bytes SBCS

```
⍥(&p⊂"Happy Birthday ")4.,"Dear Uiua""to You"

```

Try it online!

## Explanation

```
⍥(&p⊂"Happy Birthday ")4.,"Dear Uiua""to You"
                                     "to You" # push string "to You" to stack
                          "Dead Uiua"         # push string "Dear Uiua" to stack
                         ,                    # duplicate 2nd-to-top stack element
                        .                     # duplicate top stack element
⍥(                    )4                      # repeat this function 4 times:
     "Happy Birthday "                        # push string "Happy Birthday " to stack
    ⊂                                         # join end-to-end
  &p                                          # print to stdout with newline

```

# Answer
> 0 votes
# Golfscript, 56 bytes

Thanks, professorfish!

```
"Happy Birthday ":h"to You\n"+:s s h"dear Golfscript\n"s

```

Output:

```
Happy Birthday to You
Happy Birthday to You
Happy Birthday dear Golfscript
Happy Birthday to You

```

# Answer
> 0 votes
## JavaScript, 73

Run this in the console

```
for(h="",i=4;i;)h+='\nHappy Birthday '+(--i-1?'to You':'Dear JavaScript')

```

# Answer
> 0 votes
# PowerShell 92 (fixed)

```
$a="happy birthday to you";$a;$a;write-host -no  $a.TrimEnd('to you');"y dear powershell" ;$a

```

this one is longer than the other PS solution but is unique and actually out puts the correct string

## OLD -Powershell- - 62

```
$a="happy birthday to you";$a;$a;write "$a dear powershell";$a

```

# Answer
> 0 votes
# C++, 136

```
#include<iostream>
int main(){static int i=0;std::cout<<"Happy Birthday "<<(i==2?"Dear C++":"to You")<<std::endl;return ++i<4?main():0;}

```

# Answer
> 0 votes
# B - 109

(caveat: arguably not valid B, difficult to say - works with this)

```
main()v(4,"Happy Birthday to You   HDear B");v(i,s){s[5]=i&5?'u':134744072;s[6]=&-247;i?puts(s)&v(i-1,s):0;}

```

# Answer
> 0 votes
EcmaScript 6 - 64 о\_О

```
[1,1,0,1].map(i=>"Happy Birthday "+(i?"to you":"ES6")).join("\n")

```

# Answer
> 0 votes
## \>\<\> 76 Bytes

Since it wasn't here already...

```
0>"Happy Birthda"{1+:}3-?vv
v^?=1l<;?=5}:{a"uoY oT y"<>"y Dear ><>"a
>{{o} ^

```

# Answer
> 0 votes
# JS 70 Bytes

```
alert([c=(a="Happy Birthday")+" to You",c,a+" Dear JS",c].join("\n"));

```

# Answer
> 0 votes
# Swift, 68 bytes

```
(1...4).map{print("Happy Birthday "+($0==3 ?"dear Swift":"to You"))}

```

also differently:

```
print({$0+$1+$0+$1+$0+"dear Swift"+$0+$1}("\nHappy Birthday ","to You"))

```

with 71 bytes

# Answer
> 0 votes
# HPPPL (HP Prime Programming Language), 88

```
n:=char(10);a:="Happy Birthday ";b:="To You";c:="Dear HPPPL";d:=a+b+n;print(d+d+a+c+n+d)

```

Result:

HPPPL is the programming language for the HP Prime color graphing calculator/CAS. An emulator is available at the HP website.

# Answer
> 0 votes
# Sprects, 49 bytes

```
.12121Dear Sprects\n12.1Happy Birthday .2to You\n

```

Try it here

# Answer
> 0 votes
# Stringy, 78 bytes

```
(Happy birthday );a to you;p;p;^ to you!dear Stringy;p;^ dear Stringy!to you;p

```

# Answer
> 0 votes
# Mouse-2002, 70 bytes

Mouse isn't very skilled at . :(

```
$H"Happy Birthday "@
$Y"to you!"@
#H;#Y;#H;#Y;#H;"Dear Mouse!"#H;#Y;$

```

The exclamation points print newlines, not themselves, and the `$H` and `$Y` are functions, not variables, because poor Mouse can't comprehend strings.

## MUSYS, MUsic-SYStem, Mouse's predecessor, 93 bytes

```
"Happy Birthday to you!Happy Birthday to you!Happy birthday dear MUSYS!Happy Birthday to you"

```

# Answer
> 0 votes
# Staq, ~~67~~ 66 chars

```
{h"Happy Birthday "}{T"To You"}{D"Dear Staq"}{N&iiqi,;}hTNhTNhDNhT

```

Result:

```
Executing D:\codegolf\Happy Birthday Staq.staq

Happy Birthday To You
Happy Birthday To You
Happy Birthday Dear Staq
Happy Birthday To You

Execution complete.
>

```

# Answer
> 0 votes
# JavaScript, 70 Bytes

```
a="Happy Birthday ";b=a+"to You\n";c=a+b;d=c+c+a+"Dear JavaScript\n"+c

```

**Best answer JavaScript answer so far!**

```
a="Happy Birthday ";
b=a+"to You\n";
c=a+b;                         // Create string "Happy Birthday to You\n"
d=c+c+a+"Dear JavaScript\n"+c  // Create song

```

Implementation:

```
a="Happy Birthday ";b=a+"to You\n";c=a+b;d=c+c+a+"Dear JavaScript\n"+c
alert(d);
console.log(d);

```

# Answer
> 0 votes
# Edited Processing.js 80 bytes

```
var a="\nhappy birthday to you";print(a+a+"\nHappy birthday processing.js"+a);

```

Processing JS is a language that is fun but I am lazy and use an edited version that also is ungolfable. Try it online Println was used so you don't have to open the console :P

Khanacademy version

# Answer
> 0 votes
# C, 74 bytes

```
i=5;main(){while(--i)printf("Happy Birthday %s\n",i-2?"to You":"Dear C");}

```

**Detailed**

```
void main()
{
    int i = 5;

    while (--i > 0)
    {
        printf("Happy Birthday %s\n",
        i!=2 ? "to You" : "Dear C" );
    }
}

```

# Answer
> 0 votes
# C\C++ Preprocessor, ~~244~~ 224 bytes

**Live in C**

**Live in C++**

```
#define A "to"
#define B "You"
#define C "C"
#ifdef __cplusplus
#define C "C++"
#endif
#define D "Dear"
#define E "Happy Birthday"
#define H printf("%s %s %s \n",E,A,B)
int main(){H;H;printf("%s %s %s \n",E,D,C);H;return 0;}

```

# Answer
> 0 votes
## C++, 92 bytes

```
#include<iostream>
int main(int c){for(c=4;c--;)std::cout<<"Happy Birthday "<<(c-1?"To You":"Dear C++")<<"\n";}

```

Try it online

# Answer
> 0 votes
# Batch, 72 bytes

```
@SET h=@ECHO Happy Birthday
%h%to You
%h%to You
%h%Dear Batch
%h%to You

```

# Answer
> 0 votes
# Fourier, 52 bytes

```
|`Happy Birthday `|A|`to You
`|BABABA`Dear Fourier
`AB

```

**Try it online!**

Nothing particularly special except that it demonstrates that you can have newlines in string prints.

# Answer
> 0 votes
# Braingolf, 69 bytes

```
"Happy Birthday to You
"VR{.M}v&,6>[$_]"dear Braingolf
"R!&@!&@v&@c&@

```

Try it online!

## Explanation

```
"Happy Birthday to You
"

```

Pushes "Happy Birthday to You\n" to the stack

```
VR{.M}

```

Creates a 2nd stack and duplicates the contents of the first stack to it, in reverse order

```
v&,

```

Switches to the 2nd stack and flips the entire stack

```
6>[$_]

```

Drops the last 7 items from the 2nd stack

```
"dear Braingolf
"

```

Pushes "dear Braingolf\n" to the 2nd stack

```
R!&@!&@

```

Prints the contents of the first stack twice

```
v&@

```

Prints the contents of the 2nd stack

```
c&@

```

Prints the contents of the first stack

# Answer
> 0 votes
# Cubically, 813 bytes

I guess this belongs here now too! Loops haven't been added to the language yet, so this is the best I can manage.

```
+53@6:5+2/1+55@6:4/1+552@66+1@6:5/1+3@6/1+52@6:5+1/1+551@6+1@6:5+3/1+552@6:5/1+551@6:1/1+551@6:5+2/1+55@6:4/1+553@6:5/1+3@6:5+3/1+552@6:3/1+552@6:5/1+3@6:5+3/1+54@6:3/1+552@6:5+53@6:1/1+1@6:5+3@6:5+2/1+55@6:4/1+552@66+1@6:5/1+3@6/1+52@6:5+1/1+551@6+1@6:5+3/1+552@6:5/1+551@6:1/1+551@6:5+2/1+55@6:4/1+553@6:5/1+3@6:5+3/1+552@6:3/1+552@6:5/1+3@6:5+3/1+54@6:3/1+552@6:5+53@6:1/1+1@6:5+3@6:5+2/1+55@6:4/1+552@66+1@6:5/1+3@6/1+52@6:5+1/1+551@6+1@6:5+3/1+552@6:5/1+551@6:1/1+551@6:5+2/1+55@6:4/1+553@6:5/1+3@6+4@6:2/1+551@6:5+2/1+55@6:5+1/1+552@6:5/1+3@6:4/1+52@6:5+53@6:5+3/1+55@6:5+1/1+551@6:5+51@6:5+2/1+55@6:5+52@66:4/1+553@6:1/1+1@6:5+3@6:5+2/1+55@6:4/1+552@66+1@6:5/1+3@6/1+52@6:5+1/1+551@6+1@6:5+3/1+552@6:5/1+551@6:1/1+551@6:5+2/1+55@6:4/1+553@6:5/1+3@6:5+3/1+552@6:3/1+552@6:5/1+3@6:5+3/1+54@6:3/1+552@6:5+53@6

```

Try It Online!

# Answer
> 0 votes
# Pyth, 49 bytes

Since the other Pyth answer is quite outdated and *non-competing* has been removed per meta consensus, here is a newer answer:

```
K"Happy Birthday "J+K"to You\n"+*J2+K"Dear Pyth"J

```

**Try it online!**

# Pyth, 50 bytes

```
K+"Happy Birthday to You"b+++KK++<K15"Dear Pyth"bK

```

**Try it online!**

# Answer
> 0 votes
# SOGL V0.12, 29 bytes

```
‰║M─╬RS‘ūΖTtŗQQ"8Ν¼ģ^ļ&NZøe‘O

```

Try it Here!

# Answer
> 0 votes
## Canvas, 43 bytes

```
３［to You¶｝Dear Canvas¶）«∑Happy Birthday ４＊×

```

Try it online!

With notes (not valid code, as Canvas does not support comments):

```
３［to You¶｝                                      Push the string "to You\n" to the stack three times
            Dear Canvas¶                          Push the string "Dear Canvas\n" to the stack
                        ）                        Compress the stack to an array
                          «                       Shift the array once to the left
                           ∑                      Join all strings in the array to one string
                            Happy Birthday ４＊   Push the string "Happy Birthday " repeated four times vertically to the stack
                                               ×  Concatenate the second object in the stack to the first object in the stack
                                                  Print the object at the top of the stack (implicit)

```

# Answer
> 0 votes
# Add++, 55 bytes

```
L,"Happy Birthday "dddB]"To You"ddV"Dear Add++"GBCBcB+n

```

Try it online!

# Answer
> 0 votes
# Python 2, 82 Bytes

```
h="Happy Birthday";y='to You';d="Dear Python";print h,y,'\n',h,y,'\n',h,d,'\n',h,y

```

Still getting my head around slicing...

# Answer
> 0 votes
# Attache, 54 bytes

```
Print=>4&("Happy Birthday "+2&"To You"'"Dear Attache")

```

Try it online!

## Explanation

```
2&"To You"'"Dear Attache"
2&"To You"                  resizes "To You" into a 2-length array
          '"Dear Attache"   concatenate with "Dear Attache"

                            result: ["To You", "To You", "Dear Attache"]

"Happy Birthday "+_         Adds this string to each element
                            result: ["Happy Birthday To You", "Happy Birthday To You", "Happy Birthday Dear Attache"]

4&(_)                       Resizes the array to size 4
                            result: ["Happy Birthday To You", "Happy Birthday To You", "Happy Birthday Dear Attache", "Happy Birthday To You"]

Print=>_                    Prints each member on its own line

```

# Answer
> 0 votes
# jamal, 57 characters

```
{@for _(///dear jamal/0)Happy Birthday {@if/_/_/to You}
}

```

Sample run:

```
bash-4.4$ jamal.pl birthday.jam
Happy Birthday to You
Happy Birthday to You
Happy Birthday dear jamal
Happy Birthday to You

```

# Answer
> 0 votes
# Charcoal, 56 bytes

```
≔Happy Birthdayη≔ to YouτＰ⁺ητ↓Ｐ⁺ητ↓Ｐ⁺η”↶ G↗5▶h…≡-⌕”↓Ｐ⁺ητ

```

Try it online! (Link to the verbose version.)

It wasn't fair that Charcoal still hadn't its own birthday party...

# Answer
> 0 votes
# Noether, 54 bytes

```
"Happy Birthday "~s"to You"+~mP?P?sP"Dear Noether"P?mP

```

Try it online!

# Answer
> 0 votes
# MBASIC, 93 bytes

```
1 FOR I=1 TO 4:PRINT"Happy Birthday ";:IF I=3 THEN PRINT"Dear MBASIC"ELSE PRINT"to You"
2 NEXT

```

# Answer
> 0 votes
# MathGolf, 45 bytes

```
"Happy Birthday to You"·E<"Dear MathGolf"+\]n

```

Try it online!

# Answer
> 0 votes
# A0A0 - 309 bytes

```
A0A0
A0C3G1G1G1G1G1G1G1G1G1G1G1G1G1G1G1A0
A0P72P97P112P112P121P32P66P105P114P116P104P100P97P121P32G3A0
A0A1G-3G-3G-3G-3G-3G-3G-3G-3G-3G-3G-3G-3G-3G-3G-3A0
G-3
G1G4G7G4
A0A0
A0C3G1G1G1G1G1G1G1A0
A0P116P111P32P89P111P117P10G3A0
A0A1G-3G-3G-3G-3G-3G-3G-3A0
G-3
G-8G-8
P68P65
P101P48
P97P65
P114P48
P32P10
G-5G-14

```

## Explanation:

```
A0A0
A0C3G1G1G1G1G1G1G1G1G1G1G1G1G1G1G1A0
A0P72P97P112P112P121P32P66P105P114P116P104P100P97P121P32G3A0
A0A1G-3G-3G-3G-3G-3G-3G-3G-3G-3G-3G-3G-3G-3G-3G-3A0
G-3

```

Creates a loop which prints "Happy Birthday " and jumps every iteration.

```
G1G4G7G4

```

The positions the code should jump to each iteration.

```
A0A0
A0C3G1G1G1G1G1G1G1A0
A0P116P111P32P89P111P117P10G3A0
A0A1G-3G-3G-3G-3G-3G-3G-3A0
G-3

```

Creates a loop which will print "to you" and jumps out of the loop after each iteration.

```
G-8G-8

```

More positions to jump to, but this time for the second loop (also acts as a sort of counter, adding an additional `G-8` would print "Happy Birthday " one more time).

```
P68P65
P101P48
P97P65
P114P48
P32P10
G-5G-14

```

Prints "Dear A0A0" and jumps back to the first loop.

Test it here.

# Answer
> 0 votes
# Cubically, 251 bytes

```
⇒:4+@:5+2/1+55@+2S-0@@S'+1@f2/1+52@F+5@F'+1@:4/1+6255@U-1@U'/6+1*@S-0@S'+1/1*@f2
⇒:5/1+3@
⇒/6+6366@/4+552@f2/67+55@/3+552@B+1@B'/6+1@
f1f3f1f3f1//3+6635@/3+551@:5+2/1+55@/3+6552@f2+/3+165@-6+355@/6++++55@/3+6551@:1+55@:5+2/1+55@:2+55@@/6+61*@/6+1@f1f3

```

Try it online!

### Explanation:

First, second and third lines are functions.
First line prints "Happy Birthday " (note the trailing space)
Second line prints a space (to golf it down)
Third line prints "to You\n"

Fourth line is the program. It simply calls functions and prints "Dear Cubically\n" on the third line.

# Answer
> 0 votes
# Gol\>\<\>, 55 bytes

```
a"Happy birthday to you"3F6sK|6sR}a"Dear Gol><>"6sR{r~H

```

Voila, explanation coming soon!

Try it online!

# Answer
> 0 votes
# Stax, 33 bytes

```
Çÿ╣á╕♠½ß¡U¶[k╔╒j⌂?6▓╓○÷⌂I╬&⌂Γ╚?╟A

```

Run and debug it

# Answer
> 0 votes
# GolfScript, 49 bytes

Just a blatant port of the CJam answer.

```
"Happy Birthday to You
"...15<"Dear GolfScript
"@

```

Try it online!

# Answer
> 0 votes
# Wren, 78 bytes

I have forgotten about Wren so I'm trying to use it.

```
Fn.new{(1..4).map{|i|"Happy Birthday "+(i==3?"Dear Wren":"to You")}.join("
")}

```

Try it online!

# Answer
> 0 votes
# Scala, 59 bytes

```
print("Happy Birthday to You\n"*4 patch(59,"dear Scala",6))

```

Try it online!

# Answer
> 0 votes
# 05AB1E, 39 bytes

```
”ŽØ¢© ”“€„ “«”€î”«U,,”ŽØ¢©¬Ž 05AB1E”,X,

```

Try it online!

```
”ŽØ¢© ”“€„ “«”€î”«  # push "Happy Birthday to You"
U                   # store top of stack in variable X
,,                  # output top of stack twice
”ŽØ¢©¬Ž 05AB1E”     # push "Happy Birthday Dear 05AB1E"
,                   # output top of stack
X,                  # output X

```

# Answer
> 0 votes
# Sandwich, 64 bytes

```
lhHappy Birthday
lt$h to you
ld$h dear sandwich

p$t
p$t
p$d
p$t

```

---

Bit of a naive approach, but it works.

Explanation: Sandwich is comprised of opcodes. The first letter of each line is the opcode, and the rest of the characters of the line are the arguments that are passed to the opcode.

Above code with comments:

```
lhHappy Birthday # Create variable h and assign "Happy Birthday"
lt$h to you # Create variable t and assign "$h to you", which resolves to Happy Birthday to you
ld$h dear sandwich # Create variable d and assign "$h dear sandwich", which resolves to Happy Birthday dear sandwich

p$t # print out variable t
p$t
p$d # print out variable d
p$t

```

# Answer
> 0 votes
# Branch, 145 bytes

```
72/97Q/112/;/121N/32O/66/105/114P/116R/104T/100/q/n/oa[./]a\Br/111S/o/89/s/117/10b[./]a[./]b[./]a[./]b\68.101.q.p.o.66.p.q.110.99.t.10.a[./]b[./]

```

Try it on the online Branch interpreter!

# Answer
> 0 votes
# Deadfish~, 680 bytes

```
{i}ds{d}ic{ii}iiiiic{i}iiiiicc{i}dc{{d}i}ic{{i}ddd}ddddc{i}dddc{i}dciic{d}ddcddddcdddc{ii}iiiic{{d}i}ic{{i}dd}iiiicdddddc{{d}ii}ic{{i}d}dc{d}ciiiiiic{{d}d}iiic{iiiiii}iic{ii}iiiiic{i}iiiiicc{i}dc{{d}i}ic{{i}ddd}ddddc{i}dddc{i}dciic{d}ddcddddcdddc{ii}iiiic{{d}i}ic{{i}dd}iiiicdddddc{{d}ii}ic{{i}d}dc{d}ciiiiiic{{d}d}iiic{iiiiii}iic{ii}iiiiic{i}iiiiicc{i}dc{{d}i}ic{{i}ddd}ddddc{i}dddc{i}dciic{d}ddcddddcdddc{ii}iiiic{{d}i}ic{iiii}ddddc{iii}iiicddddc{ii}dddc{{d}ii}ddc{iiii}ddddc{iii}iiicddddciiiciiciiic{i}c{d}dc{ii}iic{{d}dd}iiiic{iiiiii}iic{ii}iiiiic{i}iiiiicc{i}dc{{d}i}ic{{i}ddd}ddddc{i}dddc{i}dciic{d}ddcddddcdddc{ii}iiiic{{d}i}ic{{i}dd}iiiicdddddc{{d}ii}ic{{i}d}dc{d}ciiiiiic

```

Try it online!

-18 thanks to @astonearachnid

# Answer
> 0 votes
# TypeScript's type system, 96 bytes

```
type F<A=`
Happy Birthday `,//@ts-ignore
B=`${A}to You`>=`${B}${B}${A}dear TypeScript Types${B}`

```

Try it at the TypeScript playground

Outputs with a leading newline.

Or, more elegantly but 3 bytes longer:

## TypeScript's type system, 99 bytes

```
type Z<S="to You">=`Happy Birthday ${S&string}
`
type F=`${Z}${Z}${Z<"Dear TypeScript Types">}${Z}`

```

Try it at the TypeScript Playground

Outputs with a trailing newline.

# Answer
> 0 votes
# Japt `-R`, ~~37~~ 36 bytes

```
4Æ`Happy Bir »y {XÍ?`  Y `:`De  Japt

```

Test it

-1 byte, thanks to Shaggy

Oliver's solution is very clever, this one is 2 bytes shorter but requires the `R` flag.

### Explanation

```
4Æ                 Map each X in [0,4) to:
  `Happy Bir »y {    "Happy Birthday " with the following appended:
     XÍ                take 2 - X
       ?`  Y `           nonzero -> "to You"
       :`De  Japt        zero -> "Dear Japt"
                   R flag: output the result joined by newlines.

```

# Answer
> 0 votes
# Windows Batch Scripting (88 bytes)

```
set "t=Happy Birthday to You"
set n=^&echo.
echo %t%%n%%t%%n%%t:to You=Dear Batch%%n%%t%

```

# Answer
> 0 votes
# Rust, 134 bytes

```
fn main(){let a=("Happy Birthday To you"," Dear Rust");for i in 1..3{println!("{}",a.0);}println!("{}{}",a.0,a.1);println!("{}",a.0);}

```

Ungolfed:

```
fn main(){
    let a = ("Happy Birthday To you", " Dear Rust");

for i in 1..3{
    println!("{}" ,a.0);
}

println!("{}{}" ,a.0, a.1);

println!("{}",a.0);
}

```

# Answer
> 0 votes
# Swift, 68 bytes

```
let t="to You"
[t,t,"Dear Swift",t].map{print("Happy Birthday "+$0)}

```

If you love Swift enough to let it compile a program without any `unused result` warnings for once (I know I do), then for 70 bytes:

```
let t="to You"
_=[t,t,"Dear Swift",t].map{print("Happy Birthday "+$0)}

```

# Answer
> -2 votes
# C# LinqPad, 103 bytes

```
Regex.Replace(String.Join("\n",Enumerable.Repeat("Happy Birthday to You",4)),"^((.*\n){2}.*)to.+","$1C#")

```

---
Tags: code-golf, string, kolmogorov-complexity
---