{"dataset": "jetbrains", "name": "JetBrains", "kind": "human-rated", "samples": [{"task_id": "JetBrains/e7", "source": "    public class PerniciousNumbers {\n      public static void main(String[] args) {\n        for(int i = 0; i <= 10000; i++) {\n          if(isPernicious(i))\n            System.out.println(i);\n        }\n      }\n\n      public static boolean isPernicious(int num) {\n        int sum = 0;\n        String binary = Integer.toBinaryString(num);\n        for(int i = 0; i < binary.length(); i++)\n          sum += Integer.parseInt(String.valueOf(binary.charAt(i)));\n        return isPrime(sum);\n      }\n\n      public static boolean isPrime(int num) {\n        if(num <= 1)\n          return false;\n        for(int i = 2; i <= Math.sqrt(num); i++) {\n          if(num % i == 0)\n            return false;\n        }\n        return true;\n      }\n    }", "human_rating": 1.0, "metadata": {"snippet_id": "e7", "readable_votes": 22.0, "unreadable_votes": 0.0, "human_readable_vote_fraction": 1.0, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i47", "source": "    import java.math.BigDecimal;\n\n    public class PiToThousandPlaces {\n        public static void main(String[] args) {\n            BigDecimal pi = new BigDecimal(Math.PI);\n            pi = pi.setScale(1000, BigDecimal.ROUND_HALF_UP);\n            System.out.println(pi);\n        }\n    }", "human_rating": 1.0, "metadata": {"snippet_id": "i47", "readable_votes": 11.0, "unreadable_votes": 0.0, "human_readable_vote_fraction": 1.0, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b39", "source": "    public class PrimeNumbers {\n        public static void main(String[] args) {\n            int count = 0;\n            for (int i = 2; i <= 10000; i++) {\n                boolean isPrime = true;\n                for (int j = 2; j <= Math.sqrt(i); j++) {\n                    if (i % j == 0) {\n                        isPrime = false;\n                        break;\n                    }\n                }\n                if (isPrime) {\n                    System.out.println(i);\n                    count++;\n                }\n            }\n            System.out.println(\"Total prime numbers: \" + count);\n        }\n    }", "human_rating": 1.0, "metadata": {"snippet_id": "b39", "readable_votes": 20.0, "unreadable_votes": 0.0, "human_readable_vote_fraction": 1.0, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e12", "source": "    public class EmirpFinder {\n      public static boolean isPrime(int number) {\n        if (number <= 1) {\n          return false;\n        }\n\n        for (int i = 2; i <= Math.sqrt(number); i++) {\n          if (number % i == 0) {\n            return false;\n          }\n        }\n\n        return true;\n      }\n\n      public static int reverseNumber(int number) {\n        int reversedNumber = 0;\n        while (number != 0) {\n          int digit = number % 10;\n          reversedNumber = reversedNumber * 10 + digit;\n          number /= 10;\n        }\n\n        return reversedNumber;\n      }\n\n      public static boolean isEmirp(int number) {\n        int reversedNumber = reverseNumber(number);\n        return isPrime(number) && isPrime(reversedNumber) && number != reversedNumber;\n      }\n\n      public static void main(String[] args) {\n        for (int i = 1; i <= 10000; i++) {\n          if (isEmirp(i)) {\n            System.out.println(i);\n          }\n        }\n      }\n    }", "human_rating": 1.0, "metadata": {"snippet_id": "e12", "readable_votes": 17.0, "unreadable_votes": 0.0, "human_readable_vote_fraction": 1.0, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b40", "source": "    import java.math.BigDecimal;\n    import java.math.MathContext;\n\n    public class Main {\n      public static void main(String[] args) {\n        BigDecimal e = BigDecimal.valueOf(Math.E);\n        String result = e.round(new MathContext(1000)).toString();\n        System.out.println(result);\n      }\n    }", "human_rating": 0.9666666666666667, "metadata": {"snippet_id": "b40", "readable_votes": 29.0, "unreadable_votes": 1.0, "human_readable_vote_fraction": 0.9666666666666667, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b25", "source": "    public class Main {\n       public static void main(String[] args) {\n          for (int i = 0; i < args.length; i++) {\n             int num = Integer.parseInt(args[i]);\n             String suffix;\n             int lastDigit = num % 10;\n             int secondLastDigit = num % 100 / 10;\n             if (secondLastDigit == 1) {\n                suffix = \"th\";\n             } else if (lastDigit == 1) {\n                suffix = \"st\";\n             } else if (lastDigit == 2) {\n                suffix = \"nd\";\n             } else if (lastDigit == 3) {\n                suffix = \"rd\";\n             } else {\n                suffix = \"th\";\n             }\n             System.out.println(num + suffix);\n          }\n       }\n    }", "human_rating": 0.9615384615384616, "metadata": {"snippet_id": "b25", "readable_votes": 25.0, "unreadable_votes": 1.0, "human_readable_vote_fraction": 0.9615384615384616, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i39", "source": "    public class PrimeNumbers {\n       public static void main(String[] args) {\n          int start = 1;\n          int end = 10000;\n\n          for (int i = start; i <= end; i++) {\n             boolean isPrimeNumber = true;\n\n             for (int j = 2; j < i; j++) {\n                if (i % j == 0) {\n                   isPrimeNumber = false;\n                   break;\n                }\n             }\n\n             if (isPrimeNumber) {\n                System.out.println(i);\n             }\n          }\n       }\n    }", "human_rating": 0.9583333333333334, "metadata": {"snippet_id": "i39", "readable_votes": 23.0, "unreadable_votes": 1.0, "human_readable_vote_fraction": 0.9583333333333334, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i43", "source": "    public class TongueTwisters {\n        public static void main(String[] args) {\n            System.out.println(\"How much wood would a woodchuck chuck,\");\n            System.out.println(\"If a woodchuck could chuck wood?\");\n            System.out.println(\"A woodchuck would chuck all the wood he could chuck\");\n            System.out.println(\"If a woodchuck would chuck wood.\\n\");\n        \n            System.out.println(\"Peter Piper picked a peck of pickled peppers.\");\n            System.out.println(\"A peck of pickled peppers Peter Piper picked.\");\n            System.out.println(\"If Peter Piper picked a peck of pickled peppers,\");\n            System.out.println(\"Where's the peck of pickled peppers Peter Piper picked?\\n\");\n        \n            System.out.println(\"She sells seashells by the seashore,\");\n            System.out.println(\"The shells she sells are seashells, I'm sure.\");\n            System.out.println(\"So if she sells seashells on the seashore,\");\n            System.out.println(\"Then I'm sure she sells seashore shells.\");\n        }\n    }", "human_rating": 0.9565217391304348, "metadata": {"snippet_id": "i43", "readable_votes": 22.0, "unreadable_votes": 1.0, "human_readable_vote_fraction": 0.9565217391304348, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i6", "source": "    import java.util.*;\n\n    public class PangramChecker {\n\n        public static void main(String[] args) {\n            for (String sentence : args) {\n                if (isPangram(sentence)) {\n                    System.out.println(sentence);\n                }\n            }\n        }\n    \n        public static boolean isPangram(String sentence) {\n            sentence = sentence.toLowerCase();\n            Set<Character> alphabet = new HashSet<>();\n            for (int i = 0; i < sentence.length(); i++) {\n                char c = sentence.charAt(i);\n                if (c >= 'a' && c <= 'z') {\n                    alphabet.add(c);\n                }\n            }\n            return alphabet.size() == 26;\n        }\n    }", "human_rating": 0.95, "metadata": {"snippet_id": "i6", "readable_votes": 19.0, "unreadable_votes": 1.0, "human_readable_vote_fraction": 0.95, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e24", "source": "    public class IntegerToEnglish {\n       private static final String[] ONES = {\"\", \"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\"};\n       private static final String[] TENS = {\"\", \"ten\", \"twenty\", \"thirty\", \"forty\", \"fifty\", \"sixty\", \"seventy\", \"eighty\", \"ninety\"};\n       private static final String[] TEENS = {\"\", \"eleven\", \"twelve\", \"thirteen\", \"fourteen\", \"fifteen\", \"sixteen\", \"seventeen\", \"eighteen\", \"nineteen\"};\n       private static final String HUNDRED = \"hundred\";\n       private static final String THOUSAND = \"thousand\";\n   \n       public static void main(String[] args) {\n          for (String arg : args) {\n             int n = Integer.parseInt(arg);\n             if (n >= 1000) {\n                System.out.print(ONES[n / 1000] + \" \" + THOUSAND + \" \");\n                n %= 1000;\n             }\n             if (n >= 100) {\n                System.out.print(ONES[n / 100] + \" \" + HUNDRED + \" \");\n                n %= 100;\n             }\n             if (n >= 11 && n <= 19) {\n                System.out.print(TEENS[n - 10] + \" \");\n                n = 0;\n             }\n             if (n >= 10) {\n                System.out.print(TENS[n / 10] + \" \");\n                n %= 10;\n             }\n             if (n > 0) {\n                System.out.print(ONES[n] + \" \");\n             }\n             System.out.println();\n          }\n       }\n    }", "human_rating": 0.95, "metadata": {"snippet_id": "e24", "readable_votes": 19.0, "unreadable_votes": 1.0, "human_readable_vote_fraction": 0.95, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e5", "source": "    public class Divisors {\n     public static void main(String[] args) {\n         for (int i = 1; i <= 100; i++) {\n             System.out.print(\"Divisors of \" + i + \": \");\n             for (int j = 1; j <= i; j++) {\n                 if (i % j == 0) {\n                     System.out.print(j + \" \");\n                 }\n             }\n             System.out.println();\n         }\n     }\n    }", "human_rating": 0.9473684210526315, "metadata": {"snippet_id": "e5", "readable_votes": 18.0, "unreadable_votes": 1.0, "human_readable_vote_fraction": 0.9473684210526315, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e52", "source": "    public class FibonacciNumbers {\n        public static void main(String[] args) {\n            int firstNum = 0, secondNum = 1, nextNum;\n            System.out.println(firstNum);\n\n            for(int i=1; i<=30; i++) {\n                nextNum = firstNum + secondNum;\n                System.out.println(nextNum);\n                firstNum = secondNum;\n                secondNum = nextNum;\n            }\n        }\n    }", "human_rating": 0.9444444444444444, "metadata": {"snippet_id": "e52", "readable_votes": 17.0, "unreadable_votes": 1.0, "human_readable_vote_fraction": 0.9444444444444444, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e59", "source": "    public class VanEckSequence {\n        public static void main(String[] args) {\n            int[] vanEck = new int[1000];\n        \n            // First term is zero\n            vanEck[0] = 0;\n            System.out.println(vanEck[0]);\n        \n            // If last term is new then next term is zero\n            for (int i = 1; i < 1000; i++) {\n                int last = vanEck[i - 1];\n            \n                // Find last occurrence of last term\n                int j;\n                for (j = i - 2; j >= 0; j--) {\n                    if (vanEck[j] == last) {\n                        break;\n                    }\n                }\n            \n                // If last term is new then next term is zero\n                if (j < 0) {\n                    vanEck[i] = 0;\n                } else {\n                    vanEck[i] = i - j - 1;\n                }\n            \n                System.out.println(vanEck[i]);\n            }\n        }\n    }", "human_rating": 0.9411764705882353, "metadata": {"snippet_id": "e59", "readable_votes": 16.0, "unreadable_votes": 1.0, "human_readable_vote_fraction": 0.9411764705882353, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b17", "source": "    import java.math.BigDecimal;\n\n    public class CatalanConstant {\n        public static void main(String[] args) {\n            BigDecimal sum = new BigDecimal(0);\n            BigDecimal term;\n\n            for (int i = 0; i < 1000; i++) {\n                int power = 2 * i + 1;\n                if (i % 2 == 0) {\n                    term = BigDecimal.ONE.divide(new BigDecimal(power), 1000, BigDecimal.ROUND_HALF_UP);\n                    sum = sum.add(term);\n                } else {\n                    term = BigDecimal.ONE.divide(new BigDecimal(power), 1000, BigDecimal.ROUND_HALF_UP);\n                    sum = sum.subtract(term);\n                }\n            }\n\n            System.out.println(\"Catalan's Constant: \" + sum);\n        }\n    }", "human_rating": 0.9411764705882353, "metadata": {"snippet_id": "b17", "readable_votes": 16.0, "unreadable_votes": 1.0, "human_readable_vote_fraction": 0.9411764705882353, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b52", "source": "    class Fibonacci {\n      public static void main(String[] args) {\n        int n = 31, t1 = 0, t2 = 1;\n        System.out.print(\"First \" + n + \" terms: \");\n\n        for (int i = 1; i <= n; ++i) {\n            System.out.print(t1 + \" \");\n\n            int sum = t1 + t2;\n            t1 = t2;\n            t2 = sum;\n        }\n      }\n    }", "human_rating": 0.9375, "metadata": {"snippet_id": "b52", "readable_votes": 15.0, "unreadable_votes": 1.0, "human_readable_vote_fraction": 0.9375, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b43", "source": "    public class TongueTwisters {\n       public static void main(String[] args) {\n          System.out.println(\"How much wood would a woodchuck chuck,\\n\" + \n                             \"If a woodchuck could chuck wood?\\n\" +\n                             \"A woodchuck would chuck all the wood he could chuck\\n\" + \n                             \"If a woodchuck would chuck wood.\\n\");\n      \n          System.out.println(\"Peter Piper picked a peck of pickled peppers.\\n\" +\n                             \"A peck of pickled peppers Peter Piper picked.\\n\" +\n                             \"If Peter Piper picked a peck of pickled peppers,\\n\" +\n                             \"Where's the peck of pickled peppers Peter Piper picked?\\n\");\n\n          System.out.println(\"She sells seashells by the seashore,\\n\" + \n                             \"The shells she sells are seashells, I'm sure.\\n\" +\n                             \"So if she sells seashells on the seashore,\\n\" + \n                             \"Then I'm sure she sells seashore shells.\");\n       }\n    }", "human_rating": 0.9375, "metadata": {"snippet_id": "b43", "readable_votes": 15.0, "unreadable_votes": 1.0, "human_readable_vote_fraction": 0.9375, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 0, "dorn_reversed": 0, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b45", "source": "    public class BeerSong {\n       public static void main(String[] args) {\n           for(int i=99;i>0;i--){\n               System.out.println(i+ \" bottles of beer on the wall, \"+i+\" bottles of beer.\");\n               System.out.println(\"Take one down and pass it around, \"+(i-1)+\" bottles of beer on the wall.\\n\");\n           }\n           System.out.println(\"No more bottles of beer on the wall, no more bottles of beer.\");\n           System.out.println(\"Go to the store and buy some more, 99 bottles of beer on the wall.\");\n       }\n    }", "human_rating": 0.9354838709677419, "metadata": {"snippet_id": "b45", "readable_votes": 29.0, "unreadable_votes": 2.0, "human_readable_vote_fraction": 0.9354838709677419, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e37", "source": "    import java.math.BigDecimal;\n\n    public class TauValue {\n      public static void main(String[] args) {\n        BigDecimal tau = BigDecimal.valueOf(2).multiply(BigDecimal.valueOf(Math.PI));\n        System.out.printf(\"%.1000f\", tau);\n      }\n    }", "human_rating": 0.9333333333333333, "metadata": {"snippet_id": "e37", "readable_votes": 14.0, "unreadable_votes": 1.0, "human_readable_vote_fraction": 0.9333333333333333, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e57", "source": "    public class LuckyNumbers {\n     public static void main(String[] args) {\n     int[] a = new int[1000];\n     for(int i = 0; i < a.length; i++) {\n     a[i] = 2*i + 1;\n     }\n     for(int k = 2; k <= a.length; k++) {\n     for(int i = k-1; i < a.length; i += k-1) {\n     a[i] = 0;\n     }\n     }\n     int count = 0;\n     for(int i = 0; i < a.length; i++) {\n     if(a[i] != 0) {\n     System.out.print(a[i] + \" \");\n     count++;\n     if(count == 1000) {\n     break;\n     }\n     }\n     }\n     }\n    }", "human_rating": 0.06666666666666667, "metadata": {"snippet_id": "e57", "readable_votes": 1.0, "unreadable_votes": 14.0, "human_readable_vote_fraction": 0.06666666666666667, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e43", "source": "    public class TongueTwisters {\n     public static void main(String[] args) {\n         // Print the first tongue twister\n         System.out.println(\"How much wood would a woodchuck chuck,\");\n         System.out.println(\"If a woodchuck could chuck wood?\");\n         System.out.println(\"A woodchuck would chuck all the wood he could chuck\");\n         System.out.println(\"If a woodchuck would chuck wood.\\n\");\n     \n         // Print the second tongue twister\n         System.out.println(\"Peter Piper picked a peck of pickled peppers.\");\n         System.out.println(\"A peck of pickled peppers Peter Piper picked.\");\n         System.out.println(\"If Peter Piper picked a peck of pickled peppers,\");\n         System.out.println(\"Where's the peck of pickled peppers Peter Piper picked?\\n\");\n     \n         // Print the third tongue twister\n         System.out.println(\"She sells seashells by the seashore,\");\n         System.out.println(\"The shells she sells are seashells, I'm sure.\");\n         System.out.println(\"So if she sells seashells on the seashore,\");\n         System.out.println(\"Then I'm sure she sells seashore shells.\");\n     }\n    }", "human_rating": 0.92, "metadata": {"snippet_id": "e43", "readable_votes": 23.0, "unreadable_votes": 2.0, "human_readable_vote_fraction": 0.92, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i41", "source": "    import java.math.BigDecimal;\n\n    public class EulerMascheroniConstant {\n       public static void main(String[] args) {\n          BigDecimal gamma = new BigDecimal(\"0.57721566490153286060651209\");\n          System.out.println(gamma.setScale(1000, BigDecimal.ROUND_HALF_UP));\n       }\n    }", "human_rating": 0.9166666666666666, "metadata": {"snippet_id": "i41", "readable_votes": 22.0, "unreadable_votes": 2.0, "human_readable_vote_fraction": 0.9166666666666666, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i12", "source": "    \n    public class Emirp {\n        public static void main(String[] args) {\n            for (int i = 2; i <= 10000; i++) {\n                if(isPrime(i)) {\n                    int reversed = reverseNumber(i);\n                    if(isPrime(reversed) && reversed != i) {\n                        System.out.println(i);\n                    }\n                }\n            }\n        }\n\n        public static boolean isPrime(int num) {\n            if(num < 2) {\n                return false;\n            }\n            for(int i = 2; i <= Math.sqrt(num); i++) {\n                if(num % i == 0) {\n                    return false;\n                }\n            }\n            return true;\n        }\n\n        public static int reverseNumber(int num) {\n            int reversed = 0;\n            while(num > 0) {\n                reversed = (reversed * 10) + (num % 10);\n                num /= 10;\n            }\n            return reversed;\n        }\n    }\n    ", "human_rating": 0.9130434782608695, "metadata": {"snippet_id": "i12", "readable_votes": 21.0, "unreadable_votes": 2.0, "human_readable_vote_fraction": 0.9130434782608695, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i13", "source": "    public class EvilNumber {\n\n      public static void main(String[] args) {\n        for (int i = 0; i <= 1000; i++) {\n          String binary = Integer.toBinaryString(i);\n          int ones = binary.replaceAll(\"0\", \"\").length();\n          if (ones % 2 == 0) {\n            System.out.println(i);\n          }\n        }\n      }\n    }", "human_rating": 0.9047619047619048, "metadata": {"snippet_id": "i13", "readable_votes": 19.0, "unreadable_votes": 2.0, "human_readable_vote_fraction": 0.9047619047619048, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i37", "source": "    import java.math.BigDecimal;\n\n    public class Main {\n\n        public static void main(String[] args) {\n            BigDecimal pi = new BigDecimal(\"3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679\");\n            BigDecimal tau = pi.multiply(new BigDecimal(\"2\"));\n            System.out.println(tau.setScale(1000, BigDecimal.ROUND_HALF_UP));\n        }\n\n    }", "human_rating": 0.9047619047619048, "metadata": {"snippet_id": "i37", "readable_votes": 19.0, "unreadable_votes": 2.0, "human_readable_vote_fraction": 0.9047619047619048, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b12", "source": "    public class Emirp {\n       public static void main(String[] args) {\n          int count = 0;\n          for (int i = 1; i <= 10000; i++) {\n             if (isPrime(i) && isPrime(reverseNumber(i)) && i != reverseNumber(i)) {\n                System.out.println(i);\n                count++;\n             }\n          }\n       }\n       public static int reverseNumber(int number) {\n          int reverse = 0;\n          while (number != 0) {\n             reverse = reverse * 10 + number % 10;\n             number /= 10;\n          }\n          return reverse;\n       }\n       public static boolean isPrime(int number) {\n          if (number == 1 || number == 0) {\n             return false;\n          }\n          for (int i = 2; i <= Math.sqrt(number); i++) {\n             if (number % i == 0) {\n                return false;\n             }\n          }\n          return true;\n       }\n    }", "human_rating": 0.9047619047619048, "metadata": {"snippet_id": "b12", "readable_votes": 19.0, "unreadable_votes": 2.0, "human_readable_vote_fraction": 0.9047619047619048, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i9", "source": "    public class SmithNumber {\n        public static void main(String[] args) {\n            for (int i = 1; i <= 10000; i++) {\n                if (isSmithNumber(i)) {\n                    System.out.println(i);\n                }\n            }\n        }\n\n        private static boolean isSmithNumber(int number) {\n            int digitSum = digitSum(number);\n            int factorSum = factorSum(number);\n            return digitSum == factorSum && !isPrime(number);\n        }\n\n        private static int digitSum(int number) {\n            int sum = 0;\n            while (number > 0) {\n                sum += number % 10;\n                number /= 10;\n            }\n            return sum;\n        }\n\n        private static int factorSum(int number) {\n            int sum = 0;\n            for (int i = 2; i <= number; i++) {\n                while (number % i == 0) {\n                    sum += digitSum(i);\n                    number /= i;\n                }\n            }\n            return sum;\n        }\n\n        private static boolean isPrime(int number) {\n            if (number < 2) {\n                return false;\n            }\n            for (int i = 2; i <= Math.sqrt(number); i++) {\n                if (number % i == 0) {\n                    return false;\n                }\n            }\n            return true;\n        }\n    }", "human_rating": 0.9047619047619048, "metadata": {"snippet_id": "i9", "readable_votes": 19.0, "unreadable_votes": 2.0, "human_readable_vote_fraction": 0.9047619047619048, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b47", "source": "    import java.math.BigDecimal;\n\n    public class PiTo1000Digits {\n       public static void main(String[] args) {\n          BigDecimal pi = new BigDecimal(\"3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679\");\n          System.out.println(pi);\n       }\n    }", "human_rating": 0.9, "metadata": {"snippet_id": "b47", "readable_votes": 18.0, "unreadable_votes": 2.0, "human_readable_vote_fraction": 0.9, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b5", "source": "    class Main {\n      public static void main(String[] args) {\n        for(int i=1; i<=100; i++) {\n          System.out.println(\"Divisors of \" + i + \":\");\n          for(int j=1; j<=i; j++) {\n            if(i%j==0) {\n              System.out.print(j + \" \");\n            }\n          }\n          System.out.println();\n        }\n      }\n    }", "human_rating": 0.9, "metadata": {"snippet_id": "b5", "readable_votes": 18.0, "unreadable_votes": 2.0, "human_readable_vote_fraction": 0.9, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b13", "source": "    public class EvilNumbers {\n        public static void main(String[] args) {\n            for(int i = 0; i <= 1000; i++) {\n                String binary = Integer.toBinaryString(i);\n                int ones = 0;\n                for(int j = 0; j < binary.length(); j++) {\n                    if(binary.charAt(j) == '1') {\n                        ones++;\n                    }\n                }\n                if(ones % 2 == 0) {\n                    System.out.println(i);\n                }\n            }\n        }\n    }", "human_rating": 0.9, "metadata": {"snippet_id": "b13", "readable_votes": 18.0, "unreadable_votes": 2.0, "human_readable_vote_fraction": 0.9, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b9", "source": "    public class SmithNumber {\n      public static void main(String[] args) {\n        for(int i = 0; i <= 10000; i++){\n          if(isSmith(i)){\n            System.out.println(i);\n          }\n        }\n      }\n\n      public static boolean isSmith(int n){\n        int digitSum = getDigitSum(n);\n        int factorSum = getFactorSum(n);\n        return !isPrime(n) && digitSum == factorSum;\n      }\n\n      public static int getDigitSum(int n){\n        int sum = 0;\n        while(n > 0){\n          sum += n % 10;\n          n /= 10;\n        }\n        return sum;\n      }\n\n      public static int getFactorSum(int n){\n        int sum = 0;\n        for(int i = 2; i <= n; i++){\n          while(n % i == 0){\n            sum += getDigitSum(i);\n            n /= i;\n          }\n        }\n        return sum;\n      }\n\n      public static boolean isPrime(int n){\n        if(n <= 1){\n          return false;\n        }\n        for(int i = 2; i <= Math.sqrt(n); i++){\n          if(n % i == 0){\n            return false;\n          }\n        }\n        return true;\n      }\n    }", "human_rating": 0.9, "metadata": {"snippet_id": "b9", "readable_votes": 18.0, "unreadable_votes": 2.0, "human_readable_vote_fraction": 0.9, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i14", "source": "    public class OdiousNumbers {\n       public static void main(String[] args) {\n          for (int i = 0; i <= 1000; i++) {\n             String binary = Integer.toBinaryString(i);\n             int count = 0;\n             for (int j = 0; j < binary.length(); j++) {\n                if (binary.charAt(j) == '1') {\n                   count++;\n                }\n             }\n             if (count % 2 != 0) {\n                System.out.println(i);\n             }\n          }\n       }\n    }", "human_rating": 0.8888888888888888, "metadata": {"snippet_id": "i14", "readable_votes": 16.0, "unreadable_votes": 2.0, "human_readable_vote_fraction": 0.8888888888888888, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e46", "source": "    public class NumberPrinter {\n     public static void main(String[] args) {\n      for (int i = 1; i <= 1000; i++) {\n       boolean isMultipleOfTwo = i % 2 == 0;\n       boolean isMultipleOfThree = i % 3 == 0;\n       boolean isMultipleOfFive = i % 5 == 0;\n       boolean isMultipleOfSeven = i % 7 == 0;\n\n       if (isMultipleOfTwo) {\n        System.out.print(\"Foo\");\n       }\n       if (isMultipleOfThree) {\n        System.out.print(\"Fizz\");\n       }\n       if (isMultipleOfFive) {\n        System.out.print(\"Buzz\");\n       }\n       if (isMultipleOfSeven) {\n        System.out.print(\"Bar\");\n       }\n\n       if (!isMultipleOfTwo && !isMultipleOfThree && !isMultipleOfFive && !isMultipleOfSeven) {\n        System.out.print(i);\n       }\n\n       System.out.println();\n      }\n     }\n    }", "human_rating": 0.8846153846153846, "metadata": {"snippet_id": "e46", "readable_votes": 23.0, "unreadable_votes": 3.0, "human_readable_vote_fraction": 0.8846153846153846, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e41", "source": "    import java.math.BigDecimal;\n\n    public class EulerMascheroniConstant {\n        public static void main(String[] args) {\n            BigDecimal gamma = BigDecimal.valueOf(0.57721566490153286060651209);\n            gamma.setScale(1000, BigDecimal.ROUND_HALF_UP);\n            System.out.println(gamma);\n        }\n    }", "human_rating": 0.8695652173913043, "metadata": {"snippet_id": "e41", "readable_votes": 20.0, "unreadable_votes": 3.0, "human_readable_vote_fraction": 0.8695652173913043, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b41", "source": "    import java.math.BigDecimal;\n\n    public class EulerMascheroniConstant {\n        public static void main(String[] args) {\n            BigDecimal gamma = new BigDecimal(\"0.57721566490153286060651209\");\n            gamma = gamma.setScale(1000, BigDecimal.ROUND_HALF_UP);\n            System.out.println(gamma);\n        }\n    }", "human_rating": 0.8695652173913043, "metadata": {"snippet_id": "b41", "readable_votes": 20.0, "unreadable_votes": 3.0, "human_readable_vote_fraction": 0.8695652173913043, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e19", "source": "    public class ChristmasTrees {\n        public static void main(String[] args) {\n            for (int size = 3; size <= 9; size++) {\n                drawTree(size);\n                System.out.println(); // blank line separator\n            }\n        }\n\n        private static void drawTree(int size) {\n            int trunkHeight = size / 3;\n            int branchWidth = 1;\n            for (int row = 0; row < size; row++) {\n                drawRow(size, trunkHeight, branchWidth, row);\n                branchWidth += (row < size - 1) ? 2 : 0; // increase branch width except for last row\n            }\n            drawTrunk(size, trunkHeight);\n        }\n\n        private static void drawRow(int size, int trunkHeight, int branchWidth, int row) {\n            int spaces = size - row - 1;\n            for (int i = 0; i < spaces; i++) {\n                System.out.print(\" \");\n            }\n            for (int i = 0; i < branchWidth; i++) {\n                System.out.print(\"*\");\n            }\n            System.out.println();\n        }\n\n        private static void drawTrunk(int size, int trunkHeight) {\n            int spaces = size - 1;\n            for (int i = 0; i < spaces; i++) {\n                System.out.print(\" \");\n            }\n            System.out.println(\"*\"); // single asterisk for trunk base\n            for (int i = 0; i < trunkHeight - 1; i++) { // additional lines for trunk height\n                for (int j = 0; j < spaces; j++) {\n                    System.out.print(\" \");\n                }\n                System.out.println(\"*\");\n            }\n        }\n    }", "human_rating": 0.8695652173913043, "metadata": {"snippet_id": "e19", "readable_votes": 20.0, "unreadable_votes": 3.0, "human_readable_vote_fraction": 0.8695652173913043, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b34", "source": "    public class LeapYear {\n       public static void main(String[] args) {\n          for (int year = 1800; year <= 2400; year++) {\n             if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n                System.out.print(year + \" \");\n             }\n          }\n       }\n    }", "human_rating": 0.85, "metadata": {"snippet_id": "b34", "readable_votes": 17.0, "unreadable_votes": 3.0, "human_readable_vote_fraction": 0.85, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b46", "source": "    class Main {\n      public static void main(String[] args) {\n        for (int i = 1; i <= 1000; i++) {\n          String output = \"\";\n          if (i % 2 == 0) {\n            output += \"Foo\";\n          }\n          if (i % 3 == 0) {\n            output += \"Fizz\";\n          }\n          if (i % 5 == 0) {\n            output += \"Buzz\";\n          }\n          if (i % 7 == 0) {\n            output += \"Bar\";\n          }\n          if (output.equals(\"\")) {\n            System.out.println(i);\n          } else {\n            System.out.println(output);\n          }\n        }\n      }\n    }", "human_rating": 0.8461538461538461, "metadata": {"snippet_id": "b46", "readable_votes": 22.0, "unreadable_votes": 4.0, "human_readable_vote_fraction": 0.8461538461538461, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e40", "source": "    import java.math.BigDecimal;\n\n    public class PrintEuler {\n       public static void main(String[] args) {\n           System.out.println(calcEuler().toPlainString());\n       }\n\n       public static BigDecimal calcEuler() {\n           BigDecimal e = BigDecimal.ONE;\n           BigDecimal fact = BigDecimal.ONE;\n           int precision = 1000;\n\n           for (int i = 1; i <= precision; i++) {\n               fact = fact.multiply(new BigDecimal(i));\n               e = e.add(BigDecimal.ONE.divide(fact, precision, BigDecimal.ROUND_HALF_UP));\n           }\n           return e.round(new java.math.MathContext(precision));\n       }\n    }", "human_rating": 0.8421052631578947, "metadata": {"snippet_id": "e40", "readable_votes": 16.0, "unreadable_votes": 3.0, "human_readable_vote_fraction": 0.8421052631578947, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b55", "source": "    public class LevenshteinDistance {\n       public static int calculate(String word1, String word2) {\n          int[][] distance = new int[word1.length() + 1][word2.length() + 1];\n\n          for (int i = 0; i <= word1.length(); i++) {\n             distance[i][0] = i;\n          }\n          for (int j = 1; j <= word2.length(); j++) {\n             distance[0][j] = j;\n          }\n\n          for (int i = 1; i <= word1.length(); i++) {\n             for (int j = 1; j <= word2.length(); j++) {\n                distance[i][j] = Math.min(\n                   Math.min(distance[i - 1][j] + 1, distance[i][j - 1] + 1),\n                   distance[i - 1][j - 1] + ((word1.charAt(i - 1) == word2.charAt(j - 1)) ? 0 : 1));\n             }\n          }\n\n          return distance[word1.length()][word2.length()];\n       }\n\n       public static void main(String[] args) {\n          for (int i = 0; i < args.length; i += 2) {\n             String word1 = args[i];\n             String word2 = args[i + 1];\n             System.out.println(calculate(word1, word2));\n          }\n       }\n    }", "human_rating": 0.8421052631578947, "metadata": {"snippet_id": "b55", "readable_votes": 16.0, "unreadable_votes": 3.0, "human_readable_vote_fraction": 0.8421052631578947, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e34", "source": "    public class LeapYears {\n       public static void main(String[] args) {\n          int year;\n          for (year = 1800; year <= 2400; year++) {\n             if (year % 4 == 0 && !(year % 100 == 0 && year % 400 != 0)) {\n                System.out.println(year);\n             }\n          }\n       }\n    }", "human_rating": 0.84, "metadata": {"snippet_id": "e34", "readable_votes": 21.0, "unreadable_votes": 4.0, "human_readable_vote_fraction": 0.84, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b44", "source": "    import java.math.BigDecimal;\n\n    public class GoldenRatio {\n      public static void main(String[] args) {\n        BigDecimal phi = BigDecimal.valueOf(1.618033988749894848204586834);\n        phi = phi.setScale(1000, BigDecimal.ROUND_HALF_UP);\n        System.out.println(phi);\n      }\n    }", "human_rating": 0.8235294117647058, "metadata": {"snippet_id": "b44", "readable_votes": 14.0, "unreadable_votes": 3.0, "human_readable_vote_fraction": 0.8235294117647058, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i60", "source": "    public class GameOfLife {\n       public static void main(String[] args) {\n          int[][] grid = new int[32][32];\n          //input initial state of the grid\n          for (int i = 0; i < 32; i++) {\n             for (int j = 0; j < 32; j++) {\n                //assuming dead cells are represented by 0, and live cells by 1\n                grid[i][j] = inputGrid[i][j];\n             }\n          }\n          int[][] newGrid = new int[32][32];\n          //iterate through each cell\n          for (int i = 0; i < 32; i++) {\n             for (int j = 0; j < 32; j++) {\n                //count the number of live neighbors\n                int liveNeighbors = 0;\n                for (int x = -1; x <= 1; x++) {\n                   for (int y = -1; y <= 1; y++) {\n                      if (x == 0 && y == 0) {\n                         continue;\n                      }\n                      int row = i + x;\n                      int col = j + y;\n                      if (row < 0 || col<0 || row>=32 || col>=32) {\n                         continue;\n                      }\n                      if (grid[row][col] == 1) {\n                         liveNeighbors++;\n                      }\n                   }\n                }\n                //apply the rules of the game\n                if (grid[i][j] == 1 && (liveNeighbors == 2 || liveNeighbors == 3)) {\n                   newGrid[i][j] = 1; //cell survives\n                } else if (grid[i][j] == 0 && liveNeighbors == 3) {\n                   newGrid[i][j] = 1; //dead cell becomes alive\n                } else {\n                   newGrid[i][j] = 0; //cell dies or stays dead\n                }\n             }\n          }\n          //print the new state of the grid\n          for (int i = 0; i < 32; i++) {\n             for (int j = 0; j < 32; j++) {\n                System.out.print(newGrid[i][j]);\n             }\n             System.out.println();\n          }\n       }\n    }", "human_rating": 0.8235294117647058, "metadata": {"snippet_id": "i60", "readable_votes": 14.0, "unreadable_votes": 3.0, "human_readable_vote_fraction": 0.8235294117647058, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i45", "source": "    public class Main {\n      public static void main(String[] args) {\n        int bottles = 99;\n        String word = \"bottles\";\n        while (bottles > 0) {\n          if (bottles == 1) {\n            word = \"bottle\";\n          }\n          System.out.println(bottles + \" \" + word + \" of beer on the wall, \" + bottles + \" \" + word + \" of beer.\");\n          bottles--;\n          if (bottles == 1) {\n            word = \"bottle\";\n          }\n          if (bottles == 0) {\n            System.out.println(\"Take one down and pass it around, no more bottles of beer on the wall.\");\n          } else {\n            System.out.println(\"Take one down and pass it around, \" + bottles + \" \" + word + \" of beer on the wall.\");\n          }\n        }\n        System.out.println(\"No more bottles of beer on the wall, no more bottles of beer.\");\n        System.out.println(\"Go to the store and buy some more, 99 bottles of beer on the wall.\");\n      }\n    }", "human_rating": 0.8214285714285714, "metadata": {"snippet_id": "i45", "readable_votes": 23.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.8214285714285714, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e51", "source": "    public class CollatzConjecture {\n       public static void main(String[] args) {\n          for (int i = 1; i <= 1000; i++) {\n             int stoppingTime = 0;\n             int number = i;\n             while (number != 1) {\n                if (number % 2 == 0) {\n                   number = number / 2;\n                } else {\n                   number = number * 3 + 1;\n                }\n                stoppingTime++;\n             }\n             System.out.println(stoppingTime);\n          }\n       }\n    }", "human_rating": 0.8214285714285714, "metadata": {"snippet_id": "e51", "readable_votes": 23.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.8214285714285714, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i34", "source": "    public class LeapYear {\n       public static void main(String[] args) {\n          int startYear = 1800;\n          int endYear = 2400;\n          for(int year=startYear; year<=endYear; year++) {\n             if (year % 4 == 0) {\n                if (year % 100 == 0) {\n                   if (year % 400 == 0) {\n                      System.out.print(year + \", \");\n                   }\n                }\n                else {\n                   System.out.print(year + \", \");\n                }\n             }\n          }\n       }\n    }", "human_rating": 0.8, "metadata": {"snippet_id": "i34", "readable_votes": 20.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.8, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b54", "source": "    public class KolakoskiSequence {\n        public static void main(String[] args) {\n            int[] sequence = new int[1000];\n            sequence[0] = 1;\n            sequence[1] = 2;\n            int index = 2;\n            int runLength = 1;\n            int currentNumber = 2;\n            while (index < 1000) {\n                for (int i = 0; i < runLength; i++) {\n                    sequence[index++] = currentNumber;\n                }\n                currentNumber = currentNumber == 1 ? 2 : 1;\n                runLength = sequence[runLength] == 1 ? 2 : 1;\n            }\n            for (int i = 0; i < sequence.length; i++) {\n                System.out.print(sequence[i] + \" \");\n            }\n        }\n    }", "human_rating": 0.8, "metadata": {"snippet_id": "b54", "readable_votes": 20.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.8, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b58", "source": "    import java.math.BigInteger;\n\n    public class CatalanNumber {\n        public static void main(String[] args) {\n            BigInteger binomial = BigInteger.ONE;\n            for (int n = 0; n <= 99; n++) {\n                BigInteger numerator = BigInteger.ONE;\n                for (int i = 2 * n; i > n; i--) {\n                    numerator = numerator.multiply(BigInteger.valueOf(i));\n                }\n                BigInteger denominator = BigInteger.ONE;\n                for (int i = n; i >= 1; i--) {\n                    denominator = denominator.multiply(BigInteger.valueOf(i));\n                }\n                BigInteger catalan = numerator.divide(denominator).divide(BigInteger.valueOf(n + 1));\n                System.out.println(\"C(\" + n + \") = \" + catalan);\n            }\n        }\n    }", "human_rating": 0.8, "metadata": {"snippet_id": "b58", "readable_votes": 12.0, "unreadable_votes": 3.0, "human_readable_vote_fraction": 0.8, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b7", "source": "    public class PerniciousNumbers {\n       public static void main(String[] args) {\n          for (int i = 0; i <= 10000; i++) {\n             String binary = Integer.toBinaryString(i);\n             int sum = 0;\n             for (int j = 0; j < binary.length(); j++) {\n                if (binary.charAt(j) == '1') {\n                   sum++;\n                }\n             }\n             boolean isPrime = true;\n             for (int j = 2; j <= sum / 2; j++) {\n                if (sum % j == 0) {\n                   isPrime = false;\n                   break;\n                }\n             }\n             if (isPrime && sum > 1) {\n                System.out.println(i);\n             }\n          }\n       }\n    }", "human_rating": 0.8, "metadata": {"snippet_id": "b7", "readable_votes": 16.0, "unreadable_votes": 4.0, "human_readable_vote_fraction": 0.8, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i51", "source": "    public class CollatzConjecture {\n        public static void main(String[] args) {\n            for (int i = 1; i <= 1000; i++) {\n                int n = i;\n                int count = 0;\n                while (n != 1) {\n                    if (n % 2 == 0) {\n                        n /= 2;\n                    } else {\n                        n = n * 3 + 1;\n                    }\n                    count++;\n                }\n                System.out.println(count);\n            }\n        }\n    }", "human_rating": 0.8, "metadata": {"snippet_id": "i51", "readable_votes": 16.0, "unreadable_votes": 4.0, "human_readable_vote_fraction": 0.8, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b4", "source": "    public class NivenNumbers {\n       public static void main(String[] args) {\n          for(int i = 1; i <= 10000; i++) { \n             int sum = 0;\n             int number = i;\n             while(number > 0) {\n                sum += number % 10;\n                number /= 10;\n             }\n             if(i % sum == 0) {\n                System.out.println(i);\n             }\n          }  \n       }\n    }", "human_rating": 0.8, "metadata": {"snippet_id": "b4", "readable_votes": 20.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.8, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e6", "source": "    public class PangramChecker {\n        public static void main(String[] args) {\n            for(String sentence: args) {\n                if(isPangram(sentence)) {\n                    System.out.println(sentence);\n                }\n            }\n        }\n\n        public static boolean isPangram(String sentence) {\n            boolean[] letters = new boolean[26];\n            int index;\n\n            for(int i = 0; i < sentence.length(); i++) {\n                char c = sentence.charAt(i);\n\n                if(Character.isLetter(c)) {\n                    if(Character.isUpperCase(c)) {\n                        index = c - 'A';\n                    } else {\n                        index = c - 'a';\n                    }\n\n                    letters[index] = true;\n                }\n            }\n\n            for(boolean letter: letters) {\n                if(!letter) {\n                    return false;\n                }\n            }\n\n            return true;\n        }\n    }", "human_rating": 0.7916666666666666, "metadata": {"snippet_id": "e6", "readable_votes": 19.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.7916666666666666, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i21", "source": "    import java.math.BigInteger;\n\n    public class JacobiSymbol {\n\n      public static int jacobiSymbol(int a, int n) {\n        int t = 1;\n        while (a != 0) {\n          while (a % 2 == 0) {\n            a /= 2;\n            int r = n % 8;\n            if (r == 3 || r == 5) {\n              t = -t;\n            }\n          }\n          int temp = a;\n          a = n;\n          n = temp;\n          if (a % 4 == n % 4 && n % 4 == 3) {\n            t = -t;\n          }\n          a %= n;\n        }\n        if (n == 1) {\n          return t;\n        } else {\n          return 0;\n        }\n      }\n\n      public static void main(String[] args) {\n        for (int i = 0; i < args.length; i += 2) {\n          int a = Integer.parseInt(args[i]);\n          int n = Integer.parseInt(args[i + 1]);\n          System.out.println(jacobiSymbol(a, n));\n        }\n      }\n    }", "human_rating": 0.21428571428571427, "metadata": {"snippet_id": "i21", "readable_votes": 3.0, "unreadable_votes": 11.0, "human_readable_vote_fraction": 0.21428571428571427, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e45", "source": "    public class BeerSong {\n     public static void main(String[] args) {\n     for(int i=99; i>0; i--){\n     System.out.println(i + \" bottles of beer on the wall, \" + i + \" bottles of beer.\");\n     System.out.println(\"Take one down and pass it around, \" + (i-1) + \" bottles of beer on the wall.\");\n     }\n     System.out.println(\"No more bottles of beer on the wall, no more bottles of beer.\");\n     System.out.println(\"Go to the store and buy some more, 99 bottles of beer on the wall.\");\n     }\n    }", "human_rating": 0.7727272727272727, "metadata": {"snippet_id": "e45", "readable_votes": 17.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.7727272727272727, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i8", "source": "    public class Quine {\n        public static void main(String[] args) {\n            char q = 34;\n            String[] lines = {\n                \"public class Quine {\",\n                \"    public static void main(String[] args) {\",\n                \"        char q = 34;\",\n                \"        String[] lines = {\",\n                \"        };\",\n                \"        for (int i = 0; i < 4; i++) {\",\n                \"            System.out.println(lines[i]);\",\n                \"        }\",\n                \"        for (int i = 0; i < lines.length; i++) {\",\n                \"            System.out.println(lines[4] + q + lines[i] + q + ',');\",\n                \"        }\",\n                \"        for (int i = 5; i < lines.length; i++) {\",\n                \"            System.out.println(lines[i]);\",\n                \"        }\",\n                \"    }\",\n                \"}\",\n            };\n            for (int i = 0; i < 4; i++) {\n                System.out.println(lines[i]);\n            }\n            for (int i = 0; i < lines.length; i++) {\n                System.out.println(lines[4] + q + lines[i] + q + ',');\n            }\n            for (int i = 5; i < lines.length; i++) {\n                System.out.println(lines[i]);\n            }\n        }\n    }", "human_rating": 0.7647058823529411, "metadata": {"snippet_id": "i8", "readable_votes": 13.0, "unreadable_votes": 4.0, "human_readable_vote_fraction": 0.7647058823529411, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i35", "source": "        public class PascalTriangle {\n       public static void main(String[] args) {\n          int rows = 20;\n          for(int i = 0; i < rows; i++){\n             int number = 1;\n             System.out.format(\"%\"+(rows-i)*2+\"s\",\"\");\n             for(int j=0;j<=i;j++){\n                System.out.format(\"%4d\",number);\n                number = number * (i - j) / (j + 1);\n             }\n             System.out.println();\n          }\n       }\n    }\n    ", "human_rating": 0.7619047619047619, "metadata": {"snippet_id": "i35", "readable_votes": 16.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.7619047619047619, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i46", "source": "    public class Main {\n      public static void main(String[] args) {\n        for (int i = 1; i <= 1000; i++) {\n          String output = \"\";\n          if (i % 2 == 0) {\n            output += \"Foo\";\n          }\n          if (i % 3 == 0) {\n            output += \"Fizz\";\n          }\n          if (i % 5 == 0) {\n            output += \"Buzz\";\n          }\n          if (i % 7 == 0) {\n            output += \"Bar\";\n          }\n          if (output.equals(\"\")) {\n            System.out.println(i);\n          } else {\n            System.out.println(output);\n          }\n        }\n      }\n    }", "human_rating": 0.7619047619047619, "metadata": {"snippet_id": "i46", "readable_votes": 16.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.7619047619047619, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i5", "source": "        public class Divisors {\n       public static void main(String[] args) {\n          for(int i=1; i<=100; i++) {\n             System.out.print(i+\": \");\n             for(int j=1; j<=i; j++) {\n                if(i%j == 0) {\n                   System.out.print(j+\" \");\n                }\n             }\n             System.out.println();\n          }\n       }\n    }\n    ", "human_rating": 0.7619047619047619, "metadata": {"snippet_id": "i5", "readable_votes": 16.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.7619047619047619, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e39", "source": "    public class PrimeNumbers {\n        public static void main(String[] args) {\n            for(int i=2;i<=10000;i++){\n                boolean flag=true;\n                for(int j=2;j<=Math.sqrt(i);j++){\n                    if(i%j==0){\n                        flag=false;\n                        break;\n                    }\n                }\n                if(flag)\n                    System.out.println(i);\n            }\n        }\n    }", "human_rating": 0.75, "metadata": {"snippet_id": "e39", "readable_votes": 15.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.75, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e35", "source": "    public class PascalTriangle {\n        public static void main(String[] args) {\n            int numRows = 20;\n            int[][] triangle = new int[numRows][];\n        \n            for (int i = 0; i < numRows; i++) {\n                triangle[i] = new int[i + 1];\n                triangle[i][0] = 1;\n            \n                for (int j = 1; j < i; j++) {\n                    triangle[i][j] = triangle[i-1][j-1] + triangle[i-1][j];\n                }\n            \n                triangle[i][i] = 1;\n            }\n        \n            for (int i = 0; i < numRows; i++) {\n                for (int j = 0; j < triangle[i].length; j++) {\n                    System.out.print(triangle[i][j] + \" \");\n                }\n                System.out.println();\n            }\n        }\n    }", "human_rating": 0.7368421052631579, "metadata": {"snippet_id": "e35", "readable_votes": 14.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.7368421052631579, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i7", "source": "    public class PerniciousNumber {\n\n        public static void main(String[] args) {\n            int limit = 10000;\n            for (int i = 0; i <= limit; i++) {\n                String binary = Integer.toBinaryString(i);\n                int sum = 0;\n                for (int j = 0; j < binary.length(); j++) {\n                    if (binary.charAt(j) == '1') {\n                        sum++;\n                    }\n                }\n\n                boolean isPrime = true;\n                for (int k = 2; k < sum; k++) {\n                    if (sum % k == 0) {\n                        isPrime = false;\n                        break;\n                    }\n                }\n\n                if (isPrime) {\n                    System.out.println(i);\n                }\n            }\n        }\n    }", "human_rating": 0.7333333333333333, "metadata": {"snippet_id": "i7", "readable_votes": 11.0, "unreadable_votes": 4.0, "human_readable_vote_fraction": 0.7333333333333333, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i40", "source": "    import java.math.BigDecimal;\n\n    public class Main {\n        public static void main(String[] args) {\n            BigDecimal e = BigDecimal.ONE;\n            BigDecimal factorial = BigDecimal.ONE;\n\n            for(int i = 1; i <= 1000; i++) {\n                factorial = factorial.multiply(BigDecimal.valueOf(i));\n                e = e.add(BigDecimal.ONE.divide(factorial, 1000, BigDecimal.ROUND_HALF_UP));\n            }\n\n            System.out.println(e);\n        }\n    }", "human_rating": 0.7272727272727273, "metadata": {"snippet_id": "i40", "readable_votes": 16.0, "unreadable_votes": 6.0, "human_readable_vote_fraction": 0.7272727272727273, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b56", "source": "    public class LookAndSay {\n       public static void main(String[] args) {\n           String sequence = \"1\";\n           for (int i = 0; i < 20; i++) {\n               System.out.println(sequence);\n               sequence = nextSequence(sequence);\n           }\n       }\n       public static String nextSequence(String sequence) {\n           StringBuilder next = new StringBuilder();\n           char digit = sequence.charAt(0);\n           int count = 1;\n           for (int i = 1; i <= sequence.length(); i++) {\n               if (i == sequence.length() || sequence.charAt(i) != digit) {\n                   next.append(count).append(digit);\n                   if (i != sequence.length()) {\n                       digit = sequence.charAt(i);\n                       count = 1;\n                   }\n               } else {\n                   count++;\n               }\n           }\n           return next.toString();\n       }\n    }", "human_rating": 0.7272727272727273, "metadata": {"snippet_id": "b56", "readable_votes": 16.0, "unreadable_votes": 6.0, "human_readable_vote_fraction": 0.7272727272727273, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e17", "source": "    import java.math.BigDecimal;\n\n    public class CatalanConstant {\n       public static void main(String[] args) {\n          BigDecimal sum = new BigDecimal(0);\n          BigDecimal term;\n          int sign;\n          for (int k = 0; k < 1000; k++) {\n             sign = (k % 2 == 0) ? 1 : -1;\n             term = BigDecimal.ONE.divide(new BigDecimal(2*k + 1).pow(2), 1000, BigDecimal.ROUND_HALF_UP);\n             term = term.multiply(new BigDecimal(sign));\n             sum = sum.add(term);\n          }\n          sum = sum.multiply(new BigDecimal(4));\n          System.out.println(sum);\n       }\n    }", "human_rating": 0.7272727272727273, "metadata": {"snippet_id": "e17", "readable_votes": 16.0, "unreadable_votes": 6.0, "human_readable_vote_fraction": 0.7272727272727273, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e4", "source": "    public class NivenNumbers {\n       public static void main(String[] args) {\n          for(int i=1; i<=10000; i++){\n             int sum = 0;\n             int num = i;\n             while(num != 0){\n                int digit = num % 10;\n                sum += digit;\n                num /= 10;\n             }\n             if(i % sum == 0){\n                System.out.println(i);\n             }\n          }\n       }\n    }", "human_rating": 0.7222222222222222, "metadata": {"snippet_id": "e4", "readable_votes": 13.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.7222222222222222, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e47", "source": "    import java.math.BigDecimal;\n\n    public class PiPrinter {\n      public static void main(String[] args) {\n        BigDecimal pi = computePi(1000);\n        System.out.println(pi);\n      }\n\n      private static BigDecimal computePi(final int SCALE) {\n        BigDecimal arctan1_5 = arctan(5, SCALE);\n        BigDecimal arctan1_239 = arctan(239, SCALE);\n        BigDecimal pi = arctan1_5.multiply(BigDecimal.valueOf(4)).subtract(arctan1_239).multiply(BigDecimal.valueOf(4));\n        return pi.setScale(SCALE, BigDecimal.ROUND_HALF_UP);\n      }\n\n      private static BigDecimal arctan(int inverseX, int SCALE) {\n        BigDecimal result, numer, term;\n        BigDecimal invX = BigDecimal.valueOf(inverseX);\n        BigDecimal invX2 = BigDecimal.valueOf(inverseX * inverseX);\n        numer = BigDecimal.ONE.divide(invX, SCALE, BigDecimal.ROUND_HALF_UP);\n\n        result = numer;\n        int i = 1;\n        do {\n          numer = numer.divide(invX2, SCALE, BigDecimal.ROUND_HALF_UP);\n          int denom = 2 * i + 1;\n          term = numer.divide(BigDecimal.valueOf(denom), SCALE, BigDecimal.ROUND_HALF_UP);\n          if ((i % 2) != 0)\n            result = result.subtract(term);\n          else\n            result = result.add(term);\n          i++;\n        } while (term.compareTo(BigDecimal.ZERO) != 0);\n        return result;\n      }\n    }", "human_rating": 0.7222222222222222, "metadata": {"snippet_id": "e47", "readable_votes": 13.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.7222222222222222, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i54", "source": "    public class KolakoskiSequence {\n        public static void main(String[] args) {\n            int[] sequence = {1, 2, 2}; // starting sequence\n            int index = 0; // index of current element\n            int count = sequence[0]; // count of current element\n\n            for (int i = 0; i < 1000; i++) { // print first 1000 elements\n                if (count == 0) { // if count is 0, move to next element\n                    index++;\n                    if (index >= sequence.length) { // if at end of sequence, reset index\n                        index = 0;\n                    }\n                    count = sequence[index]; // reset count\n                }\n                System.out.print(sequence[index] + \" \"); // print current element\n                count--; // decrement count\n            }\n        }\n    }", "human_rating": 0.7222222222222222, "metadata": {"snippet_id": "i54", "readable_votes": 13.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.7222222222222222, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b60", "source": "    public class GameOfLife {\n        public static void main(String[] args) {\n            char[][] grid = new char[32][32];\n            // fill the grid with initial values\n            for (int i = 0; i < 32; i++) {\n                for (int j = 0; j < 32; j++) {\n                    // assign random value of # or .\n                    grid[i][j] = Math.random() > 0.5 ? '#' : '.';\n                }\n            }\n            // calculate the next state of the grid\n            char[][] nextGrid = new char[32][32];\n            for (int i = 0; i < 32; i++) {\n                for (int j = 0; j < 32; j++) {\n                    int liveNeighbours = countLiveNeighbours(grid, i, j);\n                    if (grid[i][j] == '#' && (liveNeighbours == 2 || liveNeighbours == 3)) {\n                        nextGrid[i][j] = '#';\n                    } else if (grid[i][j] == '.' && liveNeighbours == 3) {\n                        nextGrid[i][j] = '#';\n                    } else {\n                        nextGrid[i][j] = '.';\n                    }\n                }\n            }\n            // output the next state of the grid\n            for (int i = 0; i < 32; i++) {\n                for (int j = 0; j < 32; j++) {\n                    System.out.print(nextGrid[i][j]);\n                }\n                System.out.println();\n            }\n        }\n\n        private static int countLiveNeighbours(char[][] grid, int i, int j) {\n            int count = 0;\n            for (int x = -1; x <= 1; x++) {\n                for (int y = -1; y <= 1; y++) {\n                    int row = i + x;\n                    int col = j + y;\n                    if (row >= 0 && row < 32 && col >= 0 && col < 32 && !(x == 0 && y == 0)) {\n                        count += grid[row][col] == '#' ? 1 : 0;\n                    }\n                }\n            }\n            return count;\n        }\n    }", "human_rating": 0.7096774193548387, "metadata": {"snippet_id": "b60", "readable_votes": 22.0, "unreadable_votes": 9.0, "human_readable_vote_fraction": 0.7096774193548387, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b35", "source": "    class PascalTriangle {\n       public static void main(String[] args) {\n          int rows = 20;\n          for(int i = 0; i < rows; i++) {\n             int number = 1;\n             System.out.format(\"%\"+(rows-i)*2+\"s\",\"\");\n             for(int j=0; j <= i; j++) {\n                System.out.format(\"%4d\",number);\n                number = number * (i - j) / (j + 1);\n             }\n             System.out.println();\n          }\n       }\n    }", "human_rating": 0.7083333333333334, "metadata": {"snippet_id": "b35", "readable_votes": 17.0, "unreadable_votes": 7.0, "human_readable_vote_fraction": 0.7083333333333334, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e58", "source": "    public class CatalanNumbers {\n       public static void main(String[] args) {\n          for (int n = 0; n <= 99; n++) {\n             System.out.println(catalan(n));\n          }\n       }\n   \n       public static long catalan(int n) {\n          long res = 1;\n          for (int i = 1; i <= n; i++) {\n             res *= ((long) n + i) / i;\n          }\n          return res / (n + 1);\n       }\n    }", "human_rating": 0.7083333333333334, "metadata": {"snippet_id": "e58", "readable_votes": 17.0, "unreadable_votes": 7.0, "human_readable_vote_fraction": 0.7083333333333334, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e49", "source": "    public class NumberSequence {\n        public static void main(String[] args) {\n            int[] sequence = new int[250]; // Creating an array to hold the sequence up to 250 terms\n            sequence[0] = 0; // Assigning the first term\n            for (int i = 1; i < 250; i++) {\n                if (sequence[i-1] - i > 0 && !contains(sequence, sequence[i-1] - i, i)) {\n                    sequence[i] = sequence[i-1] - i;\n                } else {\n                    sequence[i] = sequence[i-1] + i;\n                }\n                System.out.println(sequence[i]); // Printing each term\n            }\n        }\n    \n        // Helper method to check if a number is already in the sequence\n        public static boolean contains(int[] sequence, int number, int index) {\n            for (int i = 0; i < index; i++) {\n                if (sequence[i] == number) {\n                    return true;\n                }\n            }\n            return false;\n        }\n    }", "human_rating": 0.6956521739130435, "metadata": {"snippet_id": "e49", "readable_votes": 16.0, "unreadable_votes": 7.0, "human_readable_vote_fraction": 0.6956521739130435, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i11", "source": "    public class Main {\n        public static void main(String[] args) {\n            for (int i = 1; i <= 1000; i++) {\n                int sum = 0;\n                for (int j = 1; j < i; j++) {\n                    if (i % j == 0) {\n                        sum += j;\n                    }\n                }\n                if (sum > i) {\n                    System.out.println(i);\n                }\n            }\n        }\n    }", "human_rating": 0.6956521739130435, "metadata": {"snippet_id": "i11", "readable_votes": 16.0, "unreadable_votes": 7.0, "human_readable_vote_fraction": 0.6956521739130435, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b59", "source": "    public class VanEckSequence {\n        public static void main(String[] args) {\n            int[] sequence = new int[1000];\n            sequence[0] = 0;\n\n            for (int i = 1; i < 1000; i++) {\n                boolean isNew = true;\n                for (int j = i - 2; j >= 0; j--) {\n                    if (sequence[i - 1] == sequence[j]) {\n                        sequence[i] = i - j - 1;\n                        isNew = false;\n                        break;\n                    }\n                }\n                if (isNew) {\n                    sequence[i] = 0;\n                }\n            }\n\n            for (int i = 0; i < 1000; i++) {\n                System.out.println(sequence[i]);\n            }\n        }\n    }", "human_rating": 0.6956521739130435, "metadata": {"snippet_id": "b59", "readable_votes": 16.0, "unreadable_votes": 7.0, "human_readable_vote_fraction": 0.6956521739130435, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b37", "source": "    import java.math.BigDecimal;\n    public class Tau {\n      public static void main(String[] args) {\n        BigDecimal tau = new BigDecimal(\"6.2831853071795864769252867665590057683943387987502116419498891846156328125724179972560696506842341359300233671393466936366514225442519341423098002793217061979956374392033218671644769517974190847351028787445903739982466823971900666184320625130251339\");\n        System.out.println(tau);\n      }\n    }", "human_rating": 0.6842105263157895, "metadata": {"snippet_id": "b37", "readable_votes": 13.0, "unreadable_votes": 6.0, "human_readable_vote_fraction": 0.6842105263157895, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b10", "source": "    public class VampireNumbers {\n      public static void main(String[] args) {\n        for(int num = 1000; num <= 999999; num++) {\n          String str = String.valueOf(num);\n          int len = str.length();\n          if(len % 2 == 1)\n            continue;\n          for(int fang1 = 10; fang1 <= Math.sqrt(num); fang1++) {\n            if(num % fang1 != 0)\n              continue;\n            int fang2 = num / fang1;\n            String s1 = String.valueOf(fang1);\n            String s2 = String.valueOf(fang2);\n            if(s1.length() != len/2 || s2.length() != len/2)\n              continue;\n            String s = s1 + s2;\n            char[] arr1 = str.toCharArray();\n            char[] arr2 = s.toCharArray();\n            Arrays.sort(arr1);\n            Arrays.sort(arr2);\n            if(Arrays.equals(arr1, arr2)) {\n              System.out.println(num);\n              break;\n            }\n          }\n        }\n      }\n    }", "human_rating": 0.3157894736842105, "metadata": {"snippet_id": "b10", "readable_votes": 6.0, "unreadable_votes": 13.0, "human_readable_vote_fraction": 0.3157894736842105, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i36", "source": "    import java.math.BigDecimal;\n\n    public class Main {\n       public static void main(String[] args) {\n           BigDecimal a = new BigDecimal(2);\n           BigDecimal r = new BigDecimal(Math.sqrt(2));\n           int scale = 1000;\n           BigDecimal r2 = r.setScale(scale, BigDecimal.ROUND_HALF_UP);\n           BigDecimal ans = a.multiply(r2).setScale(scale);\n           System.out.println(ans);\n       }\n    }", "human_rating": 0.6666666666666666, "metadata": {"snippet_id": "i36", "readable_votes": 20.0, "unreadable_votes": 10.0, "human_readable_vote_fraction": 0.6666666666666666, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e13", "source": "    public class EvilNumber {\n      public static void main(String[] args) {\n        for (int i = 0; i < 1001; i++) {\n          String binary = Integer.toBinaryString(i);\n          int count = 0;\n          for (int j = 0; j < binary.length(); j++) {\n            if (binary.charAt(j) == '1') {\n              count++;\n            }\n          }\n          if (count % 2 == 0) {\n            System.out.println(i);\n          }\n        }\n      }\n    }", "human_rating": 0.6666666666666666, "metadata": {"snippet_id": "e13", "readable_votes": 14.0, "unreadable_votes": 7.0, "human_readable_vote_fraction": 0.6666666666666666, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e56", "source": "    public class LookAndSay {\n        public static void main(String[] args) {\n            int MAX_TERM = 20;\n            String[] sequence = new String[MAX_TERM];\n            sequence[0] = \"1\";\n            for (int i = 1; i < MAX_TERM; i++) {\n                StringBuilder sb = new StringBuilder();\n                char last = sequence[i - 1].charAt(0);\n                int count = 1;\n                for (int j = 1; j < sequence[i - 1].length(); j++) {\n                    char current = sequence[i - 1].charAt(j);\n                    if (current == last) {\n                        count++;\n                    } else {\n                        sb.append(count);\n                        sb.append(last);\n                        count = 1;\n                        last = current;\n                    }\n                }\n                sb.append(count);\n                sb.append(last);\n                sequence[i] = sb.toString();\n            }\n            for (String term : sequence) {\n                System.out.println(term);\n            }\n        }\n    }", "human_rating": 0.3333333333333333, "metadata": {"snippet_id": "e56", "readable_votes": 5.0, "unreadable_votes": 10.0, "human_readable_vote_fraction": 0.3333333333333333, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b24", "source": "    public class Main {\n        private static final String[] ones = {\"\", \"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"ten\", \"eleven\", \"twelve\", \"thirteen\", \"fourteen\", \"fifteen\", \"sixteen\", \"seventeen\", \"eighteen\", \"nineteen\"};\n        private static final String[] tens = {\"\", \"\", \"twenty\", \"thirty\", \"forty\", \"fifty\", \"sixty\", \"seventy\", \"eighty\", \"ninety\"};\n        public static void main(String[] args) {\n            for (String arg : args) {\n                int num = Integer.parseInt(arg);\n                if (num == 0) {\n                    System.out.println(\"zero\");\n                } else {\n                    System.out.println(convert(num));\n                }\n            }\n        }\n        private static String convert(int num) {\n            if (num < 20) {\n                return ones[num];\n            }\n            if (num < 100) {\n                return tens[num/10] + ((num % 10 != 0) ? \" \" : \"\") + ones[num%10];\n            }\n            if (num < 1000) {\n                return ones[num/100] + \" hundred\" + ((num % 100 != 0) ? \" and \" : \"\") + convert(num % 100);\n            }\n            return \"one thousand\";\n        }\n    }", "human_rating": 0.6551724137931034, "metadata": {"snippet_id": "b24", "readable_votes": 19.0, "unreadable_votes": 10.0, "human_readable_vote_fraction": 0.6551724137931034, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b15", "source": "    import java.util.Scanner;\n\n    public class BrainfuckInterpreter {\n        public static void main(String[] args) {\n            Scanner input = new Scanner(System.in);\n\n            String[] programs = args;\n            for (String program : programs) {\n                int[] array = new int[30000];\n                int ptr = 0;\n                int length = program.length();\n                int i = 0;\n                while (i < length) {\n                    char c = program.charAt(i);\n                    switch(c) {\n                        case '>': ptr++; break;\n                        case '<': ptr--; break;\n                        case '+': array[ptr]++; break;\n                        case '-': array[ptr]--; break;\n                        case '.': System.out.print((char) array[ptr]); break;\n                        case '[': if (array[ptr] == 0) {\n                                        int depth = 1;\n                                        while (depth != 0) {\n                                            i++;\n                                            char next = program.charAt(i);\n                                            if (next == '[') depth++;\n                                            else if (next == ']') depth--;\n                                        }\n                                   } break;\n                        case ']': if (array[ptr] != 0) {\n                                        int depth = 1;\n                                        while (depth != 0) {\n                                            i--;\n                                            char prev = program.charAt(i);\n                                            if (prev == ']') depth++;\n                                            else if (prev == '[') depth--;\n                                        }\n                                   } break;\n                    }\n                    i++;\n                }\n            }\n        }\n    }", "human_rating": 0.34615384615384615, "metadata": {"snippet_id": "b15", "readable_votes": 9.0, "unreadable_votes": 17.0, "human_readable_vote_fraction": 0.34615384615384615, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i52", "source": "    public class FibonacciSequence {\n        public static void main(String[] args) {\n            int f0 = 0, f1 = 1, f2, count = 30;\n            System.out.println(f0);\n            System.out.println(f1);\n\n            for (int i = 2; i <= count; i++) {\n                f2 = f0 + f1;\n                System.out.println(f2);\n                f0 = f1;\n                f1 = f2;\n            }\n        }\n    }", "human_rating": 0.6521739130434783, "metadata": {"snippet_id": "i52", "readable_votes": 15.0, "unreadable_votes": 8.0, "human_readable_vote_fraction": 0.6521739130434783, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i2", "source": "    public class HappyNumbers {\n\n        public static boolean isHappy(int n) {\n            int slow = n, fast = n;\n            do {\n                slow = digitSquareSum(slow);\n                fast = digitSquareSum(digitSquareSum(fast));\n            } while (slow != fast);\n            return slow == 1;\n        }\n\n        public static int digitSquareSum(int n) {\n            int sum = 0, tmp;\n            while (n > 0) {\n                tmp = n % 10;\n                sum += tmp * tmp;\n                n /= 10;\n            }\n            return sum;\n        }\n\n        public static void main(String[] args) {\n            for (int i = 1; i <= 1000; i++) {\n                if (isHappy(i)) {\n                    System.out.println(i);\n                }\n            }\n        }\n    }", "human_rating": 0.65, "metadata": {"snippet_id": "i2", "readable_votes": 13.0, "unreadable_votes": 7.0, "human_readable_vote_fraction": 0.65, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i4", "source": "    public class NivenNumbers {\n      public static void main(String[] args) {\n        for (int i = 1; i <= 10000; i++) {\n          int sum = 0;\n          int num = i;\n          while (num > 0) {\n            sum += num % 10;\n            num = num / 10;\n          }\n          if (i % sum == 0) {\n            System.out.println(i);\n          }\n        }\n      }\n    }", "human_rating": 0.65, "metadata": {"snippet_id": "i4", "readable_votes": 13.0, "unreadable_votes": 7.0, "human_readable_vote_fraction": 0.65, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i53", "source": "    import java.math.BigInteger;\n    public class Kolakoski {\n        public static void main(String[] args) {\n            int[] sequence = {1, 2, 2};\n            BigInteger numerator = BigInteger.ONE;\n            BigInteger denominator = BigInteger.ONE;\n            StringBuilder binary = new StringBuilder(\"0.\");\n            int count = 0;\n            for (int i = 0; i < 1000; ++i) {\n                int length = sequence[i % sequence.length];\n                binary.append(count % 2);\n                if (count % 2 == 0) {\n                    numerator = numerator.multiply(BigInteger.valueOf(length));\n                } else {\n                    denominator = denominator.multiply(BigInteger.valueOf(length));\n                }\n                if (++count == length) {\n                    count = 0;\n                    ++i;\n                    sequence = new int[]{sequence[1], sequence[0] == 1 ? 2 : 1};\n                }\n            }\n            BigInteger gcd = numerator.gcd(denominator);\n            BigInteger simplifiedNumerator = numerator.divide(gcd);\n            BigInteger simplifiedDenominator = denominator.divide(gcd);\n            String fraction = simplifiedNumerator.toString() + \"/\" + simplifiedDenominator.toString();\n            System.out.println(binary);\n        }\n    }", "human_rating": 0.65, "metadata": {"snippet_id": "i53", "readable_votes": 13.0, "unreadable_votes": 7.0, "human_readable_vote_fraction": 0.65, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e60", "source": "    public class GameOfLife {\n        public static void main(String[] args) {\n            char[][] grid = new char[32][32];\n            // initialize grid with \"#\" or \".\"\n        \n            for(int i=0; i<32; i++) {\n                for(int j=0; j<32; j++) {\n                    int liveNeighbors = countLiveNeighbors(grid, i, j);\n                    if(grid[i][j] == '#' && liveNeighbors < 2 || liveNeighbors > 3) {\n                        grid[i][j] == '.';\n                    } else if(grid[i][j] == '.' && liveNeighbors == 3) {\n                        grid[i][j] == '#';\n                    }\n                }\n            }\n            // print grid\n        }\n    \n        private static int countLiveNeighbors(char[][] grid, int row, int col) {\n            int count = 0;\n            for(int i=row-1; i<=row+1; i++) {\n                for(int j=col-1; j<=col+1; j++) {\n                    if(i>=0 && j>=0 && i<32 && j<32 && !(i==row && j==col)) {\n                        if(grid[i][j] == '#') {\n                            count++;\n                        }\n                    }\n                }\n            }\n            return count;\n        }\n    }", "human_rating": 0.35, "metadata": {"snippet_id": "e60", "readable_votes": 7.0, "unreadable_votes": 13.0, "human_readable_vote_fraction": 0.35, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e9", "source": "    import java.util.*;\n    public class SmithNumbers {\n      public static boolean isPrime(int num) {\n        if(num==1)\n          return false;\n        for(int i=2;i*i<=num;i++) {\n          if(num%i==0)\n            return false;\n        }\n        return true;\n      }\n      public static int digitSum(int num) {\n        int sum=0;\n        while(num>0) {\n          sum+=num%10;\n          num/=10;\n        }\n        return sum;\n      }\n      public static int primefactorSum(int num) {\n        int sum=0;\n        for(int i=2;i<=num;i++) {\n          if(isPrime(i) && num%i==0) {\n            sum+=digitSum(i);\n            num/=i;\n            i=1;\n          }\n        }\n        return sum;\n      }\n      public static void main(String[] args) {\n        for(int i=0;i<=10000;i++) {\n          if(!isPrime(i)&&(digitSum(i)==primefactorSum(i))) {\n            System.out.println(i);\n          }\n        }\n      }\n    }", "human_rating": 0.6470588235294118, "metadata": {"snippet_id": "e9", "readable_votes": 11.0, "unreadable_votes": 6.0, "human_readable_vote_fraction": 0.6470588235294118, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i64", "source": "    public class InventorySequence {\n      public static void main(String[] args) {\n        int[] sequence = new int[1000];\n        sequence[0] = 0;\n        int index = 1;\n        while (index < 1000) {\n          int current = sequence[index - 1];\n          int count = 0;\n          for (int i = 0; i < index; i++) {\n            if (sequence[i] == current) {\n              count++;\n            }\n          }\n          sequence[index] = count;\n          index++;\n          if (!inArray(current, sequence, index - 1)) {\n            sequence[index] = 0;\n            index++;\n          }\n        }\n        for (int i = 0; i < 1000; i++) {\n          System.out.println(sequence[i]);\n        }\n      }\n\n      public static boolean inArray(int value, int[] array, int endIndex) {\n        for (int i = 0; i < endIndex; i++) {\n          if (array[i] == value) {\n            return true;\n          }\n        }\n        return false;\n      }\n    }", "human_rating": 0.6428571428571429, "metadata": {"snippet_id": "i64", "readable_votes": 9.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.6428571428571429, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b11", "source": "    public class AbundantNumbers {\n       public static void main(String[] args) {\n\n          for (int i = 1; i < 1001; i++) {\n             int sum = 0;\n             for (int j = 1; j < i; j++) {\n                if (i % j == 0) {\n                   sum += j;\n                }\n             }\n             if (sum > i) {\n                System.out.println(i);\n             }\n          }\n       }\n    }", "human_rating": 0.631578947368421, "metadata": {"snippet_id": "b11", "readable_votes": 12.0, "unreadable_votes": 7.0, "human_readable_vote_fraction": 0.631578947368421, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e25", "source": "    public class IntegerSuffix {\n     public static void main(String[] args) {\n         String[] suffixes = {\"th\", \"st\", \"nd\", \"rd\", \"th\", \"th\", \"th\", \"th\", \"th\", \"th\"}; //suffixes array\n         for (int i = 0; i < args.length; i++) {\n             int num = Integer.parseInt(args[i]);\n             int index = (num % 100 > 10 && num % 100 < 14) ? 0 : num % 10; //determine index for suffix\n             System.out.println(num + suffixes[index]);\n         }\n     }\n    }", "human_rating": 0.6190476190476191, "metadata": {"snippet_id": "e25", "readable_votes": 13.0, "unreadable_votes": 8.0, "human_readable_vote_fraction": 0.6190476190476191, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e42", "source": "    public class AsciiTable {\n       public static void main(String[] args){\n          for(int i=0;i<16;i++){\n             System.out.print(Integer.toHexString(i).toUpperCase()+\": \");\n             for(int j=0;j<6;j++){\n                char c = (char)(i*6+j);\n                if(c<32) {\n                   c = '.';\n                }\n                System.out.print(c+\" \");\n             }\n             System.out.println();\n          }\n       }\n    }", "human_rating": 0.38461538461538464, "metadata": {"snippet_id": "e42", "readable_votes": 5.0, "unreadable_votes": 8.0, "human_readable_vote_fraction": 0.38461538461538464, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b42", "source": "    public class HexASCIITable {\n       public static void main(String[] args) {\n          for (int i = 0; i < 16; i++) {\n             System.out.print(Integer.toHexString(i).toUpperCase() + \": \");\n             for (int j = 0; j < 8; j++) {\n                int c = i * 8 + j;\n                if (c > 127) {\n                   System.out.print(\"DEL \");\n                } else {\n                   System.out.print((char)c + \" \");\n                }\n             }\n             System.out.println();\n          }\n       }\n    }", "human_rating": 0.6153846153846154, "metadata": {"snippet_id": "b42", "readable_votes": 16.0, "unreadable_votes": 10.0, "human_readable_vote_fraction": 0.6153846153846154, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e63", "source": "    public class SevenSegmentDisplay {\n        private static final String[][] SEGMENTS = {\n                {\" \", \"_\", \" \"},\n                {\"|\", \"_\", \"|\"},\n                {\"|\", \"_\", \"|\"},\n                {\"|\", \" \", \"|\"},\n                {\"|\", \"_\", \"|\"},\n                {\"|\", \"_\", \"|\"},\n                {\"|\", \"_\", \"|\"},\n        };\n\n        public static void main(String[] args) {\n            if (args.length != 1) {\n                System.out.println(\"Usage: SevenSegmentDisplay <number>\");\n                return;\n            }\n            String number = args[0];\n            for (int i = 0; i < SEGMENTS.length; i++) {\n                StringBuilder line = new StringBuilder();\n                for (int j = 0; j < number.length(); j++) {\n                    char c = number.charAt(j);\n                    int index = c - '0';\n                    line.append(SEGMENTS[i][index]);\n                }\n                System.out.println(line.toString());\n            }\n        }\n    }", "human_rating": 0.3888888888888889, "metadata": {"snippet_id": "e63", "readable_votes": 7.0, "unreadable_votes": 11.0, "human_readable_vote_fraction": 0.3888888888888889, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e8", "source": "    public class Quine {\n     public static void main(String[] args) {\n      String s=\"public class Quine {\\n public static void main(String[] args) {\\n  String s=%c%s%c;%n  System.out.printf(s,34,s,34);\\n }\\n}\"; //initialize string with code\n      System.out.printf(s,34,s,34); //print string with format specifier\n     }\n    }", "human_rating": 0.39285714285714285, "metadata": {"snippet_id": "e8", "readable_votes": 11.0, "unreadable_votes": 17.0, "human_readable_vote_fraction": 0.39285714285714285, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i20", "source": "    public class Diamond {\n      public static void main(String[] args) {\n        for (int i = 1; i <= 9; i++) {\n          for (int j = 1; j <= 9 - i; j++) {\n            System.out.print(\" \");\n          }\n          for (int j = 1; j <= i * 2 - 1; j++) {\n            System.out.print(j > i ? i * 2 - j : j);\n          }\n          System.out.println();\n        }\n        for (int i = 8; i >= 1; i--) {\n          for (int j = 1; j <= 9 - i; j++) {\n            System.out.print(\" \");\n          }\n          for (int j = 1; j <= i * 2 - 1; j++) {\n            System.out.print(j > i ? i * 2 - j : j);\n          }\n          System.out.println();\n        }\n      }\n    }", "human_rating": 0.4, "metadata": {"snippet_id": "i20", "readable_votes": 8.0, "unreadable_votes": 12.0, "human_readable_vote_fraction": 0.4, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i3", "source": "    \n    public class LeylandNumbers {\n        public static void main(String[] args) {\n            long max = 100000000000L;\n            for (long x = 2; x * x < max; x++) {\n                for (long y = 2; y <= Math.pow(max, 1.0 / (x - 1)); y++) {\n                    long n = (long) (Math.pow(x, y) + Math.pow(y, x));\n                    if (n >= max) {\n                        break;\n                    }\n                    System.out.println(n);\n                }\n            }\n        }\n    }\n    ", "human_rating": 0.5925925925925926, "metadata": {"snippet_id": "i3", "readable_votes": 16.0, "unreadable_votes": 11.0, "human_readable_vote_fraction": 0.5925925925925926, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e14", "source": "    public class OdiousNumbers {\n      public static void main(String[] args) {\n        for(int i = 0; i <= 1000; i++) {\n          int count = countOnesInBinary(i);\n          if(count % 2 == 1) {\n            System.out.println(i);\n          }\n        }\n      }\n  \n      private static int countOnesInBinary(int num) {\n        int count = 0;\n        while(num > 0) {\n          if(num % 2 == 1) {\n            count++;\n          }\n          num = num / 2;\n        }\n        return count;\n      }\n    }", "human_rating": 0.5909090909090909, "metadata": {"snippet_id": "e14", "readable_votes": 13.0, "unreadable_votes": 9.0, "human_readable_vote_fraction": 0.5909090909090909, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i57", "source": "    public class LuckyNumbers {\n        public static void main(String[] args) {\n            int[] a = new int[1000];\n            //initialize array with odd numbers\n            for (int i = 0, num = 1; i < a.length; i++, num += 2) {\n                a[i] = num;\n            }\n            //sieve process\n            for (int k = 2; k <= 1000; k++) {\n                int index = 0;\n                for (int i = 0, j = 1; i < a.length; i++) {\n                    if (j == k) {\n                        j = 1;\n                    } else {\n                        a[index++] = a[i];\n                        j++;\n                    }\n                }\n            }\n            //print first 1000 terms\n            for (int i = 0; i < a.length; i++) {\n                System.out.print(a[i] + \" \");\n            }\n        }\n    }", "human_rating": 0.4090909090909091, "metadata": {"snippet_id": "i57", "readable_votes": 9.0, "unreadable_votes": 13.0, "human_readable_vote_fraction": 0.4090909090909091, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b14", "source": "    public class OdiousNumbers {\n       public static void main(String[] args) {\n          for (int i = 0; i <= 1000; i++) {\n             int count = 0;\n             for (int j = i; j > 0; j >>= 1) {\n                count += j & 1;\n             }\n             if (count % 2 == 1) {\n                System.out.println(i);\n             }\n          }\n       }\n    }", "human_rating": 0.5862068965517241, "metadata": {"snippet_id": "b14", "readable_votes": 17.0, "unreadable_votes": 12.0, "human_readable_vote_fraction": 0.5862068965517241, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i58", "source": "    public class CatalanNumbers {\n        public static void main(String[] args) {\n            for (int n = 0; n <= 99; n++) {\n                long result = binomial(2*n, n)/(n+1);\n                System.out.println(result);\n            }\n        }\n\n        private static long binomial(int n, int k) {\n            if (k > n-k) {\n                k = n-k;\n            }\n            long b = 1;\n            for (int i = 1, m = n; i <= k; i++, m--) {\n                b = b*m/i;\n            }\n            return b;\n        }\n    }", "human_rating": 0.5833333333333334, "metadata": {"snippet_id": "i58", "readable_votes": 7.0, "unreadable_votes": 5.0, "human_readable_vote_fraction": 0.5833333333333334, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b64", "source": "    public class InventorySequence {\n       public static void main(String[] args) {\n           int[] sequence = new int[1000];\n           sequence[0] = 0;\n           int currentIndex = 1;\n           while(currentIndex < 1000) {\n               int count = 0;\n               for(int j = 0; j < currentIndex; j++) {\n                   if(sequence[j] == sequence[currentIndex-1])\n                       count++;\n               }\n               sequence[currentIndex] = count;\n               if(count == 0) {\n                   sequence[currentIndex] = 0;\n                   currentIndex++;\n               }\n               else {\n                   currentIndex++;\n               }\n           }\n           for(int k = 0; k < 1000; k++)\n               System.out.println(sequence[k]);\n       }\n    }", "human_rating": 0.5789473684210527, "metadata": {"snippet_id": "b64", "readable_votes": 11.0, "unreadable_votes": 8.0, "human_readable_vote_fraction": 0.5789473684210527, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b57", "source": "    public class LuckyNumberSequence {\n       public static void main(String[] args) {\n          int[] sequence = new int[1000];\n          int index = 0;\n          int value = 1;\n          while (index < 1000) {\n             sequence[index++] = value;\n             int k = 2;\n             while (index < 1000 && k <= index) {\n                int deleteIndex = k * value - 1;\n                while (deleteIndex < index) {\n                   for (int i = deleteIndex; i < index - 1; i++) {\n                      sequence[i] = sequence[i + 1];\n                   }\n                   index--;\n                   deleteIndex += k - 1;\n                }\n                k++;\n             }\n             value = sequence[index - 1] + 2;\n          }\n          for (int i = 0; i < sequence.length; i++) {\n             System.out.print(sequence[i] + \" \");\n          }\n       }\n    }", "human_rating": 0.43333333333333335, "metadata": {"snippet_id": "b57", "readable_votes": 13.0, "unreadable_votes": 17.0, "human_readable_vote_fraction": 0.43333333333333335, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i25", "source": "    public class IntegerOrdinalSuffix {\n       public static void main(String[] args) {\n          String[] suffixes = new String[]{\"th\",\"st\",\"nd\",\"rd\",\"th\",\"th\",\"th\",\"th\",\"th\",\"th\"};\n          for (String arg : args) {\n             int i = Integer.parseInt(arg);\n             int ii = i % 100;\n             String suffix = suffixes[(ii>=11&&ii<=13)?0:(ii%10)];\n             System.out.println(i + suffix);\n          }\n       }\n    }", "human_rating": 0.43478260869565216, "metadata": {"snippet_id": "i25", "readable_votes": 10.0, "unreadable_votes": 13.0, "human_readable_vote_fraction": 0.43478260869565216, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 1, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e2", "source": "    public class HappyNumbers {\n       public static void main(String[] args) {\n          for(int i = 1; i <= 1000; i++) {\n             int num = i;\n             while(num != 1 && num != 4) {\n                int sum = 0;\n                while(num > 0) {\n                   int digit = num % 10;\n                   sum += digit * digit;\n                   num /= 10;\n                }\n                num = sum;\n            }\n            if(num == 1) {\n               System.out.println(i);\n            }\n          }\n       }\n    }", "human_rating": 0.4375, "metadata": {"snippet_id": "e2", "readable_votes": 7.0, "unreadable_votes": 9.0, "human_readable_vote_fraction": 0.4375, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i49", "source": "    public class Main {\n       public static void main(String[] args) {\n          int[] sequence = new int[251];\n          sequence[0] = 0;\n          for (int i = 1; i <= 250; i++) {\n             sequence[i] = sequence[i - 1] - i;\n             if (sequence[i] <= 0 || contains(sequence, sequence[i], i - 1)) {\n                sequence[i] = sequence[i - 1] + i;\n             }\n             System.out.println(sequence[i]);\n          }\n       }\n       public static boolean contains(int[] sequence, int value, int endIndex) {\n          for (int i = 0; i < endIndex; i++) {\n             if (sequence[i] == value) {\n                return true;\n             }\n          }\n          return false;\n       }\n    }", "human_rating": 0.5625, "metadata": {"snippet_id": "i49", "readable_votes": 9.0, "unreadable_votes": 7.0, "human_readable_vote_fraction": 0.5625, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e18", "source": "    public class DrawCubes {\n       public static void main(String[] args) {\n          int size = 1;\n      \n          while (size <= 7) {\n             // draw top of cube\n             for (int i = 0; i < size; i++) {\n                System.out.print(\"█─\");\n             }\n             System.out.println(\"█\");\n         \n             // draw sides of cube\n             for (int i = 0; i < size - 1; i++) {\n                for (int j = size - 1; j > i; j--) {\n                   System.out.print(\" \");\n                }\n                System.out.print(\"╱\");\n                for (int j = 0; j < i; j++) {\n                   System.out.print(\"  \");\n                }\n                System.out.println(\"│\");\n             }\n         \n             // draw bottom of cube\n             System.out.print(\"█─\");\n             for (int i = 0; i < size - 2; i++) {\n                System.out.print(\"──\");\n             }\n             System.out.println(\"█\");\n         \n             // print blank line before next cube\n             System.out.println();\n         \n             size++;\n          }\n       }\n    }", "human_rating": 0.5625, "metadata": {"snippet_id": "e18", "readable_votes": 9.0, "unreadable_votes": 7.0, "human_readable_vote_fraction": 0.5625, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e54", "source": "    public class KolakoskiSequence {\n        public static void main(String[] args) {\n            int[] sequence = new int[1000];\n            sequence[0] = 1;\n            sequence[1] = 2;\n            int count = 2, num = 1, index = 1;\n            while (count < 1000) {\n                for (int i = 0; i < sequence[index]; i++) {\n                    sequence[count++] = num;\n                    if (count >= 1000) {\n                        break;\n                    }\n                }\n                num = num == 1 ? 2 : 1;\n                index++;\n            }\n            for (int i = 0; i < 1000; i++) {\n                System.out.print(sequence[i] + \" \");\n            }\n        }\n    }", "human_rating": 0.4375, "metadata": {"snippet_id": "e54", "readable_votes": 7.0, "unreadable_votes": 9.0, "human_readable_vote_fraction": 0.4375, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i56", "source": "    public class LookAndSay {\n        public static void main(String[] args) {\n            String currentTerm = \"1\";\n            for (int i = 0; i < 20; i++) {\n                System.out.println(currentTerm);\n                currentTerm = getNextTerm(currentTerm);\n            }\n        }\n\n        private static String getNextTerm(String term) {\n            StringBuilder nextTerm = new StringBuilder();\n            char currentChar = term.charAt(0);\n            int count = 1;\n            for (int i = 1; i < term.length(); i++) {\n                if (term.charAt(i) == currentChar) {\n                    count++;\n                } else {\n                    nextTerm.append(count).append(currentChar);\n                    currentChar = term.charAt(i);\n                    count = 1;\n                }\n            }\n            nextTerm.append(count).append(currentChar);\n            return nextTerm.toString();\n        }\n    }", "human_rating": 0.5625, "metadata": {"snippet_id": "i56", "readable_votes": 9.0, "unreadable_votes": 7.0, "human_readable_vote_fraction": 0.5625, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b20", "source": "    public class Diamond {\n       public static void main(String[] args) {\n          for (int i = 1; i <= 9; i++) {\n             for (int j = i; j < 9; j++) {\n                System.out.print(\" \");\n             }\n             for (int j = 1; j <= i; j++) {\n                System.out.print(j);\n             }\n             for (int j = i-1; j >= 1; j--) {\n                System.out.print(j);\n             }\n             System.out.println();\n          }\n          for (int i = 8; i >= 1; i--) {\n             for (int j = 9-i; j > 0; j--) {\n                System.out.print(\" \");\n             }\n             for (int j = 1; j <= i; j++) {\n                System.out.print(j);\n             }\n             for (int j = i-1; j >= 1; j--) {\n                System.out.print(j);\n             }\n             System.out.println();\n          }\n       }\n    }", "human_rating": 0.4444444444444444, "metadata": {"snippet_id": "b20", "readable_votes": 8.0, "unreadable_votes": 10.0, "human_readable_vote_fraction": 0.4444444444444444, "neutral": false, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i38", "source": "    public class SpiralNumbers {\n      public static void main(String[] args) {\n        int n = 10;\n        int[][] grid = new int[n][n];\n        int num = 0;\n        int row = 0;\n        int col = 0;\n        int layer = 0;\n        while (num < n * n) {\n          for (int i = col; i < n-layer; i++) {\n            grid[row][i] = num++;\n          }\n          for (int i = row+1; i < n-layer; i++) {\n            grid[i][n-layer-1] = num++;\n          }\n          for (int i = n-layer-2; i >= col; i--) {\n            grid[n-layer-1][i] = num++;\n          }\n          for (int i = n-layer-2; i > row; i--) {\n            grid[i][col] = num++;\n          }\n          layer++;\n          row++;\n          col++;\n        }\n        for (int i = 0; i < n; i++) {\n          for (int j = 0; j < n; j++) {\n            System.out.printf(\"%2d \", grid[i][j]);\n          }\n          System.out.println();\n        }\n      }\n    }", "human_rating": 0.5555555555555556, "metadata": {"snippet_id": "i38", "readable_votes": 10.0, "unreadable_votes": 8.0, "human_readable_vote_fraction": 0.5555555555555556, "neutral": false, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i42", "source": "    public class HexAsciiTable {\n       public static void main(String[] args) {\n          for (int i = 0; i < 16; i++) {\n             System.out.print(Integer.toHexString(i).toUpperCase() + \": \");\n             for (int j = 0; j < 8; j++) {\n                int value = i * 8 + j;\n                if (value == 127) {\n                   System.out.print(\"DEL \");\n                } else {\n                   System.out.print((char)value + \" \");\n                }\n             }\n             System.out.println();\n          }\n       }\n    }", "human_rating": 0.45454545454545453, "metadata": {"snippet_id": "i42", "readable_votes": 5.0, "unreadable_votes": 6.0, "human_readable_vote_fraction": 0.45454545454545453, "neutral": true, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e11", "source": "    public class AbundantNumbers {\n      public static void main(String[] args) {\n        for (int i = 1; i <= 1000; i++) {\n          int sum = 0;\n          for (int j = 1; j <= i/2; j++) {\n            if (i % j == 0) {\n              sum += j;\n            }\n          }\n          if (sum > i) {\n            System.out.println(i);\n          }\n        }\n      }\n    }", "human_rating": 0.45454545454545453, "metadata": {"snippet_id": "e11", "readable_votes": 5.0, "unreadable_votes": 6.0, "human_readable_vote_fraction": 0.45454545454545453, "neutral": true, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i19", "source": "    public class ChristmasTree {\n        public static void main(String[] args) {\n            for (int i = 3; i <= 9; i += 2) {\n                int spaces = i / 2;\n                for (int j = 1; j <= i; j += 2) {\n                    // print spaces\n                    for (int k = 1; k <= spaces; k++) {\n                        System.out.print(\" \");\n                    }\n                    // print asterisks\n                    for (int k = 1; k <= j; k++) {\n                        System.out.print(\"*\");\n                    }\n                    System.out.println();\n                    spaces--;\n                }\n                // print trunk\n                int trunkSpaces = i / 2;\n                for (int j = 1; j <= 2; j++) {\n                    for (int k = 1; k <= trunkSpaces; k++) {\n                        System.out.print(\" \");\n                    }\n                    System.out.println(\"*\");\n                }\n                System.out.println();\n            }\n        }\n    }", "human_rating": 0.5454545454545454, "metadata": {"snippet_id": "i19", "readable_votes": 12.0, "unreadable_votes": 10.0, "human_readable_vote_fraction": 0.5454545454545454, "neutral": true, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e64", "source": "    public class InventorySequence {\n       public static void main(String[] args) {\n          int[] sequence = new int[1000];\n          sequence[0] = 0;\n          int currentIndex = 1;\n      \n          while (currentIndex < 1000) {\n             int zerosCount = 0;\n             for (int i = 0; i < currentIndex; i++) {\n                if (sequence[i] == 0) {\n                   zerosCount++;\n                }\n             }\n         \n             sequence[currentIndex++] = zerosCount;\n             int currentNumber = 1;\n         \n             while (currentIndex < 1000) {\n                int count = 0;\n                for (int i = 0; i < currentIndex; i++) {\n                   if (sequence[i] == currentNumber) {\n                      count++;\n                   }\n                }\n            \n                if (count == 0) {\n                   sequence[currentIndex++] = 0;\n                   break;\n                } else {\n                   sequence[currentIndex++] = count;\n                   currentNumber++;\n                }\n             }   \n          }\n      \n          for (int i = 0; i < 1000; i++) {\n             System.out.println(sequence[i]);\n          }\n       }      \n    }", "human_rating": 0.5294117647058824, "metadata": {"snippet_id": "e64", "readable_votes": 9.0, "unreadable_votes": 8.0, "human_readable_vote_fraction": 0.5294117647058824, "neutral": true, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b30", "source": "    public class BowlingScorer {\n       public static void main(String[] args) {\n          for (String game : args) {\n             int[] rolls = new int[21];\n             int rollIndex = 0;\n             for (char c : game.toCharArray()) {\n                if (c == 'X') {\n                   rolls[rollIndex++] = 10;\n                   if (rollIndex < 19 && rolls[rollIndex-2] == 10 && rolls[rollIndex-4] ==10) rolls[rollIndex-4] += 10;\n                } else if (c == '/') {\n                   rolls[rollIndex-1] = 10 - rolls[rollIndex-2];\n                } else if (c == '-') {\n                   // do nothing, this is a miss\n                } else if (c == 'F') {\n                   // do nothing, this is a foul\n                } else {\n                   rolls[rollIndex++] = c - '0';\n                }\n             }\n             int score = 0;\n             for (int frame=0; frame<10; frame++) {\n                int frameScore = rolls[frame*2] + rolls[frame*2+1];\n                // check for a spare bonus\n                if (frameScore == 10 && frame < 9) {\n                   frameScore += rolls[frame*2+2];\n                }\n                // check for a strike bonus\n                if (rolls[frame*2] == 10 && frame < 9) {\n                   frameScore += rolls[frame*2+2] + rolls[frame*2+3];\n                } else if (rolls[frame*2] == 10 && frame == 9) {\n                   frameScore += rolls[frame*2+1] + rolls[frame*2+2];\n                }\n                score += frameScore;\n             }\n             System.out.println(score);\n          }\n       }\n    }", "human_rating": 0.5263157894736842, "metadata": {"snippet_id": "b30", "readable_votes": 10.0, "unreadable_votes": 9.0, "human_readable_vote_fraction": 0.5263157894736842, "neutral": true, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b2", "source": "    public class HappyNumbers {\n\n      public static void main(String[] args) {\n        for (int i = 1; i <= 1000; i++) {\n          if (isHappy(i)) {\n            System.out.println(i);\n          }\n        }\n      }\n\n      public static boolean isHappy(int n) {\n        int sum = 0;\n        while (n != 1 && n != 4) {\n          while (n > 0) {\n            int d = n % 10;\n            sum += d * d;\n            n /= 10;\n          }\n          n = sum;\n          sum = 0;\n        }\n        return n == 1;\n      }\n    }", "human_rating": 0.5263157894736842, "metadata": {"snippet_id": "b2", "readable_votes": 10.0, "unreadable_votes": 9.0, "human_readable_vote_fraction": 0.5263157894736842, "neutral": true, "binary_readability": 1, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e20", "source": "    public class DiamondRange {\n       public static void main(String[] args) {\n          int range = 9;\n          int space = range - 1;\n          for (int i = 1; i <= range; i++) {\n             for (int j = 1; j <= space; j++) {\n                System.out.print(\" \");\n             }\n             space--;\n             for (int j = 1; j <= 2 * i - 1; j++) {\n                System.out.print(j);\n             }\n             System.out.println();\n          }\n          space = 1;\n          for (int i = 1; i <= range - 1; i++) {\n             for (int j = 1; j <= space; j++) {\n                System.out.print(\" \");\n             }\n             space++;\n             for (int j = 1; j <= 2 * (range - i) - 1; j++) {\n                System.out.print(j);\n             }\n             System.out.println();\n          }\n       }\n    }", "human_rating": 0.47619047619047616, "metadata": {"snippet_id": "e20", "readable_votes": 10.0, "unreadable_votes": 11.0, "human_readable_vote_fraction": 0.47619047619047616, "neutral": true, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/b19", "source": "    public class ChristmasTree {\n       public static void main(String[] args) {\n           for (int i = 3; i <= 9; i++) {\n               for (int j = 1; j <= i; j++) {\n                   for (int k = i; k >= j; k--) {\n                       System.out.print(\" \");\n                   }\n                   for (int l = 1; l <= j * 2 - 1; l++) {\n                       System.out.print(\"*\");\n                   }\n                   System.out.println();\n               }\n               for (int m = i; m >= 1; m--) {\n                   System.out.print(\" \");\n               }\n               System.out.println(\"*\");\n               System.out.println();\n           }\n       }\n    }", "human_rating": 0.48, "metadata": {"snippet_id": "b19", "readable_votes": 12.0, "unreadable_votes": 13.0, "human_readable_vote_fraction": 0.48, "neutral": true, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i10", "source": "    public class VampireNumbers {\n       public static void main(String[] args) {\n          for (int i = 10; i < 100; i++) {\n             for (int j = i; j < 100; j++) {\n                int product = i * j;\n                if (product > 999 && product < 10000) {\n                   int a = i / 10;\n                   int b = i % 10;\n                   int c = j / 10;\n                   int d = j % 10;\n                   int e = product / 1000;\n                   int f = (product / 100) % 10;\n                   int g = (product / 10) % 10;\n                   int h = product % 10;\n                   if (a == 0 && e == 0) continue;\n                   if ((a == e && b == f && c == g && d ==h) ||\n                           (a == f && b == e && c == h && d == g) ||\n                           (a == g && b == h && c == e && d == f) ||\n                           (a == h && b == g && c == f && d == e)) {\n                       System.out.println(product);\n                    }\n                }\n             }\n          }\n       }\n    }", "human_rating": 0.48148148148148145, "metadata": {"snippet_id": "i10", "readable_votes": 13.0, "unreadable_votes": 14.0, "human_readable_vote_fraction": 0.48148148148148145, "neutral": true, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 0, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/i59", "source": "    public class VanEckSequence {\n       public static void main(String[] args) {\n           int[] seq = new int[1000];\n           seq[0] = 0;\n           for (int i = 1; i < seq.length; i++) {\n               int last = seq[i-1];\n               int prev = -1;\n               for (int j = i-2; j >= 0; j--) {\n                   if (seq[j] == last) {\n                       prev = j;\n                       break;\n                   }\n               }\n               if (prev == -1) {\n                   seq[i] = 0;\n               } else {\n                   seq[i] = i-1-prev;\n               }\n               System.out.println(seq[i]);\n           }\n       }\n    }", "human_rating": 0.5, "metadata": {"snippet_id": "i59", "readable_votes": 10.0, "unreadable_votes": 10.0, "human_readable_vote_fraction": 0.5, "neutral": true, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 1, "scalabrino_reversed": 1, "mi": 1}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}, {"task_id": "JetBrains/e44", "source": "    import java.math.BigDecimal;\n \n    public class GoldenRatio {\n        public static void main(String[] args) {\n            BigDecimal phi = new BigDecimal(Math.sqrt(5).add(BigDecimal.ONE).divide(BigDecimal.valueOf(2)).doubleValue());\n            phi.setScale(1000, BigDecimal.ROUND_FLOOR);\n            System.out.println(phi);\n        }\n    }", "human_rating": 0.5, "metadata": {"snippet_id": "e44", "readable_votes": 9.0, "unreadable_votes": 9.0, "human_readable_vote_fraction": 0.5, "neutral": true, "binary_readability": 0, "evaluation_metric": "spearman", "existing_metrics": {"posnett": 1, "dorn_reversed": 0, "scalabrino_reversed": 0, "mi": 0}, "readability_scale": "continuous fraction of human votes marked readable; 1=unanimously readable, 0=unanimously unreadable"}}]}