99 ways to say "I love you"

23

5

Inspired by this blog post.

Write a program that outputs 99 distinct programs (in the same language) that output the string I love you.

How the programs are separated from one another in the output will be defined by you. However, Each byte of output can only belong to at most 1 of the 99 programs.

Constraints for Output Programs

  1. If any string of characters is removed, then the program must not output I love you.
    e.g. console.log('I love you');;; is invalid because ;;; can be removed
  2. If any two strings of characters are both removed, then the program must not output I love you. This is to prevent inconsequential application of pairs of characters, that pass rule 1 because removing any single string will break the program.
    e.g. print((('I love you'))) is invalid, because (( and )) can be removed

There will be two categories of scoring to participate in.

  1. Standard code golf—smallest source code wins
  2. Combined code golf—smallest source code + output wins

Leaderboard

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

/* Configuration */

var QUESTION_ID = 198052; // 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>

Mason

Posted 2020-01-16T00:40:27.130

Reputation: 1 199

3Does the code have to be pristine (there is no way to produce the same result by removing any number of characters) or just following the constraints you mentioned? e.g. from Benji's program: would print(chr(207%134)) ... be allowed even if taking out 20, %1, and 4 would result in print(chr(73)) ... which yields the same result? – Zimonze – 2020-01-16T02:44:45.133

2Can we use functions instead of programs? – Jonah – 2020-01-16T03:08:22.430

11There must not exist a string of characters that, when removed, does not lead to Could that be rephrased to remove the two negations? I find it very confusing – Luis Mendo – 2020-01-16T07:33:04.477

@Zimonze just the rules above. In your example, it takes the removal of 3 strings of characters to be reduced, so it's still valid. – Mason – 2020-01-16T08:30:47.137

@LuisMendo I wrestled with the wording for this a decent amount, it seems to really want to be a double negative and that was the best wording I came up with. I'm open to suggestions (from anyone). – Mason – 2020-01-16T08:33:15.333

10These double negatives are killing my chance at understanding this question. Could this be reworded without the double negatives? – ouflak – 2020-01-16T09:15:32.433

7Perhaps try: "Your solution must fail to output I love you if you remove any one or two strings of characters. Removal of 3 or more strings of characters is not required to fail.". Then just copy the two examples. – Zizy Archer – 2020-01-16T09:58:59.573

Isn't this a [tag:metagolf] challenge? – manatwork – 2020-01-16T12:28:08.377

3I don't understand the rule However, Each byte of output can only belong to at most 1 of the 99 programs.. Can you clarify what you mean by that? – AdmBorkBork – 2020-01-16T13:48:18.180

@AdmBorkBork, I guess Mason tried to disallow solutions where there is 1 function declaration + 99 function calls. With the rule you quoted that would be counted 99 function declarations + 99 function calls, cutting the benefit of using such cheatish combination. – manatwork – 2020-01-16T13:59:22.833

1"How the programs are separated from one another in the output will be defined by you." Can be we have no separator? The output still contains all programs. – Kevin Cruijssen – 2020-01-16T15:14:54.383

@KevinCruijssen That seems to be how most answers are doing it, so it must be allowed – Cruncher – 2020-01-16T17:08:49.673

@KevinCruijssen you can do whatever you want as long as you can show where each program starts and ends – Mason – 2020-01-16T19:54:02.017

So each output program must consist of only 2.55 distinct bytes, on average? That's less than are in the "I love you" string itself. – user253751 – 2020-01-17T14:20:48.140

@user253751 If you look at the answers that's clearly not the case. Where are you getting that number from? – Mason – 2020-01-17T18:01:24.020

@Mason I bet that number comes from a misreading of “Each byte of output can only belong to at most 1 of the 99 programs”, and frankly I also have no idea what that rule means. Could you please clarify? – Lynn – 2020-01-17T23:35:34.760

3@Lynn It seems to mean that when the output is split up into programs no byte of output can be given to two programs, e.g. abcc cannot have both the programs abc and cc since the third byte belongs to two programs. It can much more clearly be said as programs do not overlap. – Post Rock Garf Hunter – 2020-01-19T05:38:20.637

Answers

18

JavaScript (JavaScript shell), 65 bytes

total: (64 + 3366 = 3450) bytes

for(i=99;i++<198;)print(`\\u0${i}="I love you";print(\\u{${i}})`)
\u0100="I love you";print(\u{100})
\u0101="I love you";print(\u{101})
\u0102="I love you";print(\u{102})
\u0103="I love you";print(\u{103})
\u0104="I love you";print(\u{104})
\u0105="I love you";print(\u{105})

It is trivial.

JavaScript allow escape sequence in variable name. console.lo\u0067('Hello world') is prefect valid. I don't think this feature is useful anyway. But...

No TIO link, since the TIO version is out-of-date. You may download JavaScript Shell from https://archive.mozilla.org/pub/firefox/releases/72.0.1/jsshell/ .


JavaScript (SpiderMonkey), 76 bytes

total: (76 + 2475 = 2551) bytes

for(i=99;i++<198;print(v+'="I love you";print('+v+')'))v=eval('"\\u0'+i+'"')

Try it online!

Output:

Ā="I love you";print(Ā)
ā="I love you";print(ā)
Ă="I love you";print(Ă)
ă="I love you";print(ă)
Ą="I love you";print(Ą)
ą="I love you";print(ą)

This one is shorter when counting total length. And it is much more trivial.


JavaScript (SpiderMonkey), 85 bytes

total: (86 + 36927 = 37013) bytes

for(n=99,p="(L='I love you')=>",q="print(L)";n--;p+='x=>')p='('+p,q+=')()',print(p+q)

Try it online!

Output:

((L='I love you')=>print(L))()
(((L='I love you')=>x=>print(L))())()
((((L='I love you')=>x=>x=>print(L))())())()
(((((L='I love you')=>x=>x=>x=>print(L))())())())()
((((((L='I love you')=>x=>x=>x=>x=>print(L))())())())())()

This is my original solution.

tsh

Posted 2020-01-16T00:40:27.130

Reputation: 13 072

1TIL SpiderMonkey has a print function – Mason – 2020-01-16T08:26:54.847

What's wrong with this 56 byter

– Expired Data – 2020-01-16T14:12:06.913

Note that your 86 bytes solution produces 100 programs, you can cut 1 byte using 99 (and that would remove this horrific longest last line) – Kaddath – 2020-01-16T14:18:19.470

1@ExpiredData _XY="I love you";print(_XY) can be reduced to _X="I love you";print(_X). – Arnauld – 2020-01-16T14:49:15.667

Ah I see thanks @arnauld – Expired Data – 2020-01-16T14:50:39.670

2What I meant is that the output programs are not pristine because the \ can be removed (e.g. u0100="I love you";print(u0100)). – Arnauld – 2020-01-17T01:37:37.283

1@Arnauld Ah, nice catch. Fixed by +1 byte (and switching to newer version. – tsh – 2020-01-17T01:58:56.513

9

Whitespace, 718 bytes, score: 34180 (33462+718)

[S S S T    N
_Push_1][S S S N
_Push_n=0][T    T   S _Store_1:n][N
S S S N
_Create_Label_LOOP][S S S T N
_Push_1][S N
S _Dupe_1][T    T   T   _Retrieve_1:n][T    S S S _Add][S N
S _Dupe_n+1][S S S T    T   S S T   S S N
_Push_100][T    S S T   _Subtract][N
T   S T T   N
_If_0_Jump_to_Label_EXIT_WITH_PRINT][S S S T    N
_Push_1][S N
T   _Swap][T    T   S _Store_1:n+1][S S S T N
_Push_1_newline][S N
S _Dupe_1_newline][S S S T  S T T   T   N
_Push_23_space][S S S T N
_Push_1_newline][S T    S S T   N
_Copy_0-based_1st_23_space][S N
S _Dupe_23_space][S S S T   N
_Push_1_newline][S S S N
_Push_0_tab][S T    S S T   S N
_Copy_0-based_2nd_23_space][S N
S _Dupe_23_space][S N
S _Dupe_23_space][S S S N
_Push_0_tab][S T    S S T   N
_Copy_0-based_1st_23_space][S N
S _Dupe_23_space][S N
S _Dupe_23_space][S S S N
_Push_0_tab][N
S T N
_Call_Subroutine_PUSH_INTEGER][S S S N
_Push_0_tab][S N
S _Dupe_0_tab][S N
S _Dupe_0_tab][N
S T N
_Call_Subroutine_PUSH_INTEGER][S S S T  N
_Push_1_newline][S S S T    S T T   T   N
_Push_23_space][S N
S _Dupe_23_space][S S S T   N
_Push_1_newline][S N
S _Dupe_1_newline][S T  S S T   S N
_Copy_0-based_2nd_23_space][S S S N
_Push_0_tab][S N
S _Dupe_0_tab][S T  S S T   S N
_Copy_0-based_2nd_23_space][S N
S _Dupe_23_space][S S S N
_Push_0_tab][S N
S _Dupe_0_tab][S T  S S T   S N
_Copy_0-based_2nd_23_space][S N
S _Dupe_23_space][S S S T   N
_Push_1_newline][S T    S S T   N
_Copy_0-based_1st_23_space][S N
S _Dupe_23_space][S S S N
_Push_0_tab][S T    S S T   N
_Copy_0-based_1st_23_space][S N
S _Dupe_23_space][S S S N
_Push_0_tab][S T    S S T   N
_Copy_0-based_1st_23_space][S S S T N
_Push_1_newline][S S S N
_Push_0_tab][S N
S _Dupe_0_tab][S N
S _Dupe_0_tab][S T  S S T   S S N
_Copy_0-based_4th_23_space][S N
S _Dupe_23_space][S S S T   N
_Push_1_newline][S T    S S T   N
_Copy_0-based_1st_23_space][S N
S _Dupe_23_space][S N
S _Dupe_23_space][S S S T   N
_Push_1_newline][S S S N
_Push_0_tab][S N
S _Dupe_0_tab][S N
S _Dupe_0_tab][S T  S S T   S S N
_Copy_0-based_4th_23_space][S N
S _Dupe_23_space][S N
S _Dupe_23_space][S S S T   N
_Push_1_newline][S T    S S T   N
_Copy_0-based_1st_23_space][S S S N
_Push_0_tab][S T    S S T   N
_Copy_0-based_1st_23_space][S S S N
_Push_0_tab][S N
S _Dupe_0_tab][S T  S S T   S N
_Copy_0-based_2nd_23_space][S N
S _Dupe_23_space][S S S T   N
_Push_1_newline][S S S N
_Push_0_tab][S N
S _Dupe_0_tab][S N
S _Dupe_0_tab][S N
S _Dupe_0_tab][S T  S S T   S T N
_Copy_0-based_5th_23_space][S N
S _Dupe_23_space][S S S N
_Push_0_tab][S N
S _Dupe_0_tab][S T  S S T   S N
_Copy_0-based_2nd_23_space][S N
S _Dupe_23_space][S S S T   N
_Push_1_newline][S T    S S T   N
_Copy_0-based_1st_23_space][S S S N
_Push_0_tab][S T    S S T   N
_Copy_0-based_1st_23_space][S S S N
_Push_0_tab][S T    S S T   N
_Copy_0-based_1st_23_space][S N
S _Dupe_23_space][S N
S _Dupe_23_space][S S S T   N
_Push_1_newline][S T    S S T   N
_Copy_0-based_1st_23_space][S N
S _Dupe_23_space][S N
S _Dupe_23_space][S S S T   N
_Push_1_newline][S T    S S T   N
_Copy_0-based_1st_23_space][S S S N
_Push_0_tab][S N
S _Dupe_0_tab][S T  S S T   S N
_Copy_0-based_2nd_23_space][S N
S _Dupe_23_space][S N
S _Dupe_23_space][S N
S _Dupe_23_space][S S S N
_Push_0_tab][S N
S _Dupe_0_tab][S N
S _Dupe_0_tab][S T  S S T   T   N
_Copy_0-based_3rd_23_space][S N
S _Dupe_23_space][S S S N
_Push_0_tab][N
S T N
_Call_Subroutine_PUSH_INTEGER][S S S T  N
_Push_1_newline][S S S N
_Push_0_tab][S N
S _Dupe_0_tab][S N
S _Dupe_0_tab][S N
S _Dupe_0_tab][S S S T  S T T   T   N
_Push_23_space][S S S N
_Push_0_tab][S N
S _Dupe_0_tab][S T  S S T   S N
_Copy_0-based_2nd_23_space][S N
S _Dupe_23_space][S N
S _Dupe_23_space][N
S T N
_Call_Subroutine_PUSH_INTEGER][N
S N
S N
_Jump_to_Label_LOOP][N
S S T   T   N
_Create_Label_EXIT_WITH_PRINT][S N
N
_Discard_n][N
S S T   N
_Create_Label_PRINT_LOOP][S S S T   S S T   N
_Push_9][T  S S S _Add][T   N
S S _Print_as_character][N
S N
T   N
_Jump_to_Label_PRINT_LOOP][N
S S N
_Create_Subroutine_PUSH_INTEGER][S S S T    N
_Push_1_newline][S S S N
_Push_0][S S S T    N
_Push_1][T  T   T   _Retrieve_1:n][T    T   S _Store_0:m][N
S S S S N
_Create_Label_TAB_LOOP][S S S N
_Push_0_tab][S N
S _Dupe_0][S N
S _Dupe_0][T    T   T   _Retrieve_0:m][S S S T  N
_Push_1][T  S S T   _Subtract][S N
S _Dupe_m-1][N
T   S S T   N
_If_0_Jump_to_Label_DONE_WITH_TAB_LOOP][T   T   S _Store_0:m-1][N
S N
S S N
_Jump_to_Label_TAB_LOOP][N
S S S T N
_Create_Label_DONE_WITH_TAB_LOOP][S S S T   S T T   T   N
_Push_23_space][S N
S _Dupe_23_space][S N
S _Dupe_23_space][N
T   N
_Return_from_Subroutine_PUSH_INTEGER]

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

Try it online (with raw spaces, tabs and new-lines only).

The output Whitespace programs are output without delimiter. Each program will be as follows, where the x is variable in the range [3,102].

[S S S (x_amount_of_T   )N
_Push_n][S S S T    T   S T T   T   T   N
_Push_constant_111][S S S (x_amount_of_T    )N
_Push_n][T  S S T   ][T T   S _store][S S S T   T   S N
_Push_6_u][S S S N
_Push_0_o][S S S T  S T S N
_Push_10_y][S S T   T   S S T   T   T   T   N
_Push_-79_space][S S T  T   S T S N
_Push_-10_e][S S S T    T   T   N
_Push_7_v][S S S N
_Push_0_o][S S T    T   T   N
_Push_-3_l][S T S S T   S S N
_Copy_0-based_4th_-79_space][S S T  T   S S T   T   S N
_Push_-38_I][N
S S N
_Create_Label_LOOP][S S S (x_amount_of_T    )N
_Push_n][T  T   T   _Retrieve][S S S (x_amount_of_T )N
_Push_n][T  S S S _Add][T   S S S _Add][T   N
S S _Print_as_character][N
S N
N
_Jump_to_Label_LOOP]

In the 1st program, x will be 3, so the four Push n parts will push the integer 7 (binary 111; three 1-bits); in the 15th program, x will be 18, so the four Push n parts will push the integer 262143 (binary 111111111111111111; eighteen 1-bits); etc. up to 5070602400912917605986812821503 (binary with 102 1-bits).

Try it online for the 15th program (with raw spaces, tabs and new-lines only).

I've used this Whitespace tip of mine to print the output I love you. The optimal constant 111 is generated by this Java program. In addition, I use one copy for the space to save bytes.

I've also used this same tip with a constant 9 in the generator program to output the Whitespace sub-programs. After that I've used loads of duplicates, as well as copies for the spaces where possible.

Explanation in pseudo-code:

Generator program:

Store n=0 at heap-address 1
Start LOOP:
  Retrieve n from heap-address 1
  n = n + 1
  If(n == 100):
    Call function EXIT_WITH_PRINT
  Store the updated n+1 at heap-address 1
  Push the codepoints of "NNSNSSNTSSSTSSST" minus 9 for the output program
  Call subroutine PUSH_INTEGER
  Push the codepoints of "TTT" minus 9 for the output program
  Call subroutine PUSH_INTEGER
  Push the codepoints of "NSSNNSTTSSTTSSNSSTSSTSNTTTSSNSSSNTTTSSSNSTSTTSSNTTTTSSTTSSNSTSTSSSNSSSNSTTSSSSTTTSST" minus 9 for the output program
  Call subroutine PUSH_INTEGER
  Push the codepoints of "NTTTTSTTSSS" minus 9 for the output program
  Call subroutine PUSH_INTEGER
  Go to the next iteration of LOOP

Function EXIT_WITH_PRINT:
  Discard n that was still on the top of the stack
  Start PRINT_LOOP:
    Add 9 to the value at the top of the stack
    Pop and print it as character
    (this will fail with an error since there is nothing more to pop, when we're done with
     the final character to stop the program)
    Go to the next iteration of PRINT_LOOP

Subroutine PUSH_INTEGER:
  Push the codepoint of "N" minus 9 for the output program
  Retrieve n from heap-address 1
  Integer m = n
  Store m at heap-address 0
  Start TAB_LOOP:
    Push the codepoint of "T" minus 9 for the output program
    Retrieve m from heap-address 0
    m = m - 1
    If(m == 0):
      Call function DONE_WITH_TAB_LOOP
    Store m-1 at heap-address 0
    Go to next iteration of TAB_LOOP

  Function DONE_WITH_TAB_LOOP:
    Push the codepoints of "SSS" minus 9 for the output program
    Return to the caller of the PUSH_INTEGER subroutine, and continue from there

Sub-program:

Variable as explained before is integer n (which has x amount of binary 1-bits).

Integer t = 111 - n
Store t at heap-address n
Push the codepoints of "uoy evol I" minus 111
Start LOOP:
  Retrieve t from heap-address n
  t = t + n
  Add t (which is 111 again) to the value at the top of the stack
    Pop and print it as character
    (this will fail with an error since there is nothing more to pop, when we're done with
     the final character to stop the program)
    Go to the next iteration of LOOP

Since we use the variable n four times (t = 111-n; store t at heap-address n; retrieve t from heap-address n; t = t+n) with other pieces of relevant code in between the pushes, we need to remove four string-sequences in order to still have a valid I love you output, complying to the rule stating you can't remove one or two string-sequences.

Kevin Cruijssen

Posted 2020-01-16T00:40:27.130

Reputation: 67 575

7

JavaScript (Node.js), 81 bytes

Output: 4275 bytes

for(n=100;--n;)console.log(`console.log('I lo'+Buffer([${n}^${118^n}])+'e you')`)

Try it online!

Arnauld

Posted 2020-01-16T00:40:27.130

Reputation: 111 334

6

Batch, 131 + 3564 bytes

@for %%a in (a b c d e f g h i j k)do @for %%b in (. / \ "," ";" [ ] + "=")do @echo @for %%%%%%a in (love)do @echo%%~bI %%%%%%a you

This produces 99 variants of the same code:

@for %%k in (love)do @echo=I %%k you

The for variable (here k) loops over the 11 values a to k, while the other character that changes is the separator after echo, which can usually (as here) be any of 11 characters, but five of them need quoting to use in a for command, so I've omitted space and (. The programs are all irreducible because they need to get the word love to appear in the output.

Neil

Posted 2020-01-16T00:40:27.130

Reputation: 95 035

? @for /L %k in (1 1 99) do @echo @set a%k=I love you^&^&echo %a%k% – mazzy – 2020-01-18T20:03:59.657

@mazzy That doesn't produce irreducible programs. – Neil – 2020-01-18T21:22:16.347

1@mazzy Additionally, the programs don't even work since variable expansion happens at parse time by default. – Neil – 2020-01-18T21:23:44.840

5

Python 3, 86 bytes

86 code + 10289 output = 10375 total

x=0
while x<99:print(f"print(chr(len('{(bin(x)[2:8]).zfill(73)}'))+' love you')");x+=1

sample segment of output: print(chr(len('0000000000000000000000000000000000000000000000000000000000000000000110000'))+' Love you')

Benji

Posted 2020-01-16T00:40:27.130

Reputation: 61

@Arnauld It does... I'll see if I can fix that – Benji – 2020-01-16T02:32:26.890

You might want to look carefully at the first line of your sample segment of output... There are two strings which can be removed to leave 73 in the char(). – Zimonze – 2020-01-16T03:34:13.553

2There is also 100-90 which can be simply 10. – Bubbler – 2020-01-16T03:42:11.323

I think I have finally made it so that if any character(s) are removed, it will break.(I'm new to code-golf, so thanks for the help) – Benji – 2020-01-16T14:04:06.857

1

This currently outputs only 98 programs. Suggested 77-byte version, with a shorter output.

– Arnauld – 2020-01-16T14:58:47.027

This solution is expandable all the way until needing to output 9444732965739290427392 different programs. Awesome! – Cruncher – 2020-01-16T16:43:27.763

@Arnauld you can save byte in your shortened solution by using x=16 and x<115 which is addition of 2 characters. But you get to remove +16 so you net save 1 character – Cruncher – 2020-01-16T16:48:48.600

@Arnauld Another 2 bytes savings by removing the parens around hex(x) – Cruncher – 2020-01-16T17:24:01.957

{(bin(x)[2:8]).zfill(73)} -> {bin(x)[2:].zfill(73)} save 3 bytes – tsh – 2020-01-17T02:42:30.217

Love should not be capitalised – Jo King – 2020-01-20T02:28:16.217

5

C (clang), 87 \$\cdots\$ 160 120 bytes

Output: 3822 bytes (Total: 3942 bytes)

i;main(j){for(;i<99;printf("main(){printf(\"%%c Love You\",%d^%d);}\n",j,j^73))j=3+i++*4,j=strchr("$,2MOPW]_",i)?6*j:j;}

Try it online!

Fixed pristine-errors kindly pointed out by Expired Data.
Fixed pristine-errors kindly pointed out by Kaddath.
Saved 50 bytes thanks to gastropner!!!

Prints 99 unique lines like:

main(){printf("%c Love You",3^74);}

Noodle9

Posted 2020-01-16T00:40:27.130

Reputation: 2 776

main(){printf("%c Love You",73^0);} can be reduced – Expired Data – 2020-01-16T14:28:39.083

1@ExpiredData Quite right! Was just fixing that as you commented! :-) – Noodle9 – 2020-01-16T14:30:56.507

can't 347^274 be reduced to 3^74 by removing 47 and 2? – Kaddath – 2020-01-16T15:13:54.383

@Kaddath Wrote a Python program to test all possible extractions of 2 strings from all the x^ys for equality to 73. Have now fixed those errors. Thanks for pointing them out! :-) – Noodle9 – 2020-01-16T20:47:33.777

With the power of strings, you can get it down to 120 bytes.

– gastropner – 2020-01-16T21:46:44.720

@gastropner That's blown my mind!!! I Love You :-) – Noodle9 – 2020-01-16T21:51:57.650

4

PHP, 96 bytes

Output: 2516 bytes (total 2612)

<?php for(;($i+=2)<773;)if($i<99||--$i%100>67&&$i>299)echo"I<?=chr(".(33+$i++)."-$i)?>love you";

Try it online!

Example program:

I<?=chr(35-3)?>love you

Still quite new at code golf, hope I get this right. Wanted to encode the space as 32 is the lowest number and wanted to do something else than port an existing answer. Got me into troubles with the 2 strings removing part, but I think this time it passes

(Edit: one line was missing, programs count was 98) (Edit2: separator is now :, as - was in the code, and total count was wrong)

Edit3: This time I think it's OK (got much more complicated than planned):

  • I had to remove all the intervals of the form x99-x67 that can be reduced by removing the x's
  • Had also to remove all the interval of the form 3xx-2xx that can be reduced by removing the xx- and xx
  • Tried to keep only --$i%100>67&&$i>299 as a condition but unfortunately it goes to 1003-971 and a bit beyond that all can be reduced to the form 103-71
  • new code is manupulating $i with -- and ++ to avoid to add prenthesis and do ($i-1)%100>67 in test and "-".($i-1).") in display
  • no separator anymore, as per a question's comment
  • removed the space after echo (thanks to @Ismael Miguel answer)

Kaddath

Posted 2020-01-16T00:40:27.130

Reputation: 449

4

05AB1E, 23 bytes (combined score 1688 bytes)

тGN"•«À¢ÒÙΓʒγ•"тN-…O₃BJ

Try it online! or try one of the output programs.

тG                       # for N from 1 to 99:
  N                      #  N
   "•«À¢ÒÙΓʒγ•"          #  string "•«À¢ÒÙΓʒγ•"
               тN-       #  100 - N
                  …O₃B   #  "O₃B"
                      J  #  join the entire stack

Each subprogram looks like:

1                       # 1 (N)
 •«À¢ÒÙΓʒγ•             # compressed integer 11971423964735158206
           99           # 99 (100 - N)
             O          # sum the entire stack
              ₃B        # convert to base 95

Grimmy

Posted 2020-01-16T00:40:27.130

Reputation: 12 521

@downvoter care to explain what's wrong with this answer? – Grimmy – 2020-01-20T17:05:18.293

3

Keg, 33 bytes

Programs separated by :

Output is 1385 bytes

в&(c|&:&I+,&:&,`- love you:`,⑹

Try it online!

Programs:

ѻв- love you:Ѽг- love you:ѽд- love you:Ѿе- love you:ѿж- love you:Ҁз- love you:ҁи- love you:҂й- love you:҃к- love you:҄л- love you:҅м- love you:҆н- love you:҇о- love you:҈п- love you:҉р- love you:Ҋс- love you:ҋт- love you:Ҍу- love you:ҍф- love you:Ҏх- love you:ҏц- love you:Ґч- love you:ґш- love you:Ғщ- love you:ғъ- love you:Ҕы- love you:ҕь- love you:Җэ- love you:җю- love you:Ҙя- love you:ҙѐ- love you:Қё- love you:қђ- love you:Ҝѓ- love you:ҝє- love you:Ҟѕ- love you:ҟі- love you:Ҡї- love you:ҡј- love you:Ңљ- love you:ңњ- love you:Ҥћ- love you:ҥќ- love you:Ҧѝ- love you:ҧў- love you:Ҩџ- love you:ҩѠ- love you:Ҫѡ- love you:ҫѢ- love you:Ҭѣ- love you:ҭѤ- love you:Үѥ- love you:үѦ- love you:Ұѧ- love you:ұѨ- love you:Ҳѩ- love you:ҳѪ- love you:Ҵѫ- love you:ҵѬ- love you:Ҷѭ- love you:ҷѮ- love you:Ҹѯ- love you:ҹѰ- love you:Һѱ- love you:һѲ- love you:Ҽѳ- love you:ҽѴ- love you:Ҿѵ- love you:ҿѶ- love you:Ӏѷ- love you:ӁѸ- love you:ӂѹ- love you:ӃѺ- love you:ӄѻ- love you:ӅѼ- love you:ӆѽ- love you:ӇѾ- love you:ӈѿ- love you:ӉҀ- love you:ӊҁ- love you:Ӌ҂- love you:ӌ҃- love you:Ӎ҄- love you:ӎ҅- love you:ӏ҆- love you:Ӑ҇- love you:ӑ҈- love you:Ӓ҉- love you:ӓҊ- love you:Ӕҋ- love you:ӕҌ- love you:Ӗҍ- love you:ӗҎ- love you:Әҏ- love you:әҐ- love you:Ӛґ- love you:ӛҒ- love you:Ӝғ- love you:ӝҔ- love you:

Lyxal

Posted 2020-01-16T00:40:27.130

Reputation: 5 253

To my understanding, separator : isn't count into the byte count. So, output should be count as 1385 bytes. – tsh – 2020-01-16T10:23:53.107

3

05AB1E, 34 31 30 28 25 bytes

Combined Score: very very big (25 + no. permutations of "I love you"*20)

-3 bytes thanks to @KevinCruijssen

…I„΀v'"y'""œ{•B‹<•è"J

Try it online!


Optimised for Combined Score

05AB1E, 32 30 27 bytes

Combined Score: 27 + 1980 = 2007

…I„΀îœт£¦v'"y'""œ{•B‹<•è"J

Try it online!

This may take a while to run...


Explanation

…I„Î€î                       # Compressed string "I love you" 
      œ                      # Get the permutations of this string 
       ¦                     # Remove the first one ("I love you")
        v                    # loop over these and do...
         '"y'"               # the string with the value in (e.g. "I love yuo"
              "œ{•B‹<•è"     # string literal with œ{•B‹<•è value
                        J    # join these and print e.g. "I love yuo"œ{•B‹<•è

Explanation of the output programs:

"I love yuo"                   # a string which is a permutation of "I love you"
            œ{                 # get the sorted permutations of this string 
              •B‹<•è           # get the value at index 750832 which is "I love you"

Expired Data

Posted 2020-01-16T00:40:27.130

Reputation: 3 129

One of the output can be reduced. – tsh – 2020-01-16T10:27:19.063

Doesn't the second one produce much more than 99 programs? – Kaddath – 2020-01-16T12:48:26.737

I trust you, knowing nothing about 05AB1E, but I get a huge list and "The output exceeded 128 KiB and was truncated" with the TIO link – Kaddath – 2020-01-16T13:16:55.847

@Kaddath should be fixed now – Expired Data – 2020-01-16T13:30:33.103

still pretty much chinese to me :D (no offense to them) but yep, that works! – Kaddath – 2020-01-16T13:42:16.557

1@kaddath added an explanation hope that is useful – Expired Data – 2020-01-16T14:05:05.243

2“€í„Î€î“ can be …I„΀î (also fixes the lowercase i to uppercase I in the sentence) – Kevin Cruijssen – 2020-01-16T14:44:28.960

^ You may need to fix the index integer, since the sorted permutations might be in a different order due to the uppercase I. – Kevin Cruijssen – 2020-01-16T14:51:48.797

Good point and thanks @KevinCruijssen – Expired Data – 2020-01-16T14:52:32.657

The first program is invalid, since 1) it outputs more than 99 programs 2) not all output programs are distinct as required. 1) can be fixed by doing тLè instead of ¦, 2) can be solved by adding Ù after œ. TIO (note that it now loses to the second program in individual score, but beats it in combined score. also the indices are wrong now, my bad).

– Grimmy – 2020-01-16T19:33:19.763

@Grimmy Well it does output 99 programs.. it just then goes on to output more, as far as I'm concerned that meets the challenge criteria... And yes second one I will fix. – Expired Data – 2020-01-16T21:38:50.393

@ExpiredData no it obviously doesn’t meet the spec. If that kind of thing was allowed, you could just enumerate all strings and argue that the answer is somewhere in there. (Also, regardless of spec-compliance, changing it to output only 99 programs gives a better combined score than your current “optimized for combined score” answer). – Grimmy – 2020-01-16T21:58:51.863

@Grimmy whatever there's a clear difference between your ridiculous example and this. – Expired Data – 2020-01-17T08:08:08.357

3

Ruby, 200 181 172 165 + 3992 3828 3540 bytes

m="I love you";q=?",?';%w[print $><< puts].map{|e|q.product(q){|c,d|8.times{|i|puts e+c+"#{m.chars.rotate(~i)*""}#{c}.chars.rotate(#{i+1})*#{d*2}"}};puts e+"'#{m}'"}

This combines different ways of printing (print, $stdout <<, puts), different ways of quoting the string ('', ""), and different rotations of the string "I love you" to make (((8 * 4) + 1) * 3) = 99 irreducible programs.

Golfy Tricks

  • Uses %w[] as a whitespace-separated string array
  • Use *"" and *'' instead of .join
  • Use different combinations of quotation marks ("", '') instead of different combination of splitting a string (chars, split(//)), and just use the shorter (chars)
  • Use puts instead of $stdout<< as the third way of printing (I didn't think it would be allowed because it also appends a newline where the others don't, but maybe this is fine?)

Try it online! for the initial generator code.

Try it online! for the generated code.

This now has some "I love you"s appended with a newline, and some not. I hope this is okay.

EDIT: Saved lots of even more bytes thanks to Value Ink!


Ruby, 53 + 2375 bytes

This is the cheap way of using a unicode range as variable names.

(?ÿ..?š).each{|v|puts"#{v}='I love you';puts #{v}"}

Try it online! for the generator code.

Try it online! for the generated code.

IMP1

Posted 2020-01-16T00:40:27.130

Reputation: 510

1>

  • Replace the $stdout<< version of printing with puts for some byte saves; I'm pretty sure the trailing newline isn't a problem for the challenge. Also .join to *"". 2) Use %w notation for your arrays, for example %w(print $><< puts) saves lots of bytes over ['print','$><<','puts']. 3) Use 8.times and modify i as necessary instead of doing if i>0: -i becomes ~i, and #{i} becomes #{i+1}.
  • < – Value Ink – 2020-01-21T22:23:14.137

    1I also meant you should change .join to *"" in your array... %w[.join *''] becomes %w[*"" *''] which you can golf further to %w["" ''] if you do *#{d}. Also, map is better than each in 99% of cases – Value Ink – 2020-01-22T09:59:02.027

    Oh yeah, I didn't think of mixing up the quotation marks! – IMP1 – 2020-01-22T10:15:14.307

    I can also swap out the %w[chars split(//)] with different quotation marks around the string. – IMP1 – 2020-01-22T10:21:13.397

    Since it's come to you using the quotation marks for both parts: q=?",?';q.product(q) then *"+d*2 works. Also, you can do puts e+c+"#{m.... instead of interpolating, since they're just basic strings! – Value Ink – 2020-01-22T12:42:20.290

    2

    PowerShell, 63 + 3167 = 3230

    1..99|%{$z=$_%10;"''+(echo you $($_-$z)/10) love $z I)[4,2,0]"}
    

    Try it online!

    Sample output:

    ''+(echo you 0 love 1 I)[4,2,0]
    ''+(echo you 0 love 2 I)[4,2,0]
    ...
    ''+(echo you 1 love 0 I)[4,2,0]
    ''+(echo you 1 love 1 I)[4,2,0]
    ''+(echo you 1 love 2 I)[4,2,0]
    ...
    ''+(echo you 9 love 8 I)[4,2,0]
    ''+(echo you 9 love 9 I)[4,2,0]
    

    PowerShell, 2575 = 101 + 2474

    Inspired by Jo King's answer for Perl.

    Minimal total output for Powershell (84+2153) was written by Andrei Odegov

    So make sure to upvote them both as well!

    1..99|%{$n=$_
    '"I "+("'+-join(0..6|%{[char](($n-shr$_)%2*32+'LOVEYOU'[$_])
    ' '*!($_-3)})+'"|% *wer)'}
    

    Try it online!

    Sample output:

    "I "+("lOVE YOU"|% *wer)
    "I "+("LoVE YOU"|% *wer)
    "I "+("loVE YOU"|% *wer)
    "I "+("LOvE YOU"|% *wer)
    ...
    "I "+("loVE You"|% *wer)
    

    PowerShell, 2672 = 99 + 2573, bonus track

    1..99|%{$p,$d="0$_"[-2,-1]
    $e,$l,$c,$r='I love you'-split"^(.{$p})(.)"
    "'$l$d$r'-replace$d,`"$c`""}
    

    Try it online!

    It generates 10 distinct programs for each char of the input string. The length of string I love you is 10 chars. This is enough for 99 iterations

    Sample output:

    '1 love you'-replace1,"I"
    '2 love you'-replace2,"I"
    '3 love you'-replace3,"I"
    ...
    '8 love you'-replace8,"I"
    '9 love you'-replace9,"I"
    'I0love you'-replace0," "
    'I1love you'-replace1," "
    ...
    'I love yo8'-replace8,"u"
    'I love yo9'-replace9,"u"
    

    PowerShell, 94 + 2890, bonus track 2

    1..99|%{$n=$_;$i=0
    '"=I='+-join(' love you'|% t*y|%{$_+'='[1-($n-shr$i++)%2]})+'"-replace"="'}
    

    Try it online!

    Sample output:

    "=I= =love you"-replace"="
    "=I= l=ove you"-replace"="
    "=I= =l=ove you"-replace"="
    "=I= lo=ve you"-replace"="
    "=I= =lo=ve you"-replace"="
    ...
    

    PowerShell, 96 + 3094

    Specially for those who love to turn 99 into 9. ٩(^‿^)۶

    2..100|%{"-join('"+-join(('I love you '*$_)[($_+10)..$_])+"'*$(2+($_-$_%10)/10))[$($_+10)..$_]"}
    

    Try it online!

    Sample output:

    -join(' I uoy evol'*2)[12..2]
    -join('l I uoy evo'*2)[13..3]
    -join('ol I uoy ev'*2)[14..4]
    -join('vol I uoy e'*2)[15..5]
    -join('evol I uoy '*2)[16..6]
    -join(' evol I uoy'*2)[17..7]
    -join('y evol I uo'*2)[18..8]
    -join('oy evol I u'*2)[19..9]
    -join('uoy evol I '*3)[20..10]
    -join(' uoy evol I'*3)[21..11]
    -join('I uoy evol '*3)[22..12]
    -join(' I uoy evol'*3)[23..13]
    ...
    -join(' uoy evol I'*10)[98..88]
    -join('I uoy evol '*10)[99..89]
    -join(' I uoy evol'*11)[100..90]
    -join('l I uoy evo'*11)[101..91]
    -join('ol I uoy ev'*11)[102..92]
    -join('vol I uoy e'*11)[103..93]
    -join('evol I uoy '*11)[104..94]
    -join(' evol I uoy'*11)[105..95]
    -join('y evol I uo'*11)[106..96]
    -join('oy evol I u'*11)[107..97]
    -join('uoy evol I '*11)[108..98]
    -join(' uoy evol I'*11)[109..99]
    -join('I uoy evol '*12)[110..100]
    

    PowerShell, 123 + 3141

    ...and in a normal order. https://coub.com/view/27d6eh

    $s='I love you';(2..122|%{"-join('"+-join(("$s "*$_)[-($_+10)..-$_])+"'*$(2+($_-$_%10)/10))[$($_-1)..$($_+9)]"})-notmatch$s
    

    Try it online!

    Sample output:

    -join('u I love yo'*2)[2..12]
    -join('ou I love y'*2)[3..13]
    -join('you I love '*2)[4..14]
    -join(' you I love'*2)[5..15]
    -join('e you I lov'*2)[6..16]
    -join('ve you I lo'*2)[7..17]
    -join('ove you I l'*2)[8..18]
    -join('love you I '*3)[9..19]
    -join(' love you I'*3)[10..20]
    -join('u I love yo'*3)[13..23]
    -join('ou I love y'*3)[14..24]
    -join('you I love '*3)[15..25]
    ...
    

    mazzy

    Posted 2020-01-16T00:40:27.130

    Reputation: 4 832

    1For your first answer, what's to stop me turning the 99 into 9? – Neil – 2020-01-21T13:43:11.217

    Nothing. Thanks. – mazzy – 2020-01-21T13:59:31.000

    2

    Perl 6, 75 bytes, 2178 + 75 = 2253

    unique("'I love you'.tclc.say",{S:x(8)[\w]~^=' 'x 2.rand}...*)[^99+1]>>.say
    

    Try it online!

    Outputs variants of:

    'I love you'.tclc.say
    

    string part has a randomised unique case. tclc is short for "title case, lowercase", which capitalises the first letter and lowercases the rest.

    "..."         # Starting from the base program
         ,{                        }...*  # Generate an infinite series of
           S:x(8)[\w]~^=             # String xor the first 8 letters
                        ' 'x 2.rand  # Randomly space or nothing, 
                                     # Essentially flipping the case
    
    unique( ... )                 # From the unique elements
                 [^99+1]          # Take 99, skipping the first
                        >>.say    # And print each
    

    The reason I don't include the first unique element is so that a variant with correct casing isn't produced, since that would be reducible.

    Jo King

    Posted 2020-01-16T00:40:27.130

    Reputation: 38 234

    1

    R, 84 Bytes

    for(x in 1:99){cat("assign(intToUtf8(",x,"),'I love you');get(intToUtf8(",x,"))\n")}
    

    karpfen

    Posted 2020-01-16T00:40:27.130

    Reputation: 181

    I think this doesn't satisfy condition 2. For any values of x > 9 (i.e more than one digit), then you can remove two strings (one digit from both numbers) and it will still print 'I love you'. – IMP1 – 2020-01-20T10:48:58.980

    1

    W n d, 34 bytes

    Different programs are separated as different list items. The n flag joins the input with newlines.

    •u≡`â!=Ç¡l╪G⌠±×èe↔/.╫ù{¶c×█)←╢k0ôF
    

    Uncompressed

    99''a146+C"C'"a73+C"C-C@ love you@+"++++M
    

    Explanation

    99                                      M % Map in the range from 1 to 99
      ''                                      % A single quote '
        a146+                                 % Add the current item by 146
             C                                % Convert the current item to a character
              "C'"                            % Add a string C'
                  a73+C                       % Add the current item by 73 (creating a difference of 73)
                       "C-C@ love you@+"++++  % Prepend the string and join the whole stack
    

    Program explanation

    'ⁿC'JC-              # Create the number 73
           C" love you"+ # Convert to character and append "love you"
    

    user85052

    Posted 2020-01-16T00:40:27.130

    Reputation:

    Aha! 'I4"#Mpu~!:O&` COPY

    – None – 2020-01-19T01:15:16.317

    1

    C# (Visual C# Interactive Compiler), 70 bytes

    for(char i='ÿ';i++<355;Write($"var {i}=\"I love you\";Write({i});"));
    

    Try it online!

    Embodiment of Ignorance

    Posted 2020-01-16T00:40:27.130

    Reputation: 7 014

    1

    PowerShell, 85 + 2647 = 2732 83 + 2251 = 2334 79 + 1818 = 1897

    0..226|?{[char]::isletterordigit($_)}|%{"`$$([char]$_)"}|%{"($_='I love you')"}
    

    -398 thanks to mazzy

    Try it online!

    Sample output:

    ($0='I love you')
    ...
    ($â='I love you')
    

    Try it online!

    Andrei Odegov

    Posted 2020-01-16T00:40:27.130

    Reputation: 939

    nice. you can remove { and }. Try it online!

    – mazzy – 2020-01-18T19:14:15.050

    You can reduce programs by removing the $0= and ;$0 parts – Jo King – 2020-01-20T00:39:29.810

    I'm agree in this case. The constraint 1 violated: If $0= is removed, then the program outputs `I love you' – mazzy – 2020-01-20T04:49:37.777

    I thinks this 84+2153 was the best

    – mazzy – 2020-01-20T06:35:38.273

    1

    Ruby, 123 + 4247 94 90 + 2124 bytes

    Heredoc abuse. Takes 49 different alphanumerics (A-Z, _, a-v) and constructs 2 programs that print the text using the appropriate heredoc. That's only 98 programs, though, so it adds one more print at the end. Each program is 3 lines long, except the last one.

    This beats IMP1's Ruby solution in the combined code golf score, but falls behind in standard scoring.

    l="I love you"
    (?A..?v).grep(/\w/){|i|puts"$><<<<"+i,l,i,"puts <<"+i,l,i}
    puts"puts'#{l}'"
    

    Try it online!

    Generated code

    Old solution, 123 + 4247 bytes

    Beats out IMP1's (non-Unicode) Ruby solution in the standard code golf department, but falls behind in combined code golf scoring. Unlike their use of multiple output solutions and rotation, I chose to shuffle the string after setting a seed with srand.

    99.times{|i|srand i;puts"srand #{i};puts'#{[*0..9].shuffle.zip('I love you'.chars).sort.map(&:last)*''}'.chars.shuffle*''"}
    

    Try it online!

    Generated code

    Value Ink

    Posted 2020-01-16T00:40:27.130

    Reputation: 10 608

    0

    Zsh, 74 bytes

    Output: 2178 (after removing newline delimiters) for a category 2 score of 2252 bytes

    for p (echo print '<<<');for v ({1..7} {a..z})<<<"$v='I love you';$p \$$v"
    

    Try it online!

    Uses method from this Ruby answer, setting a unique variable before printing. In zsh, variables must be alphanumeric, so we limit to 33 names and then print out programs using echo, print, and <<< to get our 99.

    There is optimization to be done for category 2, this tweak scores 77 + 2145 = 2222 bytes, and more can probably be found.

    GammaFunction

    Posted 2020-01-16T00:40:27.130

    Reputation: 2 838