Write the longest period iterating quine bounded by 500 bytes












5












$begingroup$


Your job is to create the longest period iterating quine, where the length of each program in the sequence is bounded by 500 bytes.



That is, if you repeat the following steps:




  1. Start with your initial program

  2. Run the current program

  3. Go back to step 2


You will eventually get back to your original program. The number of programs in the cycle is your score, which you are trying to maximize.



None of the programs may raise any errors. Each program must be run the same way as well (e.g. no different versions, implementations, compiler options, platforms, etc...).



What separates this challenge from The longest period iterating quine (other than 100 v.s. 500) is that every program in the cycle must also be 500 bytes or less. This means that the longest possible cycle is (256^501 - 1)/255 or less. That of course is a big number, but not that big in terms of how much code it takes to calculate. So the challenge is about using as many of the (256^501 - 1)/255 possibilities as you can, not a busy beaver challenge.



The programs are not permitted to access its own source code. However an empty program is permitted if you want (as long as you follow the other rules).



Since checking the programs manually would be hard, you may figure out the score using theoretical methods. You must include an explanation of the score and correctness with your program. If you can not figure out the score, you may instead use a lower bound of the number of programs in the cycle as a defacto score. You are allowed to update this as you find better lower bounds, or if you find the exact actual score.



This is code-challenge, so highest score wins!










share|improve this question











$endgroup$












  • $begingroup$
    So.... This isn't a codegolf??? Because if it isn't there is a whole can of worms I can unleash on this!!!
    $endgroup$
    – KrystosTheOverlord
    2 hours ago










  • $begingroup$
    @JoKing markdown issues
    $endgroup$
    – PyRulez
    2 hours ago










  • $begingroup$
    @KrystosTheOverlord no there is no code golf. However, I expect there to be a code golf like aspect, since the shorter the main program is, the more room for comments (which can make the programs distinct).
    $endgroup$
    – PyRulez
    2 hours ago










  • $begingroup$
    @PyRulez Ok! I am working on this now, I accidently just made a program that does exactly the opposite of this challenge... It gets smaller till nothing is left... But I will be making a better version soon!
    $endgroup$
    – KrystosTheOverlord
    2 hours ago
















5












$begingroup$


Your job is to create the longest period iterating quine, where the length of each program in the sequence is bounded by 500 bytes.



That is, if you repeat the following steps:




  1. Start with your initial program

  2. Run the current program

  3. Go back to step 2


You will eventually get back to your original program. The number of programs in the cycle is your score, which you are trying to maximize.



None of the programs may raise any errors. Each program must be run the same way as well (e.g. no different versions, implementations, compiler options, platforms, etc...).



What separates this challenge from The longest period iterating quine (other than 100 v.s. 500) is that every program in the cycle must also be 500 bytes or less. This means that the longest possible cycle is (256^501 - 1)/255 or less. That of course is a big number, but not that big in terms of how much code it takes to calculate. So the challenge is about using as many of the (256^501 - 1)/255 possibilities as you can, not a busy beaver challenge.



The programs are not permitted to access its own source code. However an empty program is permitted if you want (as long as you follow the other rules).



Since checking the programs manually would be hard, you may figure out the score using theoretical methods. You must include an explanation of the score and correctness with your program. If you can not figure out the score, you may instead use a lower bound of the number of programs in the cycle as a defacto score. You are allowed to update this as you find better lower bounds, or if you find the exact actual score.



This is code-challenge, so highest score wins!










share|improve this question











$endgroup$












  • $begingroup$
    So.... This isn't a codegolf??? Because if it isn't there is a whole can of worms I can unleash on this!!!
    $endgroup$
    – KrystosTheOverlord
    2 hours ago










  • $begingroup$
    @JoKing markdown issues
    $endgroup$
    – PyRulez
    2 hours ago










  • $begingroup$
    @KrystosTheOverlord no there is no code golf. However, I expect there to be a code golf like aspect, since the shorter the main program is, the more room for comments (which can make the programs distinct).
    $endgroup$
    – PyRulez
    2 hours ago










  • $begingroup$
    @PyRulez Ok! I am working on this now, I accidently just made a program that does exactly the opposite of this challenge... It gets smaller till nothing is left... But I will be making a better version soon!
    $endgroup$
    – KrystosTheOverlord
    2 hours ago














5












5








5





$begingroup$


Your job is to create the longest period iterating quine, where the length of each program in the sequence is bounded by 500 bytes.



That is, if you repeat the following steps:




  1. Start with your initial program

  2. Run the current program

  3. Go back to step 2


You will eventually get back to your original program. The number of programs in the cycle is your score, which you are trying to maximize.



None of the programs may raise any errors. Each program must be run the same way as well (e.g. no different versions, implementations, compiler options, platforms, etc...).



What separates this challenge from The longest period iterating quine (other than 100 v.s. 500) is that every program in the cycle must also be 500 bytes or less. This means that the longest possible cycle is (256^501 - 1)/255 or less. That of course is a big number, but not that big in terms of how much code it takes to calculate. So the challenge is about using as many of the (256^501 - 1)/255 possibilities as you can, not a busy beaver challenge.



The programs are not permitted to access its own source code. However an empty program is permitted if you want (as long as you follow the other rules).



Since checking the programs manually would be hard, you may figure out the score using theoretical methods. You must include an explanation of the score and correctness with your program. If you can not figure out the score, you may instead use a lower bound of the number of programs in the cycle as a defacto score. You are allowed to update this as you find better lower bounds, or if you find the exact actual score.



This is code-challenge, so highest score wins!










share|improve this question











$endgroup$




Your job is to create the longest period iterating quine, where the length of each program in the sequence is bounded by 500 bytes.



That is, if you repeat the following steps:




  1. Start with your initial program

  2. Run the current program

  3. Go back to step 2


You will eventually get back to your original program. The number of programs in the cycle is your score, which you are trying to maximize.



None of the programs may raise any errors. Each program must be run the same way as well (e.g. no different versions, implementations, compiler options, platforms, etc...).



What separates this challenge from The longest period iterating quine (other than 100 v.s. 500) is that every program in the cycle must also be 500 bytes or less. This means that the longest possible cycle is (256^501 - 1)/255 or less. That of course is a big number, but not that big in terms of how much code it takes to calculate. So the challenge is about using as many of the (256^501 - 1)/255 possibilities as you can, not a busy beaver challenge.



The programs are not permitted to access its own source code. However an empty program is permitted if you want (as long as you follow the other rules).



Since checking the programs manually would be hard, you may figure out the score using theoretical methods. You must include an explanation of the score and correctness with your program. If you can not figure out the score, you may instead use a lower bound of the number of programs in the cycle as a defacto score. You are allowed to update this as you find better lower bounds, or if you find the exact actual score.



This is code-challenge, so highest score wins!







code-challenge quine code-generation






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 39 mins ago







PyRulez

















asked 3 hours ago









PyRulezPyRulez

3,64942357




3,64942357












  • $begingroup$
    So.... This isn't a codegolf??? Because if it isn't there is a whole can of worms I can unleash on this!!!
    $endgroup$
    – KrystosTheOverlord
    2 hours ago










  • $begingroup$
    @JoKing markdown issues
    $endgroup$
    – PyRulez
    2 hours ago










  • $begingroup$
    @KrystosTheOverlord no there is no code golf. However, I expect there to be a code golf like aspect, since the shorter the main program is, the more room for comments (which can make the programs distinct).
    $endgroup$
    – PyRulez
    2 hours ago










  • $begingroup$
    @PyRulez Ok! I am working on this now, I accidently just made a program that does exactly the opposite of this challenge... It gets smaller till nothing is left... But I will be making a better version soon!
    $endgroup$
    – KrystosTheOverlord
    2 hours ago


















  • $begingroup$
    So.... This isn't a codegolf??? Because if it isn't there is a whole can of worms I can unleash on this!!!
    $endgroup$
    – KrystosTheOverlord
    2 hours ago










  • $begingroup$
    @JoKing markdown issues
    $endgroup$
    – PyRulez
    2 hours ago










  • $begingroup$
    @KrystosTheOverlord no there is no code golf. However, I expect there to be a code golf like aspect, since the shorter the main program is, the more room for comments (which can make the programs distinct).
    $endgroup$
    – PyRulez
    2 hours ago










  • $begingroup$
    @PyRulez Ok! I am working on this now, I accidently just made a program that does exactly the opposite of this challenge... It gets smaller till nothing is left... But I will be making a better version soon!
    $endgroup$
    – KrystosTheOverlord
    2 hours ago
















$begingroup$
So.... This isn't a codegolf??? Because if it isn't there is a whole can of worms I can unleash on this!!!
$endgroup$
– KrystosTheOverlord
2 hours ago




$begingroup$
So.... This isn't a codegolf??? Because if it isn't there is a whole can of worms I can unleash on this!!!
$endgroup$
– KrystosTheOverlord
2 hours ago












$begingroup$
@JoKing markdown issues
$endgroup$
– PyRulez
2 hours ago




$begingroup$
@JoKing markdown issues
$endgroup$
– PyRulez
2 hours ago












$begingroup$
@KrystosTheOverlord no there is no code golf. However, I expect there to be a code golf like aspect, since the shorter the main program is, the more room for comments (which can make the programs distinct).
$endgroup$
– PyRulez
2 hours ago




$begingroup$
@KrystosTheOverlord no there is no code golf. However, I expect there to be a code golf like aspect, since the shorter the main program is, the more room for comments (which can make the programs distinct).
$endgroup$
– PyRulez
2 hours ago












$begingroup$
@PyRulez Ok! I am working on this now, I accidently just made a program that does exactly the opposite of this challenge... It gets smaller till nothing is left... But I will be making a better version soon!
$endgroup$
– KrystosTheOverlord
2 hours ago




$begingroup$
@PyRulez Ok! I am working on this now, I accidently just made a program that does exactly the opposite of this challenge... It gets smaller till nothing is left... But I will be making a better version soon!
$endgroup$
– KrystosTheOverlord
2 hours ago










2 Answers
2






active

oldest

votes


















2












$begingroup$


Perl 6, $126^{398}$ iterations





$!=Q~~;<say "$!=Q~{chrs(my@a=[R,] polymod :126[$!.ords]+1: 126 xx*)x?(@a-398)}~;<$_>~~.EVAL">~~.EVAL



Try it online!



This iterates through all the possible combinations of the first 126 bytes of length 397 and under (excluding strings with leading NUL bytes). If you want to see that it actually returns to the first iteration, you can reduce the length to 1 by changing the limit like so.






share|improve this answer











$endgroup$













  • $begingroup$
    Wow, you did that really fast, I'm almost done with mine, but I'll probably be finishing it tomorrow (mine is going to be in Gol><>)
    $endgroup$
    – KrystosTheOverlord
    34 mins ago










  • $begingroup$
    This calculation suggests that you way over estimated your score. The numerator is how many strings of length 397 there are using 126 symbols. (I had to distribute the fraction into the sum since wolfram alpha was acting weird.)
    $endgroup$
    – PyRulez
    30 mins ago












  • $begingroup$
    @PyRulez I think my number is correct, since it's basically iterating a base 126 number up to 399 digits... I think my explanation was off
    $endgroup$
    – Jo King
    7 mins ago





















0












$begingroup$


Gol><>, 67 bytes



":1=l8:*4+=S&Q~P:'~'=Q~~'H'||lPaa*5*=?1:1=Q$~|:1)lPaa*5*(Q?:|r2ssHH


Basically this program replicates the H at the end, then when it reaches 499 in length, appends a char with an ascii code of 1, this begins the deletion process, then when it reaches its original length plus one, it increments the last char. Finally, if the last char is a '~', it pushes an H instead!!!



I have no idea what the score would be... Too much math for tonight, I'll figure it out tomorrow...



Try it online!






share|improve this answer









$endgroup$













    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "200"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f179752%2fwrite-the-longest-period-iterating-quine-bounded-by-500-bytes%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2












    $begingroup$


    Perl 6, $126^{398}$ iterations





    $!=Q~~;<say "$!=Q~{chrs(my@a=[R,] polymod :126[$!.ords]+1: 126 xx*)x?(@a-398)}~;<$_>~~.EVAL">~~.EVAL



    Try it online!



    This iterates through all the possible combinations of the first 126 bytes of length 397 and under (excluding strings with leading NUL bytes). If you want to see that it actually returns to the first iteration, you can reduce the length to 1 by changing the limit like so.






    share|improve this answer











    $endgroup$













    • $begingroup$
      Wow, you did that really fast, I'm almost done with mine, but I'll probably be finishing it tomorrow (mine is going to be in Gol><>)
      $endgroup$
      – KrystosTheOverlord
      34 mins ago










    • $begingroup$
      This calculation suggests that you way over estimated your score. The numerator is how many strings of length 397 there are using 126 symbols. (I had to distribute the fraction into the sum since wolfram alpha was acting weird.)
      $endgroup$
      – PyRulez
      30 mins ago












    • $begingroup$
      @PyRulez I think my number is correct, since it's basically iterating a base 126 number up to 399 digits... I think my explanation was off
      $endgroup$
      – Jo King
      7 mins ago


















    2












    $begingroup$


    Perl 6, $126^{398}$ iterations





    $!=Q~~;<say "$!=Q~{chrs(my@a=[R,] polymod :126[$!.ords]+1: 126 xx*)x?(@a-398)}~;<$_>~~.EVAL">~~.EVAL



    Try it online!



    This iterates through all the possible combinations of the first 126 bytes of length 397 and under (excluding strings with leading NUL bytes). If you want to see that it actually returns to the first iteration, you can reduce the length to 1 by changing the limit like so.






    share|improve this answer











    $endgroup$













    • $begingroup$
      Wow, you did that really fast, I'm almost done with mine, but I'll probably be finishing it tomorrow (mine is going to be in Gol><>)
      $endgroup$
      – KrystosTheOverlord
      34 mins ago










    • $begingroup$
      This calculation suggests that you way over estimated your score. The numerator is how many strings of length 397 there are using 126 symbols. (I had to distribute the fraction into the sum since wolfram alpha was acting weird.)
      $endgroup$
      – PyRulez
      30 mins ago












    • $begingroup$
      @PyRulez I think my number is correct, since it's basically iterating a base 126 number up to 399 digits... I think my explanation was off
      $endgroup$
      – Jo King
      7 mins ago
















    2












    2








    2





    $begingroup$


    Perl 6, $126^{398}$ iterations





    $!=Q~~;<say "$!=Q~{chrs(my@a=[R,] polymod :126[$!.ords]+1: 126 xx*)x?(@a-398)}~;<$_>~~.EVAL">~~.EVAL



    Try it online!



    This iterates through all the possible combinations of the first 126 bytes of length 397 and under (excluding strings with leading NUL bytes). If you want to see that it actually returns to the first iteration, you can reduce the length to 1 by changing the limit like so.






    share|improve this answer











    $endgroup$




    Perl 6, $126^{398}$ iterations





    $!=Q~~;<say "$!=Q~{chrs(my@a=[R,] polymod :126[$!.ords]+1: 126 xx*)x?(@a-398)}~;<$_>~~.EVAL">~~.EVAL



    Try it online!



    This iterates through all the possible combinations of the first 126 bytes of length 397 and under (excluding strings with leading NUL bytes). If you want to see that it actually returns to the first iteration, you can reduce the length to 1 by changing the limit like so.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited 9 mins ago

























    answered 41 mins ago









    Jo KingJo King

    22.4k251115




    22.4k251115












    • $begingroup$
      Wow, you did that really fast, I'm almost done with mine, but I'll probably be finishing it tomorrow (mine is going to be in Gol><>)
      $endgroup$
      – KrystosTheOverlord
      34 mins ago










    • $begingroup$
      This calculation suggests that you way over estimated your score. The numerator is how many strings of length 397 there are using 126 symbols. (I had to distribute the fraction into the sum since wolfram alpha was acting weird.)
      $endgroup$
      – PyRulez
      30 mins ago












    • $begingroup$
      @PyRulez I think my number is correct, since it's basically iterating a base 126 number up to 399 digits... I think my explanation was off
      $endgroup$
      – Jo King
      7 mins ago




















    • $begingroup$
      Wow, you did that really fast, I'm almost done with mine, but I'll probably be finishing it tomorrow (mine is going to be in Gol><>)
      $endgroup$
      – KrystosTheOverlord
      34 mins ago










    • $begingroup$
      This calculation suggests that you way over estimated your score. The numerator is how many strings of length 397 there are using 126 symbols. (I had to distribute the fraction into the sum since wolfram alpha was acting weird.)
      $endgroup$
      – PyRulez
      30 mins ago












    • $begingroup$
      @PyRulez I think my number is correct, since it's basically iterating a base 126 number up to 399 digits... I think my explanation was off
      $endgroup$
      – Jo King
      7 mins ago


















    $begingroup$
    Wow, you did that really fast, I'm almost done with mine, but I'll probably be finishing it tomorrow (mine is going to be in Gol><>)
    $endgroup$
    – KrystosTheOverlord
    34 mins ago




    $begingroup$
    Wow, you did that really fast, I'm almost done with mine, but I'll probably be finishing it tomorrow (mine is going to be in Gol><>)
    $endgroup$
    – KrystosTheOverlord
    34 mins ago












    $begingroup$
    This calculation suggests that you way over estimated your score. The numerator is how many strings of length 397 there are using 126 symbols. (I had to distribute the fraction into the sum since wolfram alpha was acting weird.)
    $endgroup$
    – PyRulez
    30 mins ago






    $begingroup$
    This calculation suggests that you way over estimated your score. The numerator is how many strings of length 397 there are using 126 symbols. (I had to distribute the fraction into the sum since wolfram alpha was acting weird.)
    $endgroup$
    – PyRulez
    30 mins ago














    $begingroup$
    @PyRulez I think my number is correct, since it's basically iterating a base 126 number up to 399 digits... I think my explanation was off
    $endgroup$
    – Jo King
    7 mins ago






    $begingroup$
    @PyRulez I think my number is correct, since it's basically iterating a base 126 number up to 399 digits... I think my explanation was off
    $endgroup$
    – Jo King
    7 mins ago













    0












    $begingroup$


    Gol><>, 67 bytes



    ":1=l8:*4+=S&Q~P:'~'=Q~~'H'||lPaa*5*=?1:1=Q$~|:1)lPaa*5*(Q?:|r2ssHH


    Basically this program replicates the H at the end, then when it reaches 499 in length, appends a char with an ascii code of 1, this begins the deletion process, then when it reaches its original length plus one, it increments the last char. Finally, if the last char is a '~', it pushes an H instead!!!



    I have no idea what the score would be... Too much math for tonight, I'll figure it out tomorrow...



    Try it online!






    share|improve this answer









    $endgroup$


















      0












      $begingroup$


      Gol><>, 67 bytes



      ":1=l8:*4+=S&Q~P:'~'=Q~~'H'||lPaa*5*=?1:1=Q$~|:1)lPaa*5*(Q?:|r2ssHH


      Basically this program replicates the H at the end, then when it reaches 499 in length, appends a char with an ascii code of 1, this begins the deletion process, then when it reaches its original length plus one, it increments the last char. Finally, if the last char is a '~', it pushes an H instead!!!



      I have no idea what the score would be... Too much math for tonight, I'll figure it out tomorrow...



      Try it online!






      share|improve this answer









      $endgroup$
















        0












        0








        0





        $begingroup$


        Gol><>, 67 bytes



        ":1=l8:*4+=S&Q~P:'~'=Q~~'H'||lPaa*5*=?1:1=Q$~|:1)lPaa*5*(Q?:|r2ssHH


        Basically this program replicates the H at the end, then when it reaches 499 in length, appends a char with an ascii code of 1, this begins the deletion process, then when it reaches its original length plus one, it increments the last char. Finally, if the last char is a '~', it pushes an H instead!!!



        I have no idea what the score would be... Too much math for tonight, I'll figure it out tomorrow...



        Try it online!






        share|improve this answer









        $endgroup$




        Gol><>, 67 bytes



        ":1=l8:*4+=S&Q~P:'~'=Q~~'H'||lPaa*5*=?1:1=Q$~|:1)lPaa*5*(Q?:|r2ssHH


        Basically this program replicates the H at the end, then when it reaches 499 in length, appends a char with an ascii code of 1, this begins the deletion process, then when it reaches its original length plus one, it increments the last char. Finally, if the last char is a '~', it pushes an H instead!!!



        I have no idea what the score would be... Too much math for tonight, I'll figure it out tomorrow...



        Try it online!







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 19 mins ago









        KrystosTheOverlordKrystosTheOverlord

        1539




        1539






























            draft saved

            draft discarded




















































            If this is an answer to a challenge…




            • …Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.


            • …Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
              Explanations of your answer make it more interesting to read and are very much encouraged.


            • …Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.



            More generally…




            • …Please make sure to answer the question and provide sufficient detail.


            • …Avoid asking for help, clarification or responding to other answers (use comments instead).





            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f179752%2fwrite-the-longest-period-iterating-quine-bounded-by-500-bytes%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Сан-Квентин

            Алькесар

            Josef Freinademetz