Cyclic Weak Levenquine

8

2

This question asking us to make a "Cyclic Levenquine" has gone unanswered. So today we will ask a slightly simpler version. In this challenge we will define a K-Levenquine to be a program whose output is Levenshtein distance K from its source.

Task

Your goal in this challenge is to write a program with some output different from its own source; running that output as a program should also do the same. Eventually, the sequence of repeatedly running the outputs of each successive program (in the same language) must eventually output the original program.

As with the last challenge there must be two distinct programs in this cycle such that they do not share any two bytes (i.e. their byte sets are disjoint).

As with most challenges, reading your own source code is forbidden.

Scoring

Each program in your cycle will be a K-Levenquine for some K. The largest K of any of the programs in your cycle will be your score. Your goal should be to minimize this score, with 1 being the optimal score.

Post Rock Garf Hunter

Posted 2018-01-22T20:36:43.480

Reputation: 55 382

Just for clarity, each of the programs should be in the same language, correct? – FryAmTheEggman – 2018-01-22T20:44:59.887

@FryAmTheEggman yes – Post Rock Garf Hunter – 2018-01-22T20:45:11.320

Should you make it so that if someone gets to a score of 1, it should be posted on the other question instead? Otherwise, answers could be duplicated if someone gets that far. – mbomb007 – 2018-01-22T21:03:20.983

Related. Related. Related. – Martin Ender – 2018-01-22T21:34:26.527

As an example, what is the score of this ouroboros relay-quine? (I assume it is a valid answer to this challenge, if not, explain why not)

– Draco18s no longer trusts SE – 2018-01-23T23:06:42.377

@Draco18s not same language – Christopher – 2018-01-24T01:33:27.267

@Christopher2EZ4RTZ Missed the "same language" bit. – Draco18s no longer trusts SE – 2018-01-24T01:56:18.150

Technically I could add my answer from the Mutually exclusive quine question here for a score of 41 right?

– Jo King – 2018-01-24T03:27:44.383

@JoKing Yes you could. – Post Rock Garf Hunter – 2018-01-24T05:50:36.607

Note that because answers from the other question can't be too competitive here (the score is the max of the length) this is not a dupe. – user202729 – 2018-01-28T08:53:50.667

I'll point out that the original challenge carefully specified characters for distance and disjointness, not bytes. In fact in a language where source code has to be valid UTF-8, adding or removing a non-ASCII character in steps of 1 byte is impossible. – Ørjan Johansen – 2018-01-28T10:17:26.813

@ØrjanJohansen Yes, I made the change from characters to bytes because I am not satisfied that our site wide definition of character is clear. – Post Rock Garf Hunter – 2018-01-28T17:44:33.787

@user202729 I'll also point out that my question came first, which while not necessarily preventing it from being a dupe target, does help. – Post Rock Garf Hunter – 2018-01-28T17:47:06.957

You can probably cross out the first line now – Jo King – 2019-02-11T10:53:19.813

5

Possible duplicate of Cyclic Levenquine

– pppery – 2019-04-17T17:35:12.413

This is an admittedly somewhat bizzare case, but the policy on duplicates is the ability for answers to be copy-pasted while still remaining competitive. Given that any answer from the proposed duplicate target (and that question is answered now) would be a valid and literally unbeatable answer here, the challenges are clearly duplicate in my opinion. – pppery – 2019-04-17T17:37:00.803

1I'm voting to keep this, because this challenge is easier, and the linked potential duplicate has only one answer. – mbomb007 – 2019-08-05T21:27:19.003

@mbomb007 It doesn't matter that this challenge is easier, since the policy for duplicates is the ability to copy-paste answers from one challenge to another. That one answer to the potential duplicate would be valid and literally unbeatable here, which makes the question a duplicate. – pppery – 2019-08-06T18:31:02.183

Then perhaps the other question should be closed as a duplicate of this one. I'd prefer just saying that any answer scoring 1 should be posted on the other question and such answers aren't allowed here. – mbomb007 – 2019-08-06T18:45:28.123

2

There is now a place to discuss this on meta: https://codegolf.meta.stackexchange.com/questions/17939/closing-a-question-that-asks-a-more-general-question-as-a-duplicate

– Post Rock Garf Hunter – 2019-08-06T19:33:10.177

I'd like to point out that due to the character/byte issue, answers to the old question would not necessarily get perfect score here, if they make use of non-ASCII UTF-8 characters, say for data encoding like in my answer to one of the simpler related challenges. (Partial disclosure: That answer was inspired by my perpetually unfinished design for a real levenquine.)

– Ørjan Johansen – 2019-08-07T07:55:14.823

1So, over one month after the applicable meta post was posted, there still has been no change to the duplicate policy to permit generalizations of existing challenges like this one. Even the asker of this challenge has agreed that it is a duplicate under the policy as currently worded. The policy must be enforced, and that means closing this challenge. – pppery – 2019-09-19T01:24:39.407

1I disagree. Consensus hasn't been shown in either direction, and it's due to a lack of activity on the meta question. Post it in 19th byte to get activity. It's not going to hurt anything to leave this challenge open. – mbomb007 – 2019-09-19T14:09:01.867

Answers

3

><>, Score: 41

'd3*}>a!o-!<<8:5@lI55>@z:5ll55>>q:>|q::|,

and the disjoint program

"r00gr40g44++bb+0p64++?b6+0.22#eW4s )Z

Try it online!

A copy of my answer to the Mutually Exclusive Quine question. A mutually exclusive quine is made of two programs, A and B sharing no common characters, where A outputs B and B outputs A. This means it is a 2-cycle Levenquine and also qualifies for this question. This can act as a baseline for other more inventive answers (though I'm not very confidant this won't go the way of the original Levenquine question).

A more detailed explanation can be found here.

Jo King

Posted 2018-01-22T20:36:43.480

Reputation: 38 234