List all possible titles for the *Anno* games

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












In the Anno video game series there are 6 games with a 7th one announced for early 2019. Their titles always feature a year in a specific pattern:



Anno 1602, Anno 1503, Anno 1701, Anno 1404, Anno 2070, Anno 2205, Anno 1800



  • The digital sum is always 9.

  • The years are four digits long.

  • They contain at least one zero.

Within these constrains there exist 109 possible titles:



[1008,1017,1026,1035,1044,1053,1062,1071,1080,1107,1170,1206,1260,1305,1350,1404,1440,1503,1530,1602,1620,1701,1710,1800,2007,2016,2025,2034,2043,2052,2061,2070,2106,2160,2205,2250,2304,2340,2403,2430,2502,2520,2601,2610,2700,3006,3015,3024,3033,3042,3051,3060,3105,3150,3204,3240,3303,3330,3402,3420,3501,3510,3600,4005,4014,4023,4032,4041,4050,4104,4140,4203,4230,4302,4320,4401,4410,4500,5004,5013,5022,5031,5040,5103,5130,5202,5220,5301,5310,5400,6003,6012,6021,6030,6102,6120,6201,6210,6300,7002,7011,7020,7101,7110,7200,8001,8010,8100,9000]


Your objective is to list them all in any reasonable form in the fewest number of bytes.










share|improve this question

























    up vote
    2
    down vote

    favorite












    In the Anno video game series there are 6 games with a 7th one announced for early 2019. Their titles always feature a year in a specific pattern:



    Anno 1602, Anno 1503, Anno 1701, Anno 1404, Anno 2070, Anno 2205, Anno 1800



    • The digital sum is always 9.

    • The years are four digits long.

    • They contain at least one zero.

    Within these constrains there exist 109 possible titles:



    [1008,1017,1026,1035,1044,1053,1062,1071,1080,1107,1170,1206,1260,1305,1350,1404,1440,1503,1530,1602,1620,1701,1710,1800,2007,2016,2025,2034,2043,2052,2061,2070,2106,2160,2205,2250,2304,2340,2403,2430,2502,2520,2601,2610,2700,3006,3015,3024,3033,3042,3051,3060,3105,3150,3204,3240,3303,3330,3402,3420,3501,3510,3600,4005,4014,4023,4032,4041,4050,4104,4140,4203,4230,4302,4320,4401,4410,4500,5004,5013,5022,5031,5040,5103,5130,5202,5220,5301,5310,5400,6003,6012,6021,6030,6102,6120,6201,6210,6300,7002,7011,7020,7101,7110,7200,8001,8010,8100,9000]


    Your objective is to list them all in any reasonable form in the fewest number of bytes.










    share|improve this question























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      In the Anno video game series there are 6 games with a 7th one announced for early 2019. Their titles always feature a year in a specific pattern:



      Anno 1602, Anno 1503, Anno 1701, Anno 1404, Anno 2070, Anno 2205, Anno 1800



      • The digital sum is always 9.

      • The years are four digits long.

      • They contain at least one zero.

      Within these constrains there exist 109 possible titles:



      [1008,1017,1026,1035,1044,1053,1062,1071,1080,1107,1170,1206,1260,1305,1350,1404,1440,1503,1530,1602,1620,1701,1710,1800,2007,2016,2025,2034,2043,2052,2061,2070,2106,2160,2205,2250,2304,2340,2403,2430,2502,2520,2601,2610,2700,3006,3015,3024,3033,3042,3051,3060,3105,3150,3204,3240,3303,3330,3402,3420,3501,3510,3600,4005,4014,4023,4032,4041,4050,4104,4140,4203,4230,4302,4320,4401,4410,4500,5004,5013,5022,5031,5040,5103,5130,5202,5220,5301,5310,5400,6003,6012,6021,6030,6102,6120,6201,6210,6300,7002,7011,7020,7101,7110,7200,8001,8010,8100,9000]


      Your objective is to list them all in any reasonable form in the fewest number of bytes.










      share|improve this question













      In the Anno video game series there are 6 games with a 7th one announced for early 2019. Their titles always feature a year in a specific pattern:



      Anno 1602, Anno 1503, Anno 1701, Anno 1404, Anno 2070, Anno 2205, Anno 1800



      • The digital sum is always 9.

      • The years are four digits long.

      • They contain at least one zero.

      Within these constrains there exist 109 possible titles:



      [1008,1017,1026,1035,1044,1053,1062,1071,1080,1107,1170,1206,1260,1305,1350,1404,1440,1503,1530,1602,1620,1701,1710,1800,2007,2016,2025,2034,2043,2052,2061,2070,2106,2160,2205,2250,2304,2340,2403,2430,2502,2520,2601,2610,2700,3006,3015,3024,3033,3042,3051,3060,3105,3150,3204,3240,3303,3330,3402,3420,3501,3510,3600,4005,4014,4023,4032,4041,4050,4104,4140,4203,4230,4302,4320,4401,4410,4500,5004,5013,5022,5031,5040,5103,5130,5202,5220,5301,5310,5400,6003,6012,6021,6030,6102,6120,6201,6210,6300,7002,7011,7020,7101,7110,7200,8001,8010,8100,9000]


      Your objective is to list them all in any reasonable form in the fewest number of bytes.







      code-golf number kolmogorov-complexity






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 34 mins ago









      Laikoni

      18.8k33391




      18.8k33391




















          4 Answers
          4






          active

          oldest

          votes

















          up vote
          2
          down vote














          Python 2, 67 bytes





          print[y for y in range(1000,9001)if('0'in`y`)*sum(map(int,`y`))==9]


          Try it online!




          Alternatives (also 67):





          print[y for y in range(9001)if('0'in`y`)*sum(map(int,`y`))==9][18:]




          print[y for y in range(9001)if('0'in`y`)*sum(map(int,`y`))==9<y/99]





          share|improve this answer






















          • range(1000 => range(999 saves one byte
            – Luis felipe De jesus Munoz
            2 mins ago

















          up vote
          1
          down vote














          R, 82 bytes





          write((x=t(expand.grid(1:9,0:9,0:9,0:9)))[,colSums(x)==9&!apply(x,2,all)],1,4,,"")


          Try it online!



          Generates a matrix x of all possible 4-digit numbers, excluding leading zeros, going down columns. Then filters for column (digital) sums of 9 and containing zero, i.e., not all are nonzero. write prints down the columns, so we write to stdout with a width of 4 and a separator of "".






          share|improve this answer




















          • Nice answer! I came up with a different route...
            – J.Doe
            6 mins ago

















          up vote
          1
          down vote














          R, 60 bytes



          Outputs the valid numbers as the names of a vector of 9's.





          x=colSums(sapply(grep(0,999:9999,,,T),utf8ToInt)-48);x[x==9]


          Try it online!





          share
















          • 1




            ah, grep, why do I never remember that it casts to character...
            – Giuseppe
            46 secs ago

















          up vote
          0
          down vote














          Japt, 20 bytes



          A³ò#〈 ms f_¬x ¥9©Zø0



          A³ò#〈 ms f_¬x ¥9©Zø0 Full program
          A³ò#〈 Range from [1000 9001)
          ms Convert to string
          f_ Filter values that
          ¬x ¥9 Sum equal to 9
          ©Zø0 And contains at least one 0


          Try it online!






          share|improve this answer






















            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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            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%2f174049%2flist-all-possible-titles-for-the-anno-games%23new-answer', 'question_page');

            );

            Post as a guest






























            4 Answers
            4






            active

            oldest

            votes








            4 Answers
            4






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote














            Python 2, 67 bytes





            print[y for y in range(1000,9001)if('0'in`y`)*sum(map(int,`y`))==9]


            Try it online!




            Alternatives (also 67):





            print[y for y in range(9001)if('0'in`y`)*sum(map(int,`y`))==9][18:]




            print[y for y in range(9001)if('0'in`y`)*sum(map(int,`y`))==9<y/99]





            share|improve this answer






















            • range(1000 => range(999 saves one byte
              – Luis felipe De jesus Munoz
              2 mins ago














            up vote
            2
            down vote














            Python 2, 67 bytes





            print[y for y in range(1000,9001)if('0'in`y`)*sum(map(int,`y`))==9]


            Try it online!




            Alternatives (also 67):





            print[y for y in range(9001)if('0'in`y`)*sum(map(int,`y`))==9][18:]




            print[y for y in range(9001)if('0'in`y`)*sum(map(int,`y`))==9<y/99]





            share|improve this answer






















            • range(1000 => range(999 saves one byte
              – Luis felipe De jesus Munoz
              2 mins ago












            up vote
            2
            down vote










            up vote
            2
            down vote










            Python 2, 67 bytes





            print[y for y in range(1000,9001)if('0'in`y`)*sum(map(int,`y`))==9]


            Try it online!




            Alternatives (also 67):





            print[y for y in range(9001)if('0'in`y`)*sum(map(int,`y`))==9][18:]




            print[y for y in range(9001)if('0'in`y`)*sum(map(int,`y`))==9<y/99]





            share|improve this answer















            Python 2, 67 bytes





            print[y for y in range(1000,9001)if('0'in`y`)*sum(map(int,`y`))==9]


            Try it online!




            Alternatives (also 67):





            print[y for y in range(9001)if('0'in`y`)*sum(map(int,`y`))==9][18:]




            print[y for y in range(9001)if('0'in`y`)*sum(map(int,`y`))==9<y/99]






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited 11 mins ago

























            answered 26 mins ago









            TFeld

            12.5k2835




            12.5k2835











            • range(1000 => range(999 saves one byte
              – Luis felipe De jesus Munoz
              2 mins ago
















            • range(1000 => range(999 saves one byte
              – Luis felipe De jesus Munoz
              2 mins ago















            range(1000 => range(999 saves one byte
            – Luis felipe De jesus Munoz
            2 mins ago




            range(1000 => range(999 saves one byte
            – Luis felipe De jesus Munoz
            2 mins ago










            up vote
            1
            down vote














            R, 82 bytes





            write((x=t(expand.grid(1:9,0:9,0:9,0:9)))[,colSums(x)==9&!apply(x,2,all)],1,4,,"")


            Try it online!



            Generates a matrix x of all possible 4-digit numbers, excluding leading zeros, going down columns. Then filters for column (digital) sums of 9 and containing zero, i.e., not all are nonzero. write prints down the columns, so we write to stdout with a width of 4 and a separator of "".






            share|improve this answer




















            • Nice answer! I came up with a different route...
              – J.Doe
              6 mins ago














            up vote
            1
            down vote














            R, 82 bytes





            write((x=t(expand.grid(1:9,0:9,0:9,0:9)))[,colSums(x)==9&!apply(x,2,all)],1,4,,"")


            Try it online!



            Generates a matrix x of all possible 4-digit numbers, excluding leading zeros, going down columns. Then filters for column (digital) sums of 9 and containing zero, i.e., not all are nonzero. write prints down the columns, so we write to stdout with a width of 4 and a separator of "".






            share|improve this answer




















            • Nice answer! I came up with a different route...
              – J.Doe
              6 mins ago












            up vote
            1
            down vote










            up vote
            1
            down vote










            R, 82 bytes





            write((x=t(expand.grid(1:9,0:9,0:9,0:9)))[,colSums(x)==9&!apply(x,2,all)],1,4,,"")


            Try it online!



            Generates a matrix x of all possible 4-digit numbers, excluding leading zeros, going down columns. Then filters for column (digital) sums of 9 and containing zero, i.e., not all are nonzero. write prints down the columns, so we write to stdout with a width of 4 and a separator of "".






            share|improve this answer













            R, 82 bytes





            write((x=t(expand.grid(1:9,0:9,0:9,0:9)))[,colSums(x)==9&!apply(x,2,all)],1,4,,"")


            Try it online!



            Generates a matrix x of all possible 4-digit numbers, excluding leading zeros, going down columns. Then filters for column (digital) sums of 9 and containing zero, i.e., not all are nonzero. write prints down the columns, so we write to stdout with a width of 4 and a separator of "".







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 22 mins ago









            Giuseppe

            15.4k31051




            15.4k31051











            • Nice answer! I came up with a different route...
              – J.Doe
              6 mins ago
















            • Nice answer! I came up with a different route...
              – J.Doe
              6 mins ago















            Nice answer! I came up with a different route...
            – J.Doe
            6 mins ago




            Nice answer! I came up with a different route...
            – J.Doe
            6 mins ago










            up vote
            1
            down vote














            R, 60 bytes



            Outputs the valid numbers as the names of a vector of 9's.





            x=colSums(sapply(grep(0,999:9999,,,T),utf8ToInt)-48);x[x==9]


            Try it online!





            share
















            • 1




              ah, grep, why do I never remember that it casts to character...
              – Giuseppe
              46 secs ago














            up vote
            1
            down vote














            R, 60 bytes



            Outputs the valid numbers as the names of a vector of 9's.





            x=colSums(sapply(grep(0,999:9999,,,T),utf8ToInt)-48);x[x==9]


            Try it online!





            share
















            • 1




              ah, grep, why do I never remember that it casts to character...
              – Giuseppe
              46 secs ago












            up vote
            1
            down vote










            up vote
            1
            down vote










            R, 60 bytes



            Outputs the valid numbers as the names of a vector of 9's.





            x=colSums(sapply(grep(0,999:9999,,,T),utf8ToInt)-48);x[x==9]


            Try it online!





            share













            R, 60 bytes



            Outputs the valid numbers as the names of a vector of 9's.





            x=colSums(sapply(grep(0,999:9999,,,T),utf8ToInt)-48);x[x==9]


            Try it online!






            share











            share


            share










            answered 7 mins ago









            J.Doe

            1,471111




            1,471111







            • 1




              ah, grep, why do I never remember that it casts to character...
              – Giuseppe
              46 secs ago












            • 1




              ah, grep, why do I never remember that it casts to character...
              – Giuseppe
              46 secs ago







            1




            1




            ah, grep, why do I never remember that it casts to character...
            – Giuseppe
            46 secs ago




            ah, grep, why do I never remember that it casts to character...
            – Giuseppe
            46 secs ago










            up vote
            0
            down vote














            Japt, 20 bytes



            A³ò#〈 ms f_¬x ¥9©Zø0



            A³ò#〈 ms f_¬x ¥9©Zø0 Full program
            A³ò#〈 Range from [1000 9001)
            ms Convert to string
            f_ Filter values that
            ¬x ¥9 Sum equal to 9
            ©Zø0 And contains at least one 0


            Try it online!






            share|improve this answer


























              up vote
              0
              down vote














              Japt, 20 bytes



              A³ò#〈 ms f_¬x ¥9©Zø0



              A³ò#〈 ms f_¬x ¥9©Zø0 Full program
              A³ò#〈 Range from [1000 9001)
              ms Convert to string
              f_ Filter values that
              ¬x ¥9 Sum equal to 9
              ©Zø0 And contains at least one 0


              Try it online!






              share|improve this answer
























                up vote
                0
                down vote










                up vote
                0
                down vote










                Japt, 20 bytes



                A³ò#〈 ms f_¬x ¥9©Zø0



                A³ò#〈 ms f_¬x ¥9©Zø0 Full program
                A³ò#〈 Range from [1000 9001)
                ms Convert to string
                f_ Filter values that
                ¬x ¥9 Sum equal to 9
                ©Zø0 And contains at least one 0


                Try it online!






                share|improve this answer















                Japt, 20 bytes



                A³ò#〈 ms f_¬x ¥9©Zø0



                A³ò#〈 ms f_¬x ¥9©Zø0 Full program
                A³ò#〈 Range from [1000 9001)
                ms Convert to string
                f_ Filter values that
                ¬x ¥9 Sum equal to 9
                ©Zø0 And contains at least one 0


                Try it online!







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 4 mins ago

























                answered 11 mins ago









                Luis felipe De jesus Munoz

                3,25111049




                3,25111049



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f174049%2flist-all-possible-titles-for-the-anno-games%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    What does second last employer means? [closed]

                    List of Gilmore Girls characters

                    One-line joke