Pristine Bit CheckingProgramming a Pristine WorldPriming a Pristine WorldGrowing Quine SequenceGenerate a parity bitWrite self-validating codeIs this number a factorial?Quining a Pristine WorldPristine and Unique Code BowlingFilthy and UniqueLucas and Fibonacci are in pair

Need help identifying/translating a plaque in Tangier, Morocco

Why airport relocation isn't done gradually?

How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?

Can I legally use front facing blue light in the UK?

Is this food a bread or a loaf?

Copycat chess is back

What is it called when one voice type sings a 'solo'?

Is there a name of the flying bionic bird?

Calculate Levenshtein distance between two strings in Python

Is ipsum/ipsa/ipse a third person pronoun, or can it serve other functions?

Is domain driven design an anti-SQL pattern?

Was there ever an axiom rendered a theorem?

COUNT(*) or MAX(id) - which is faster?

Information to fellow intern about hiring?

Why is my log file so massive? 22gb. I am running log backups

Why was the "bread communication" in the arena of Catching Fire left out in the movie?

Unbreakable Formation vs. Cry of the Carnarium

When blogging recipes, how can I support both readers who want the narrative/journey and ones who want the printer-friendly recipe?

"My colleague's body is amazing"

How to deal with fear of taking dependencies

Ideas for 3rd eye abilities

Patience, young "Padovan"

Is there a familial term for apples and pears?

Does the average primeness of natural numbers tend to zero?



Pristine Bit Checking


Programming a Pristine WorldPriming a Pristine WorldGrowing Quine SequenceGenerate a parity bitWrite self-validating codeIs this number a factorial?Quining a Pristine WorldPristine and Unique Code BowlingFilthy and UniqueLucas and Fibonacci are in pair













13












$begingroup$


Write a program/function that takes two integers in the range $0$ to $255$ inclusive, and returns whether the binary forms of the numbers are exactly one bit different.



For example, $1$ and $0$ have binary forms 00000001 and 00000000, which are one bit apart. Similarly, $152$ and $24$ are 010011000 and 000011000, so they return true.



However, your code must be pristine, such that if any one bit in your program is flipped, it should throw an error. For example, if your program was the single byte a (01100001), then all the 8 possible modified programs:



á ! A q i e c `


must throw an error. Make sure you are modifying by bytes (e.g. the á up there is actually representing the byte $225$, not the actual two byte character á).



Test cases:



0,1 => Truthy
1,0 => Truthy
152,24 => Truthy
10,10 => Falsey
10,11 => Truthy
11,12 => Falsey
255,0 => Falsey


Rules:



  • Provide a testing framework that can verify that your program is properly pristine, since there will be a lot of possible programs (number of bytes*8), or else a complete proof of pristineness.


    • Please make sure your program is valid before you post it.


  • Output needs to be either truthy/falsey (either way around is fine), or else two distinct non-error values

  • Errors can be runtime, compiler, interpreter etc.









share|improve this question











$endgroup$







  • 5




    $begingroup$
    If anyone's looking for a way to generate all possible variations of their solution, this Japt programme should (someone please double check) do the job: petershaggynoble.github.io/Japt-Interpreter/…
    $endgroup$
    – Shaggy
    17 hours ago






  • 3




    $begingroup$
    Here's one in Python as well: Try it online!
    $endgroup$
    – TFeld
    17 hours ago











  • $begingroup$
    Functions aren't allowed, since you mentioned program?
    $endgroup$
    – Kevin Cruijssen
    17 hours ago






  • 2




    $begingroup$
    @KevinCruijssen I've specified that function submissions are ok
    $endgroup$
    – Jo King
    17 hours ago










  • $begingroup$
    Not any character B. Only one which has a single bit changed compared to A.
    $endgroup$
    – Ven
    13 hours ago















13












$begingroup$


Write a program/function that takes two integers in the range $0$ to $255$ inclusive, and returns whether the binary forms of the numbers are exactly one bit different.



For example, $1$ and $0$ have binary forms 00000001 and 00000000, which are one bit apart. Similarly, $152$ and $24$ are 010011000 and 000011000, so they return true.



However, your code must be pristine, such that if any one bit in your program is flipped, it should throw an error. For example, if your program was the single byte a (01100001), then all the 8 possible modified programs:



á ! A q i e c `


must throw an error. Make sure you are modifying by bytes (e.g. the á up there is actually representing the byte $225$, not the actual two byte character á).



Test cases:



0,1 => Truthy
1,0 => Truthy
152,24 => Truthy
10,10 => Falsey
10,11 => Truthy
11,12 => Falsey
255,0 => Falsey


Rules:



  • Provide a testing framework that can verify that your program is properly pristine, since there will be a lot of possible programs (number of bytes*8), or else a complete proof of pristineness.


    • Please make sure your program is valid before you post it.


  • Output needs to be either truthy/falsey (either way around is fine), or else two distinct non-error values

  • Errors can be runtime, compiler, interpreter etc.









share|improve this question











$endgroup$







  • 5




    $begingroup$
    If anyone's looking for a way to generate all possible variations of their solution, this Japt programme should (someone please double check) do the job: petershaggynoble.github.io/Japt-Interpreter/…
    $endgroup$
    – Shaggy
    17 hours ago






  • 3




    $begingroup$
    Here's one in Python as well: Try it online!
    $endgroup$
    – TFeld
    17 hours ago











  • $begingroup$
    Functions aren't allowed, since you mentioned program?
    $endgroup$
    – Kevin Cruijssen
    17 hours ago






  • 2




    $begingroup$
    @KevinCruijssen I've specified that function submissions are ok
    $endgroup$
    – Jo King
    17 hours ago










  • $begingroup$
    Not any character B. Only one which has a single bit changed compared to A.
    $endgroup$
    – Ven
    13 hours ago













13












13








13


2



$begingroup$


Write a program/function that takes two integers in the range $0$ to $255$ inclusive, and returns whether the binary forms of the numbers are exactly one bit different.



For example, $1$ and $0$ have binary forms 00000001 and 00000000, which are one bit apart. Similarly, $152$ and $24$ are 010011000 and 000011000, so they return true.



However, your code must be pristine, such that if any one bit in your program is flipped, it should throw an error. For example, if your program was the single byte a (01100001), then all the 8 possible modified programs:



á ! A q i e c `


must throw an error. Make sure you are modifying by bytes (e.g. the á up there is actually representing the byte $225$, not the actual two byte character á).



Test cases:



0,1 => Truthy
1,0 => Truthy
152,24 => Truthy
10,10 => Falsey
10,11 => Truthy
11,12 => Falsey
255,0 => Falsey


Rules:



  • Provide a testing framework that can verify that your program is properly pristine, since there will be a lot of possible programs (number of bytes*8), or else a complete proof of pristineness.


    • Please make sure your program is valid before you post it.


  • Output needs to be either truthy/falsey (either way around is fine), or else two distinct non-error values

  • Errors can be runtime, compiler, interpreter etc.









share|improve this question











$endgroup$




Write a program/function that takes two integers in the range $0$ to $255$ inclusive, and returns whether the binary forms of the numbers are exactly one bit different.



For example, $1$ and $0$ have binary forms 00000001 and 00000000, which are one bit apart. Similarly, $152$ and $24$ are 010011000 and 000011000, so they return true.



However, your code must be pristine, such that if any one bit in your program is flipped, it should throw an error. For example, if your program was the single byte a (01100001), then all the 8 possible modified programs:



á ! A q i e c `


must throw an error. Make sure you are modifying by bytes (e.g. the á up there is actually representing the byte $225$, not the actual two byte character á).



Test cases:



0,1 => Truthy
1,0 => Truthy
152,24 => Truthy
10,10 => Falsey
10,11 => Truthy
11,12 => Falsey
255,0 => Falsey


Rules:



  • Provide a testing framework that can verify that your program is properly pristine, since there will be a lot of possible programs (number of bytes*8), or else a complete proof of pristineness.


    • Please make sure your program is valid before you post it.


  • Output needs to be either truthy/falsey (either way around is fine), or else two distinct non-error values

  • Errors can be runtime, compiler, interpreter etc.






code-golf decision-problem restricted-source pristine-programming






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 17 hours ago







Jo King

















asked 20 hours ago









Jo KingJo King

26.6k364131




26.6k364131







  • 5




    $begingroup$
    If anyone's looking for a way to generate all possible variations of their solution, this Japt programme should (someone please double check) do the job: petershaggynoble.github.io/Japt-Interpreter/…
    $endgroup$
    – Shaggy
    17 hours ago






  • 3




    $begingroup$
    Here's one in Python as well: Try it online!
    $endgroup$
    – TFeld
    17 hours ago











  • $begingroup$
    Functions aren't allowed, since you mentioned program?
    $endgroup$
    – Kevin Cruijssen
    17 hours ago






  • 2




    $begingroup$
    @KevinCruijssen I've specified that function submissions are ok
    $endgroup$
    – Jo King
    17 hours ago










  • $begingroup$
    Not any character B. Only one which has a single bit changed compared to A.
    $endgroup$
    – Ven
    13 hours ago












  • 5




    $begingroup$
    If anyone's looking for a way to generate all possible variations of their solution, this Japt programme should (someone please double check) do the job: petershaggynoble.github.io/Japt-Interpreter/…
    $endgroup$
    – Shaggy
    17 hours ago






  • 3




    $begingroup$
    Here's one in Python as well: Try it online!
    $endgroup$
    – TFeld
    17 hours ago











  • $begingroup$
    Functions aren't allowed, since you mentioned program?
    $endgroup$
    – Kevin Cruijssen
    17 hours ago






  • 2




    $begingroup$
    @KevinCruijssen I've specified that function submissions are ok
    $endgroup$
    – Jo King
    17 hours ago










  • $begingroup$
    Not any character B. Only one which has a single bit changed compared to A.
    $endgroup$
    – Ven
    13 hours ago







5




5




$begingroup$
If anyone's looking for a way to generate all possible variations of their solution, this Japt programme should (someone please double check) do the job: petershaggynoble.github.io/Japt-Interpreter/…
$endgroup$
– Shaggy
17 hours ago




$begingroup$
If anyone's looking for a way to generate all possible variations of their solution, this Japt programme should (someone please double check) do the job: petershaggynoble.github.io/Japt-Interpreter/…
$endgroup$
– Shaggy
17 hours ago




3




3




$begingroup$
Here's one in Python as well: Try it online!
$endgroup$
– TFeld
17 hours ago





$begingroup$
Here's one in Python as well: Try it online!
$endgroup$
– TFeld
17 hours ago













$begingroup$
Functions aren't allowed, since you mentioned program?
$endgroup$
– Kevin Cruijssen
17 hours ago




$begingroup$
Functions aren't allowed, since you mentioned program?
$endgroup$
– Kevin Cruijssen
17 hours ago




2




2




$begingroup$
@KevinCruijssen I've specified that function submissions are ok
$endgroup$
– Jo King
17 hours ago




$begingroup$
@KevinCruijssen I've specified that function submissions are ok
$endgroup$
– Jo King
17 hours ago












$begingroup$
Not any character B. Only one which has a single bit changed compared to A.
$endgroup$
– Ven
13 hours ago




$begingroup$
Not any character B. Only one which has a single bit changed compared to A.
$endgroup$
– Ven
13 hours ago










10 Answers
10






active

oldest

votes


















10












$begingroup$


Python 2, 35 bytes





lambda a,b:(a^b)&-(a^b)in[a^b or[]]


Try it online!



Uses the power-of-two check n&-n==n, eliminating the n==0 false positive.



For reference, these are the pairs of one-char binary operators that are one bit apart, making them hard to use:



+ /
- /
* +
% -
< |
< >


Fortunately, & and ^ are not among these.



Also note that == can become <=, and + can become the comment character #.





Python 2, 41 bytes





lambda a,b:bin(a^b).count(`+True`)is+True


Try it online!



Taking TFeld's lambda a,b:bin(a^b).count('1')==1 and making it pristine by changing the 1's to +True and == to is. Thanks to Jo King for 1 byte.






share|improve this answer











$endgroup$




















    7












    $begingroup$


    Python 2, 72 67 50 bytes





    lambda a,b:sum(map(int,':b'.format(a^b)))is+True


    Try it online!



    -5 bytes, thanks to Jo King




    Returns True/False for for truthy/falsey.



    The program is basically the same as lambda a,b:bin(a^b).count('1')==1, but without numbers and other chars which work when bit-flipped.



    Works by making sure that almost everything is a named function (which are all quite pristine)



    The pristine test at the end flips a single bit (for every bit), and tries the function on an input. If that works (correct or not), that variation is printed. No printed programs = pristine function.






    share|improve this answer











    $endgroup$




















      5












      $begingroup$

      Java 8, 68 61 56 bytes





      a->b->(a.bitCount(a^b)+"").equals(java.awt.Font.BOLD+"")


      Try it online.



      Explanation:



      The shortest base function would be:



      a->b->a.bitCount(a^b)==1


      Try it online.



      This is modified so there isn't a digit, =, nor one of the +/* operands in it for numeric calculations (so the + for String-concatenation is fine):



      • The java.awt.Font.BOLD is the shortest constant I could find which equals 1.

      • The +"" and .equals are to compare by String.equals(String) instead of int==int.

        NOTE: Integer.equals(int) could be used here, but would be more bytes, since both the .bitCount and java.awt.Font.BOLD are primitive int instead of Integer-objects, so an additional new Integer(...) would be required to transform one of the two to an Integer-object, before we could use the .equals.





      share|improve this answer











      $endgroup$












      • $begingroup$
        (int)Math.log(Math.E) is 21 bytes
        $endgroup$
        – Expired Data
        16 hours ago






      • 1




        $begingroup$
        59 bytes
        $endgroup$
        – Expired Data
        16 hours ago










      • $begingroup$
        @ExpiredData Thanks, actually just found a shorter constant with java.awt.Font.BOLD, but your Objects.equals is a nice golf, thanks!
        $endgroup$
        – Kevin Cruijssen
        16 hours ago










      • $begingroup$
        @ExpiredData Actually, Objects is part of the java.util. import, so I have to add that to the byte-count I'm afraid, making it 69 bytes.. :(
        $endgroup$
        – Kevin Cruijssen
        16 hours ago










      • $begingroup$
        Would -~(a^a) work for 1?
        $endgroup$
        – Embodiment of Ignorance
        8 hours ago


















      3












      $begingroup$


      C# (Visual C# Interactive Compiler), 128 101 77 70 61 74 bytes



      -27 bytes thanks to Ascii-Only



      a=>b=>var d=Math.Log(a^b,(int)Math.E);return d.Equals((int)Math.Abs(d));


      Try it online!



      You have to be quite creative to get numbers in C# without using literals. Only uses ^ operator. Variables a,b are all more than 1 bit away from each other and everything else is a keyword/name.






      share|improve this answer











      $endgroup$












      • $begingroup$
        you don't need to count bits - checking if it's a power of 2 between 1 and 128 inclusive is enough
        $endgroup$
        – ASCII-only
        15 hours ago










      • $begingroup$
        @ASCII-only Good luck checking that in a reasonable number of bytes when we can't use integers nor +/*= for mathematical or validating operations. ;)
        $endgroup$
        – Kevin Cruijssen
        15 hours ago










      • $begingroup$
        @KevinCruijssen C# has enums too :(. damnit
        $endgroup$
        – ASCII-only
        15 hours ago







      • 1




        $begingroup$
        101?
        $endgroup$
        – ASCII-only
        15 hours ago







      • 1




        $begingroup$
        O_o another -24. btw you no longer use +
        $endgroup$
        – ASCII-only
        15 hours ago



















      2












      $begingroup$


      Julia 0.7, 20 bytes





      (a,b)->ispow2(a⊻b)


      Try it online!



      Here is a pristine validator that tries running each modified anonymous function against some input, and neither passes successfully. Note that the code has a multi-byte unicode character, and some possible outputs from bit flipping are not even included, as those produce invalid UTF-8 strings.






      share|improve this answer











      $endgroup$












      • $begingroup$
        x and y are one bit apart, so I believe this is a counter example. y and x are also 1 bit off 9 and 6 respectively.
        $endgroup$
        – Expired Data
        13 hours ago











      • $begingroup$
        Damn, while thinking about complex things, I absolutely missed the simplest one. Hopefully, changing the variables will fix it.
        $endgroup$
        – Kirill L.
        13 hours ago


















      2












      $begingroup$

      JavaScript (ES6 in strict mode), 57 bytes





      y=>z=>eval(`(y^$(e='=z)*!(y&~-y)')!='=z)*!(y&~-y)'`)


      Try it online! or Make sure that all modified programs are wrong






      share|improve this answer











      $endgroup$












      • $begingroup$
        Oh my gosh I didnt realize I clicked a code golf link and saw this answer out of context and almost had a heart attack. Like, OMG NO
        $endgroup$
        – Marie
        13 hours ago






      • 2




        $begingroup$
        @Marie Caution! You can only stare at this code with certified golf glasses. Otherwise, it may burn your retina. :p
        $endgroup$
        – Arnauld
        13 hours ago


















      2












      $begingroup$


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





      a=>b=>a!=b&((a^b)&-(a^b)).Equals(a^b)


      The a=>b=> part cannot be changed, or else the function is invalid.



      In a!=b, the = cannot be changed since int cannot be converted to bool.



      Try it online!






      share|improve this answer









      $endgroup$




















        2












        $begingroup$


        C (gcc), 56 bytes





        d(a,b)return(sizeof((char)d))^__builtin_popcount(a^b);


        Try it online!



        Returns 0 if the pair differ by 1, non-zero otherwise. Slightly unusual for C, unless you consider it returning EXIT_SUCCESS if the pair differ by 1, any other value otherwise.



        Uses sizeof((char)d)) to produce the constant 1 in a pristine way while also forcing the function name to be pristine.



        It then XORs that 1 with the popcount of the XOR of the arguments. Luckily the ^ symbol is easy to keep pristine, as is the very long identifier __builtin_popcount.



        Meanwhile, here is the script used to test the solution:



        #!/bin/bash

        SOURCE_FILE=$1
        FOOT_FILE=$2
        TMP_SRC=temp.c

        LENGTH="$(wc -c <"$SOURCE_FILE")"
        BITS=$((LENGTH*8))

        cat "$SOURCE_FILE" >"$TMP_SRC"
        cat "$FOOT_FILE" >>"$TMP_SRC"
        if gcc -w $TMP_SRC -o t.out >/dev/null 2>&1; then
        if ./t.out; then
        echo "Candidate solution..."
        else
        echo "Doesn't even work normally..."
        exit
        fi
        else
        echo "Doesn't even compile..."
        exit
        fi

        for i in $(seq 1 $BITS); do
        ./flipbit "$i" <"$SOURCE_FILE" >"$TMP_SRC"
        cat "$FOOT_FILE" >>"$TMP_SRC"
        if gcc -w $TMP_SRC -o t.out >/dev/null 2>&1; then
        echo "Testing flipped bit $i:"
        cat "$TMP_SRC"

        ./t.out >/dev/null 2>&1
        STATUS=$?
        if [ "$STATUS" -eq 0 ]; then
        echo "It works!"
        exit
        elif [ "$STATUS" -eq 1 ]; then
        echo "It doesn't work..."
        exit
        else
        echo "It crashes"
        fi
        fi
        done


        Which uses the ./flipbit tool I wrote whose source is simply:



        #include <stdio.h>
        #include <stdlib.h>

        int main(int argc, char *argv[])
        int bittoflip = atoi(argv[1]) - 1;
        int ch;

        while ((ch = fgetc(stdin)) != EOF)
        if (bittoflip < 8 && bittoflip >= 0)
        putchar(ch ^ (1 << bittoflip));
        else
        putchar(ch);


        bittoflip -= 8;


        return 0;



        The tricky bits were:



        • Whitespace: All whitespace (including newlines) have pristine twins that will work similarly

        • Comparison: = doesn't work well, since it can be a comparison in every case it could appear. Similarly - doesn't work well. Thus ^ is used to assert equality with 1.

        • Variable names: f would clash with b, so had to use d as the function name instead.





        share|improve this answer









        $endgroup$












        • $begingroup$
          How do you keep the ^ operator pristine? If the bits on that were changed, what's to stop it from becoming a different operator? This would still compile, but would just give you the wrong answer. Am I misunderstanding something about the meaning of the word "pristine" here?
          $endgroup$
          – Cody Gray
          2 hours ago


















        2












        $begingroup$


        R, 83 bytes





        t(identical(sum(.<-as.double(intToBits(Reduce(bitwXor,scan())))),sum(T^el(.[-T]))))


        Try it online!



        Proof that this is pristine



        Working around the fact that as.integer, as.double etc. are only a bit away from is.integer, is.double etc. was the hardest bit. In the end, using sum(T^el(.[-T]) as a way of both generating a one and checking that as.double has returned a >1 length vector was the best I could do. The wrapping t is to handle the fact that otherwise identical can become ide~tical.






        share|improve this answer









        $endgroup$




















          1












          $begingroup$


          Groovy, 47 bytes



          a,b->a.bitCount(a^b).equals(java.awt.Font.BOLD)


          Try it online!



          Adapted version of Kevin Cruijssen's Java answer.






          share|improve this answer









          $endgroup$













            Your Answer





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

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

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

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

            else
            createEditor();

            );

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



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f182830%2fpristine-bit-checking%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            10 Answers
            10






            active

            oldest

            votes








            10 Answers
            10






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            10












            $begingroup$


            Python 2, 35 bytes





            lambda a,b:(a^b)&-(a^b)in[a^b or[]]


            Try it online!



            Uses the power-of-two check n&-n==n, eliminating the n==0 false positive.



            For reference, these are the pairs of one-char binary operators that are one bit apart, making them hard to use:



            + /
            - /
            * +
            % -
            < |
            < >


            Fortunately, & and ^ are not among these.



            Also note that == can become <=, and + can become the comment character #.





            Python 2, 41 bytes





            lambda a,b:bin(a^b).count(`+True`)is+True


            Try it online!



            Taking TFeld's lambda a,b:bin(a^b).count('1')==1 and making it pristine by changing the 1's to +True and == to is. Thanks to Jo King for 1 byte.






            share|improve this answer











            $endgroup$

















              10












              $begingroup$


              Python 2, 35 bytes





              lambda a,b:(a^b)&-(a^b)in[a^b or[]]


              Try it online!



              Uses the power-of-two check n&-n==n, eliminating the n==0 false positive.



              For reference, these are the pairs of one-char binary operators that are one bit apart, making them hard to use:



              + /
              - /
              * +
              % -
              < |
              < >


              Fortunately, & and ^ are not among these.



              Also note that == can become <=, and + can become the comment character #.





              Python 2, 41 bytes





              lambda a,b:bin(a^b).count(`+True`)is+True


              Try it online!



              Taking TFeld's lambda a,b:bin(a^b).count('1')==1 and making it pristine by changing the 1's to +True and == to is. Thanks to Jo King for 1 byte.






              share|improve this answer











              $endgroup$















                10












                10








                10





                $begingroup$


                Python 2, 35 bytes





                lambda a,b:(a^b)&-(a^b)in[a^b or[]]


                Try it online!



                Uses the power-of-two check n&-n==n, eliminating the n==0 false positive.



                For reference, these are the pairs of one-char binary operators that are one bit apart, making them hard to use:



                + /
                - /
                * +
                % -
                < |
                < >


                Fortunately, & and ^ are not among these.



                Also note that == can become <=, and + can become the comment character #.





                Python 2, 41 bytes





                lambda a,b:bin(a^b).count(`+True`)is+True


                Try it online!



                Taking TFeld's lambda a,b:bin(a^b).count('1')==1 and making it pristine by changing the 1's to +True and == to is. Thanks to Jo King for 1 byte.






                share|improve this answer











                $endgroup$




                Python 2, 35 bytes





                lambda a,b:(a^b)&-(a^b)in[a^b or[]]


                Try it online!



                Uses the power-of-two check n&-n==n, eliminating the n==0 false positive.



                For reference, these are the pairs of one-char binary operators that are one bit apart, making them hard to use:



                + /
                - /
                * +
                % -
                < |
                < >


                Fortunately, & and ^ are not among these.



                Also note that == can become <=, and + can become the comment character #.





                Python 2, 41 bytes





                lambda a,b:bin(a^b).count(`+True`)is+True


                Try it online!



                Taking TFeld's lambda a,b:bin(a^b).count('1')==1 and making it pristine by changing the 1's to +True and == to is. Thanks to Jo King for 1 byte.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 14 hours ago

























                answered 16 hours ago









                xnorxnor

                93.6k18190450




                93.6k18190450





















                    7












                    $begingroup$


                    Python 2, 72 67 50 bytes





                    lambda a,b:sum(map(int,':b'.format(a^b)))is+True


                    Try it online!



                    -5 bytes, thanks to Jo King




                    Returns True/False for for truthy/falsey.



                    The program is basically the same as lambda a,b:bin(a^b).count('1')==1, but without numbers and other chars which work when bit-flipped.



                    Works by making sure that almost everything is a named function (which are all quite pristine)



                    The pristine test at the end flips a single bit (for every bit), and tries the function on an input. If that works (correct or not), that variation is printed. No printed programs = pristine function.






                    share|improve this answer











                    $endgroup$

















                      7












                      $begingroup$


                      Python 2, 72 67 50 bytes





                      lambda a,b:sum(map(int,':b'.format(a^b)))is+True


                      Try it online!



                      -5 bytes, thanks to Jo King




                      Returns True/False for for truthy/falsey.



                      The program is basically the same as lambda a,b:bin(a^b).count('1')==1, but without numbers and other chars which work when bit-flipped.



                      Works by making sure that almost everything is a named function (which are all quite pristine)



                      The pristine test at the end flips a single bit (for every bit), and tries the function on an input. If that works (correct or not), that variation is printed. No printed programs = pristine function.






                      share|improve this answer











                      $endgroup$















                        7












                        7








                        7





                        $begingroup$


                        Python 2, 72 67 50 bytes





                        lambda a,b:sum(map(int,':b'.format(a^b)))is+True


                        Try it online!



                        -5 bytes, thanks to Jo King




                        Returns True/False for for truthy/falsey.



                        The program is basically the same as lambda a,b:bin(a^b).count('1')==1, but without numbers and other chars which work when bit-flipped.



                        Works by making sure that almost everything is a named function (which are all quite pristine)



                        The pristine test at the end flips a single bit (for every bit), and tries the function on an input. If that works (correct or not), that variation is printed. No printed programs = pristine function.






                        share|improve this answer











                        $endgroup$




                        Python 2, 72 67 50 bytes





                        lambda a,b:sum(map(int,':b'.format(a^b)))is+True


                        Try it online!



                        -5 bytes, thanks to Jo King




                        Returns True/False for for truthy/falsey.



                        The program is basically the same as lambda a,b:bin(a^b).count('1')==1, but without numbers and other chars which work when bit-flipped.



                        Works by making sure that almost everything is a named function (which are all quite pristine)



                        The pristine test at the end flips a single bit (for every bit), and tries the function on an input. If that works (correct or not), that variation is printed. No printed programs = pristine function.







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited 16 hours ago

























                        answered 18 hours ago









                        TFeldTFeld

                        16.5k21451




                        16.5k21451





















                            5












                            $begingroup$

                            Java 8, 68 61 56 bytes





                            a->b->(a.bitCount(a^b)+"").equals(java.awt.Font.BOLD+"")


                            Try it online.



                            Explanation:



                            The shortest base function would be:



                            a->b->a.bitCount(a^b)==1


                            Try it online.



                            This is modified so there isn't a digit, =, nor one of the +/* operands in it for numeric calculations (so the + for String-concatenation is fine):



                            • The java.awt.Font.BOLD is the shortest constant I could find which equals 1.

                            • The +"" and .equals are to compare by String.equals(String) instead of int==int.

                              NOTE: Integer.equals(int) could be used here, but would be more bytes, since both the .bitCount and java.awt.Font.BOLD are primitive int instead of Integer-objects, so an additional new Integer(...) would be required to transform one of the two to an Integer-object, before we could use the .equals.





                            share|improve this answer











                            $endgroup$












                            • $begingroup$
                              (int)Math.log(Math.E) is 21 bytes
                              $endgroup$
                              – Expired Data
                              16 hours ago






                            • 1




                              $begingroup$
                              59 bytes
                              $endgroup$
                              – Expired Data
                              16 hours ago










                            • $begingroup$
                              @ExpiredData Thanks, actually just found a shorter constant with java.awt.Font.BOLD, but your Objects.equals is a nice golf, thanks!
                              $endgroup$
                              – Kevin Cruijssen
                              16 hours ago










                            • $begingroup$
                              @ExpiredData Actually, Objects is part of the java.util. import, so I have to add that to the byte-count I'm afraid, making it 69 bytes.. :(
                              $endgroup$
                              – Kevin Cruijssen
                              16 hours ago










                            • $begingroup$
                              Would -~(a^a) work for 1?
                              $endgroup$
                              – Embodiment of Ignorance
                              8 hours ago















                            5












                            $begingroup$

                            Java 8, 68 61 56 bytes





                            a->b->(a.bitCount(a^b)+"").equals(java.awt.Font.BOLD+"")


                            Try it online.



                            Explanation:



                            The shortest base function would be:



                            a->b->a.bitCount(a^b)==1


                            Try it online.



                            This is modified so there isn't a digit, =, nor one of the +/* operands in it for numeric calculations (so the + for String-concatenation is fine):



                            • The java.awt.Font.BOLD is the shortest constant I could find which equals 1.

                            • The +"" and .equals are to compare by String.equals(String) instead of int==int.

                              NOTE: Integer.equals(int) could be used here, but would be more bytes, since both the .bitCount and java.awt.Font.BOLD are primitive int instead of Integer-objects, so an additional new Integer(...) would be required to transform one of the two to an Integer-object, before we could use the .equals.





                            share|improve this answer











                            $endgroup$












                            • $begingroup$
                              (int)Math.log(Math.E) is 21 bytes
                              $endgroup$
                              – Expired Data
                              16 hours ago






                            • 1




                              $begingroup$
                              59 bytes
                              $endgroup$
                              – Expired Data
                              16 hours ago










                            • $begingroup$
                              @ExpiredData Thanks, actually just found a shorter constant with java.awt.Font.BOLD, but your Objects.equals is a nice golf, thanks!
                              $endgroup$
                              – Kevin Cruijssen
                              16 hours ago










                            • $begingroup$
                              @ExpiredData Actually, Objects is part of the java.util. import, so I have to add that to the byte-count I'm afraid, making it 69 bytes.. :(
                              $endgroup$
                              – Kevin Cruijssen
                              16 hours ago










                            • $begingroup$
                              Would -~(a^a) work for 1?
                              $endgroup$
                              – Embodiment of Ignorance
                              8 hours ago













                            5












                            5








                            5





                            $begingroup$

                            Java 8, 68 61 56 bytes





                            a->b->(a.bitCount(a^b)+"").equals(java.awt.Font.BOLD+"")


                            Try it online.



                            Explanation:



                            The shortest base function would be:



                            a->b->a.bitCount(a^b)==1


                            Try it online.



                            This is modified so there isn't a digit, =, nor one of the +/* operands in it for numeric calculations (so the + for String-concatenation is fine):



                            • The java.awt.Font.BOLD is the shortest constant I could find which equals 1.

                            • The +"" and .equals are to compare by String.equals(String) instead of int==int.

                              NOTE: Integer.equals(int) could be used here, but would be more bytes, since both the .bitCount and java.awt.Font.BOLD are primitive int instead of Integer-objects, so an additional new Integer(...) would be required to transform one of the two to an Integer-object, before we could use the .equals.





                            share|improve this answer











                            $endgroup$



                            Java 8, 68 61 56 bytes





                            a->b->(a.bitCount(a^b)+"").equals(java.awt.Font.BOLD+"")


                            Try it online.



                            Explanation:



                            The shortest base function would be:



                            a->b->a.bitCount(a^b)==1


                            Try it online.



                            This is modified so there isn't a digit, =, nor one of the +/* operands in it for numeric calculations (so the + for String-concatenation is fine):



                            • The java.awt.Font.BOLD is the shortest constant I could find which equals 1.

                            • The +"" and .equals are to compare by String.equals(String) instead of int==int.

                              NOTE: Integer.equals(int) could be used here, but would be more bytes, since both the .bitCount and java.awt.Font.BOLD are primitive int instead of Integer-objects, so an additional new Integer(...) would be required to transform one of the two to an Integer-object, before we could use the .equals.






                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited 15 hours ago

























                            answered 16 hours ago









                            Kevin CruijssenKevin Cruijssen

                            42.4k570217




                            42.4k570217











                            • $begingroup$
                              (int)Math.log(Math.E) is 21 bytes
                              $endgroup$
                              – Expired Data
                              16 hours ago






                            • 1




                              $begingroup$
                              59 bytes
                              $endgroup$
                              – Expired Data
                              16 hours ago










                            • $begingroup$
                              @ExpiredData Thanks, actually just found a shorter constant with java.awt.Font.BOLD, but your Objects.equals is a nice golf, thanks!
                              $endgroup$
                              – Kevin Cruijssen
                              16 hours ago










                            • $begingroup$
                              @ExpiredData Actually, Objects is part of the java.util. import, so I have to add that to the byte-count I'm afraid, making it 69 bytes.. :(
                              $endgroup$
                              – Kevin Cruijssen
                              16 hours ago










                            • $begingroup$
                              Would -~(a^a) work for 1?
                              $endgroup$
                              – Embodiment of Ignorance
                              8 hours ago
















                            • $begingroup$
                              (int)Math.log(Math.E) is 21 bytes
                              $endgroup$
                              – Expired Data
                              16 hours ago






                            • 1




                              $begingroup$
                              59 bytes
                              $endgroup$
                              – Expired Data
                              16 hours ago










                            • $begingroup$
                              @ExpiredData Thanks, actually just found a shorter constant with java.awt.Font.BOLD, but your Objects.equals is a nice golf, thanks!
                              $endgroup$
                              – Kevin Cruijssen
                              16 hours ago










                            • $begingroup$
                              @ExpiredData Actually, Objects is part of the java.util. import, so I have to add that to the byte-count I'm afraid, making it 69 bytes.. :(
                              $endgroup$
                              – Kevin Cruijssen
                              16 hours ago










                            • $begingroup$
                              Would -~(a^a) work for 1?
                              $endgroup$
                              – Embodiment of Ignorance
                              8 hours ago















                            $begingroup$
                            (int)Math.log(Math.E) is 21 bytes
                            $endgroup$
                            – Expired Data
                            16 hours ago




                            $begingroup$
                            (int)Math.log(Math.E) is 21 bytes
                            $endgroup$
                            – Expired Data
                            16 hours ago




                            1




                            1




                            $begingroup$
                            59 bytes
                            $endgroup$
                            – Expired Data
                            16 hours ago




                            $begingroup$
                            59 bytes
                            $endgroup$
                            – Expired Data
                            16 hours ago












                            $begingroup$
                            @ExpiredData Thanks, actually just found a shorter constant with java.awt.Font.BOLD, but your Objects.equals is a nice golf, thanks!
                            $endgroup$
                            – Kevin Cruijssen
                            16 hours ago




                            $begingroup$
                            @ExpiredData Thanks, actually just found a shorter constant with java.awt.Font.BOLD, but your Objects.equals is a nice golf, thanks!
                            $endgroup$
                            – Kevin Cruijssen
                            16 hours ago












                            $begingroup$
                            @ExpiredData Actually, Objects is part of the java.util. import, so I have to add that to the byte-count I'm afraid, making it 69 bytes.. :(
                            $endgroup$
                            – Kevin Cruijssen
                            16 hours ago




                            $begingroup$
                            @ExpiredData Actually, Objects is part of the java.util. import, so I have to add that to the byte-count I'm afraid, making it 69 bytes.. :(
                            $endgroup$
                            – Kevin Cruijssen
                            16 hours ago












                            $begingroup$
                            Would -~(a^a) work for 1?
                            $endgroup$
                            – Embodiment of Ignorance
                            8 hours ago




                            $begingroup$
                            Would -~(a^a) work for 1?
                            $endgroup$
                            – Embodiment of Ignorance
                            8 hours ago











                            3












                            $begingroup$


                            C# (Visual C# Interactive Compiler), 128 101 77 70 61 74 bytes



                            -27 bytes thanks to Ascii-Only



                            a=>b=>var d=Math.Log(a^b,(int)Math.E);return d.Equals((int)Math.Abs(d));


                            Try it online!



                            You have to be quite creative to get numbers in C# without using literals. Only uses ^ operator. Variables a,b are all more than 1 bit away from each other and everything else is a keyword/name.






                            share|improve this answer











                            $endgroup$












                            • $begingroup$
                              you don't need to count bits - checking if it's a power of 2 between 1 and 128 inclusive is enough
                              $endgroup$
                              – ASCII-only
                              15 hours ago










                            • $begingroup$
                              @ASCII-only Good luck checking that in a reasonable number of bytes when we can't use integers nor +/*= for mathematical or validating operations. ;)
                              $endgroup$
                              – Kevin Cruijssen
                              15 hours ago










                            • $begingroup$
                              @KevinCruijssen C# has enums too :(. damnit
                              $endgroup$
                              – ASCII-only
                              15 hours ago







                            • 1




                              $begingroup$
                              101?
                              $endgroup$
                              – ASCII-only
                              15 hours ago







                            • 1




                              $begingroup$
                              O_o another -24. btw you no longer use +
                              $endgroup$
                              – ASCII-only
                              15 hours ago
















                            3












                            $begingroup$


                            C# (Visual C# Interactive Compiler), 128 101 77 70 61 74 bytes



                            -27 bytes thanks to Ascii-Only



                            a=>b=>var d=Math.Log(a^b,(int)Math.E);return d.Equals((int)Math.Abs(d));


                            Try it online!



                            You have to be quite creative to get numbers in C# without using literals. Only uses ^ operator. Variables a,b are all more than 1 bit away from each other and everything else is a keyword/name.






                            share|improve this answer











                            $endgroup$












                            • $begingroup$
                              you don't need to count bits - checking if it's a power of 2 between 1 and 128 inclusive is enough
                              $endgroup$
                              – ASCII-only
                              15 hours ago










                            • $begingroup$
                              @ASCII-only Good luck checking that in a reasonable number of bytes when we can't use integers nor +/*= for mathematical or validating operations. ;)
                              $endgroup$
                              – Kevin Cruijssen
                              15 hours ago










                            • $begingroup$
                              @KevinCruijssen C# has enums too :(. damnit
                              $endgroup$
                              – ASCII-only
                              15 hours ago







                            • 1




                              $begingroup$
                              101?
                              $endgroup$
                              – ASCII-only
                              15 hours ago







                            • 1




                              $begingroup$
                              O_o another -24. btw you no longer use +
                              $endgroup$
                              – ASCII-only
                              15 hours ago














                            3












                            3








                            3





                            $begingroup$


                            C# (Visual C# Interactive Compiler), 128 101 77 70 61 74 bytes



                            -27 bytes thanks to Ascii-Only



                            a=>b=>var d=Math.Log(a^b,(int)Math.E);return d.Equals((int)Math.Abs(d));


                            Try it online!



                            You have to be quite creative to get numbers in C# without using literals. Only uses ^ operator. Variables a,b are all more than 1 bit away from each other and everything else is a keyword/name.






                            share|improve this answer











                            $endgroup$




                            C# (Visual C# Interactive Compiler), 128 101 77 70 61 74 bytes



                            -27 bytes thanks to Ascii-Only



                            a=>b=>var d=Math.Log(a^b,(int)Math.E);return d.Equals((int)Math.Abs(d));


                            Try it online!



                            You have to be quite creative to get numbers in C# without using literals. Only uses ^ operator. Variables a,b are all more than 1 bit away from each other and everything else is a keyword/name.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited 11 hours ago

























                            answered 16 hours ago









                            Expired DataExpired Data

                            56314




                            56314











                            • $begingroup$
                              you don't need to count bits - checking if it's a power of 2 between 1 and 128 inclusive is enough
                              $endgroup$
                              – ASCII-only
                              15 hours ago










                            • $begingroup$
                              @ASCII-only Good luck checking that in a reasonable number of bytes when we can't use integers nor +/*= for mathematical or validating operations. ;)
                              $endgroup$
                              – Kevin Cruijssen
                              15 hours ago










                            • $begingroup$
                              @KevinCruijssen C# has enums too :(. damnit
                              $endgroup$
                              – ASCII-only
                              15 hours ago







                            • 1




                              $begingroup$
                              101?
                              $endgroup$
                              – ASCII-only
                              15 hours ago







                            • 1




                              $begingroup$
                              O_o another -24. btw you no longer use +
                              $endgroup$
                              – ASCII-only
                              15 hours ago

















                            • $begingroup$
                              you don't need to count bits - checking if it's a power of 2 between 1 and 128 inclusive is enough
                              $endgroup$
                              – ASCII-only
                              15 hours ago










                            • $begingroup$
                              @ASCII-only Good luck checking that in a reasonable number of bytes when we can't use integers nor +/*= for mathematical or validating operations. ;)
                              $endgroup$
                              – Kevin Cruijssen
                              15 hours ago










                            • $begingroup$
                              @KevinCruijssen C# has enums too :(. damnit
                              $endgroup$
                              – ASCII-only
                              15 hours ago







                            • 1




                              $begingroup$
                              101?
                              $endgroup$
                              – ASCII-only
                              15 hours ago







                            • 1




                              $begingroup$
                              O_o another -24. btw you no longer use +
                              $endgroup$
                              – ASCII-only
                              15 hours ago
















                            $begingroup$
                            you don't need to count bits - checking if it's a power of 2 between 1 and 128 inclusive is enough
                            $endgroup$
                            – ASCII-only
                            15 hours ago




                            $begingroup$
                            you don't need to count bits - checking if it's a power of 2 between 1 and 128 inclusive is enough
                            $endgroup$
                            – ASCII-only
                            15 hours ago












                            $begingroup$
                            @ASCII-only Good luck checking that in a reasonable number of bytes when we can't use integers nor +/*= for mathematical or validating operations. ;)
                            $endgroup$
                            – Kevin Cruijssen
                            15 hours ago




                            $begingroup$
                            @ASCII-only Good luck checking that in a reasonable number of bytes when we can't use integers nor +/*= for mathematical or validating operations. ;)
                            $endgroup$
                            – Kevin Cruijssen
                            15 hours ago












                            $begingroup$
                            @KevinCruijssen C# has enums too :(. damnit
                            $endgroup$
                            – ASCII-only
                            15 hours ago





                            $begingroup$
                            @KevinCruijssen C# has enums too :(. damnit
                            $endgroup$
                            – ASCII-only
                            15 hours ago





                            1




                            1




                            $begingroup$
                            101?
                            $endgroup$
                            – ASCII-only
                            15 hours ago





                            $begingroup$
                            101?
                            $endgroup$
                            – ASCII-only
                            15 hours ago





                            1




                            1




                            $begingroup$
                            O_o another -24. btw you no longer use +
                            $endgroup$
                            – ASCII-only
                            15 hours ago





                            $begingroup$
                            O_o another -24. btw you no longer use +
                            $endgroup$
                            – ASCII-only
                            15 hours ago












                            2












                            $begingroup$


                            Julia 0.7, 20 bytes





                            (a,b)->ispow2(a⊻b)


                            Try it online!



                            Here is a pristine validator that tries running each modified anonymous function against some input, and neither passes successfully. Note that the code has a multi-byte unicode character, and some possible outputs from bit flipping are not even included, as those produce invalid UTF-8 strings.






                            share|improve this answer











                            $endgroup$












                            • $begingroup$
                              x and y are one bit apart, so I believe this is a counter example. y and x are also 1 bit off 9 and 6 respectively.
                              $endgroup$
                              – Expired Data
                              13 hours ago











                            • $begingroup$
                              Damn, while thinking about complex things, I absolutely missed the simplest one. Hopefully, changing the variables will fix it.
                              $endgroup$
                              – Kirill L.
                              13 hours ago















                            2












                            $begingroup$


                            Julia 0.7, 20 bytes





                            (a,b)->ispow2(a⊻b)


                            Try it online!



                            Here is a pristine validator that tries running each modified anonymous function against some input, and neither passes successfully. Note that the code has a multi-byte unicode character, and some possible outputs from bit flipping are not even included, as those produce invalid UTF-8 strings.






                            share|improve this answer











                            $endgroup$












                            • $begingroup$
                              x and y are one bit apart, so I believe this is a counter example. y and x are also 1 bit off 9 and 6 respectively.
                              $endgroup$
                              – Expired Data
                              13 hours ago











                            • $begingroup$
                              Damn, while thinking about complex things, I absolutely missed the simplest one. Hopefully, changing the variables will fix it.
                              $endgroup$
                              – Kirill L.
                              13 hours ago













                            2












                            2








                            2





                            $begingroup$


                            Julia 0.7, 20 bytes





                            (a,b)->ispow2(a⊻b)


                            Try it online!



                            Here is a pristine validator that tries running each modified anonymous function against some input, and neither passes successfully. Note that the code has a multi-byte unicode character, and some possible outputs from bit flipping are not even included, as those produce invalid UTF-8 strings.






                            share|improve this answer











                            $endgroup$




                            Julia 0.7, 20 bytes





                            (a,b)->ispow2(a⊻b)


                            Try it online!



                            Here is a pristine validator that tries running each modified anonymous function against some input, and neither passes successfully. Note that the code has a multi-byte unicode character, and some possible outputs from bit flipping are not even included, as those produce invalid UTF-8 strings.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited 12 hours ago

























                            answered 13 hours ago









                            Kirill L.Kirill L.

                            6,0581527




                            6,0581527











                            • $begingroup$
                              x and y are one bit apart, so I believe this is a counter example. y and x are also 1 bit off 9 and 6 respectively.
                              $endgroup$
                              – Expired Data
                              13 hours ago











                            • $begingroup$
                              Damn, while thinking about complex things, I absolutely missed the simplest one. Hopefully, changing the variables will fix it.
                              $endgroup$
                              – Kirill L.
                              13 hours ago
















                            • $begingroup$
                              x and y are one bit apart, so I believe this is a counter example. y and x are also 1 bit off 9 and 6 respectively.
                              $endgroup$
                              – Expired Data
                              13 hours ago











                            • $begingroup$
                              Damn, while thinking about complex things, I absolutely missed the simplest one. Hopefully, changing the variables will fix it.
                              $endgroup$
                              – Kirill L.
                              13 hours ago















                            $begingroup$
                            x and y are one bit apart, so I believe this is a counter example. y and x are also 1 bit off 9 and 6 respectively.
                            $endgroup$
                            – Expired Data
                            13 hours ago





                            $begingroup$
                            x and y are one bit apart, so I believe this is a counter example. y and x are also 1 bit off 9 and 6 respectively.
                            $endgroup$
                            – Expired Data
                            13 hours ago













                            $begingroup$
                            Damn, while thinking about complex things, I absolutely missed the simplest one. Hopefully, changing the variables will fix it.
                            $endgroup$
                            – Kirill L.
                            13 hours ago




                            $begingroup$
                            Damn, while thinking about complex things, I absolutely missed the simplest one. Hopefully, changing the variables will fix it.
                            $endgroup$
                            – Kirill L.
                            13 hours ago











                            2












                            $begingroup$

                            JavaScript (ES6 in strict mode), 57 bytes





                            y=>z=>eval(`(y^$(e='=z)*!(y&~-y)')!='=z)*!(y&~-y)'`)


                            Try it online! or Make sure that all modified programs are wrong






                            share|improve this answer











                            $endgroup$












                            • $begingroup$
                              Oh my gosh I didnt realize I clicked a code golf link and saw this answer out of context and almost had a heart attack. Like, OMG NO
                              $endgroup$
                              – Marie
                              13 hours ago






                            • 2




                              $begingroup$
                              @Marie Caution! You can only stare at this code with certified golf glasses. Otherwise, it may burn your retina. :p
                              $endgroup$
                              – Arnauld
                              13 hours ago















                            2












                            $begingroup$

                            JavaScript (ES6 in strict mode), 57 bytes





                            y=>z=>eval(`(y^$(e='=z)*!(y&~-y)')!='=z)*!(y&~-y)'`)


                            Try it online! or Make sure that all modified programs are wrong






                            share|improve this answer











                            $endgroup$












                            • $begingroup$
                              Oh my gosh I didnt realize I clicked a code golf link and saw this answer out of context and almost had a heart attack. Like, OMG NO
                              $endgroup$
                              – Marie
                              13 hours ago






                            • 2




                              $begingroup$
                              @Marie Caution! You can only stare at this code with certified golf glasses. Otherwise, it may burn your retina. :p
                              $endgroup$
                              – Arnauld
                              13 hours ago













                            2












                            2








                            2





                            $begingroup$

                            JavaScript (ES6 in strict mode), 57 bytes





                            y=>z=>eval(`(y^$(e='=z)*!(y&~-y)')!='=z)*!(y&~-y)'`)


                            Try it online! or Make sure that all modified programs are wrong






                            share|improve this answer











                            $endgroup$



                            JavaScript (ES6 in strict mode), 57 bytes





                            y=>z=>eval(`(y^$(e='=z)*!(y&~-y)')!='=z)*!(y&~-y)'`)


                            Try it online! or Make sure that all modified programs are wrong







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited 11 hours ago

























                            answered 14 hours ago









                            ArnauldArnauld

                            80.6k797334




                            80.6k797334











                            • $begingroup$
                              Oh my gosh I didnt realize I clicked a code golf link and saw this answer out of context and almost had a heart attack. Like, OMG NO
                              $endgroup$
                              – Marie
                              13 hours ago






                            • 2




                              $begingroup$
                              @Marie Caution! You can only stare at this code with certified golf glasses. Otherwise, it may burn your retina. :p
                              $endgroup$
                              – Arnauld
                              13 hours ago
















                            • $begingroup$
                              Oh my gosh I didnt realize I clicked a code golf link and saw this answer out of context and almost had a heart attack. Like, OMG NO
                              $endgroup$
                              – Marie
                              13 hours ago






                            • 2




                              $begingroup$
                              @Marie Caution! You can only stare at this code with certified golf glasses. Otherwise, it may burn your retina. :p
                              $endgroup$
                              – Arnauld
                              13 hours ago















                            $begingroup$
                            Oh my gosh I didnt realize I clicked a code golf link and saw this answer out of context and almost had a heart attack. Like, OMG NO
                            $endgroup$
                            – Marie
                            13 hours ago




                            $begingroup$
                            Oh my gosh I didnt realize I clicked a code golf link and saw this answer out of context and almost had a heart attack. Like, OMG NO
                            $endgroup$
                            – Marie
                            13 hours ago




                            2




                            2




                            $begingroup$
                            @Marie Caution! You can only stare at this code with certified golf glasses. Otherwise, it may burn your retina. :p
                            $endgroup$
                            – Arnauld
                            13 hours ago




                            $begingroup$
                            @Marie Caution! You can only stare at this code with certified golf glasses. Otherwise, it may burn your retina. :p
                            $endgroup$
                            – Arnauld
                            13 hours ago











                            2












                            $begingroup$


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





                            a=>b=>a!=b&((a^b)&-(a^b)).Equals(a^b)


                            The a=>b=> part cannot be changed, or else the function is invalid.



                            In a!=b, the = cannot be changed since int cannot be converted to bool.



                            Try it online!






                            share|improve this answer









                            $endgroup$

















                              2












                              $begingroup$


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





                              a=>b=>a!=b&((a^b)&-(a^b)).Equals(a^b)


                              The a=>b=> part cannot be changed, or else the function is invalid.



                              In a!=b, the = cannot be changed since int cannot be converted to bool.



                              Try it online!






                              share|improve this answer









                              $endgroup$















                                2












                                2








                                2





                                $begingroup$


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





                                a=>b=>a!=b&((a^b)&-(a^b)).Equals(a^b)


                                The a=>b=> part cannot be changed, or else the function is invalid.



                                In a!=b, the = cannot be changed since int cannot be converted to bool.



                                Try it online!






                                share|improve this answer









                                $endgroup$




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





                                a=>b=>a!=b&((a^b)&-(a^b)).Equals(a^b)


                                The a=>b=> part cannot be changed, or else the function is invalid.



                                In a!=b, the = cannot be changed since int cannot be converted to bool.



                                Try it online!







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered 6 hours ago









                                Embodiment of IgnoranceEmbodiment of Ignorance

                                2,866127




                                2,866127





















                                    2












                                    $begingroup$


                                    C (gcc), 56 bytes





                                    d(a,b)return(sizeof((char)d))^__builtin_popcount(a^b);


                                    Try it online!



                                    Returns 0 if the pair differ by 1, non-zero otherwise. Slightly unusual for C, unless you consider it returning EXIT_SUCCESS if the pair differ by 1, any other value otherwise.



                                    Uses sizeof((char)d)) to produce the constant 1 in a pristine way while also forcing the function name to be pristine.



                                    It then XORs that 1 with the popcount of the XOR of the arguments. Luckily the ^ symbol is easy to keep pristine, as is the very long identifier __builtin_popcount.



                                    Meanwhile, here is the script used to test the solution:



                                    #!/bin/bash

                                    SOURCE_FILE=$1
                                    FOOT_FILE=$2
                                    TMP_SRC=temp.c

                                    LENGTH="$(wc -c <"$SOURCE_FILE")"
                                    BITS=$((LENGTH*8))

                                    cat "$SOURCE_FILE" >"$TMP_SRC"
                                    cat "$FOOT_FILE" >>"$TMP_SRC"
                                    if gcc -w $TMP_SRC -o t.out >/dev/null 2>&1; then
                                    if ./t.out; then
                                    echo "Candidate solution..."
                                    else
                                    echo "Doesn't even work normally..."
                                    exit
                                    fi
                                    else
                                    echo "Doesn't even compile..."
                                    exit
                                    fi

                                    for i in $(seq 1 $BITS); do
                                    ./flipbit "$i" <"$SOURCE_FILE" >"$TMP_SRC"
                                    cat "$FOOT_FILE" >>"$TMP_SRC"
                                    if gcc -w $TMP_SRC -o t.out >/dev/null 2>&1; then
                                    echo "Testing flipped bit $i:"
                                    cat "$TMP_SRC"

                                    ./t.out >/dev/null 2>&1
                                    STATUS=$?
                                    if [ "$STATUS" -eq 0 ]; then
                                    echo "It works!"
                                    exit
                                    elif [ "$STATUS" -eq 1 ]; then
                                    echo "It doesn't work..."
                                    exit
                                    else
                                    echo "It crashes"
                                    fi
                                    fi
                                    done


                                    Which uses the ./flipbit tool I wrote whose source is simply:



                                    #include <stdio.h>
                                    #include <stdlib.h>

                                    int main(int argc, char *argv[])
                                    int bittoflip = atoi(argv[1]) - 1;
                                    int ch;

                                    while ((ch = fgetc(stdin)) != EOF)
                                    if (bittoflip < 8 && bittoflip >= 0)
                                    putchar(ch ^ (1 << bittoflip));
                                    else
                                    putchar(ch);


                                    bittoflip -= 8;


                                    return 0;



                                    The tricky bits were:



                                    • Whitespace: All whitespace (including newlines) have pristine twins that will work similarly

                                    • Comparison: = doesn't work well, since it can be a comparison in every case it could appear. Similarly - doesn't work well. Thus ^ is used to assert equality with 1.

                                    • Variable names: f would clash with b, so had to use d as the function name instead.





                                    share|improve this answer









                                    $endgroup$












                                    • $begingroup$
                                      How do you keep the ^ operator pristine? If the bits on that were changed, what's to stop it from becoming a different operator? This would still compile, but would just give you the wrong answer. Am I misunderstanding something about the meaning of the word "pristine" here?
                                      $endgroup$
                                      – Cody Gray
                                      2 hours ago















                                    2












                                    $begingroup$


                                    C (gcc), 56 bytes





                                    d(a,b)return(sizeof((char)d))^__builtin_popcount(a^b);


                                    Try it online!



                                    Returns 0 if the pair differ by 1, non-zero otherwise. Slightly unusual for C, unless you consider it returning EXIT_SUCCESS if the pair differ by 1, any other value otherwise.



                                    Uses sizeof((char)d)) to produce the constant 1 in a pristine way while also forcing the function name to be pristine.



                                    It then XORs that 1 with the popcount of the XOR of the arguments. Luckily the ^ symbol is easy to keep pristine, as is the very long identifier __builtin_popcount.



                                    Meanwhile, here is the script used to test the solution:



                                    #!/bin/bash

                                    SOURCE_FILE=$1
                                    FOOT_FILE=$2
                                    TMP_SRC=temp.c

                                    LENGTH="$(wc -c <"$SOURCE_FILE")"
                                    BITS=$((LENGTH*8))

                                    cat "$SOURCE_FILE" >"$TMP_SRC"
                                    cat "$FOOT_FILE" >>"$TMP_SRC"
                                    if gcc -w $TMP_SRC -o t.out >/dev/null 2>&1; then
                                    if ./t.out; then
                                    echo "Candidate solution..."
                                    else
                                    echo "Doesn't even work normally..."
                                    exit
                                    fi
                                    else
                                    echo "Doesn't even compile..."
                                    exit
                                    fi

                                    for i in $(seq 1 $BITS); do
                                    ./flipbit "$i" <"$SOURCE_FILE" >"$TMP_SRC"
                                    cat "$FOOT_FILE" >>"$TMP_SRC"
                                    if gcc -w $TMP_SRC -o t.out >/dev/null 2>&1; then
                                    echo "Testing flipped bit $i:"
                                    cat "$TMP_SRC"

                                    ./t.out >/dev/null 2>&1
                                    STATUS=$?
                                    if [ "$STATUS" -eq 0 ]; then
                                    echo "It works!"
                                    exit
                                    elif [ "$STATUS" -eq 1 ]; then
                                    echo "It doesn't work..."
                                    exit
                                    else
                                    echo "It crashes"
                                    fi
                                    fi
                                    done


                                    Which uses the ./flipbit tool I wrote whose source is simply:



                                    #include <stdio.h>
                                    #include <stdlib.h>

                                    int main(int argc, char *argv[])
                                    int bittoflip = atoi(argv[1]) - 1;
                                    int ch;

                                    while ((ch = fgetc(stdin)) != EOF)
                                    if (bittoflip < 8 && bittoflip >= 0)
                                    putchar(ch ^ (1 << bittoflip));
                                    else
                                    putchar(ch);


                                    bittoflip -= 8;


                                    return 0;



                                    The tricky bits were:



                                    • Whitespace: All whitespace (including newlines) have pristine twins that will work similarly

                                    • Comparison: = doesn't work well, since it can be a comparison in every case it could appear. Similarly - doesn't work well. Thus ^ is used to assert equality with 1.

                                    • Variable names: f would clash with b, so had to use d as the function name instead.





                                    share|improve this answer









                                    $endgroup$












                                    • $begingroup$
                                      How do you keep the ^ operator pristine? If the bits on that were changed, what's to stop it from becoming a different operator? This would still compile, but would just give you the wrong answer. Am I misunderstanding something about the meaning of the word "pristine" here?
                                      $endgroup$
                                      – Cody Gray
                                      2 hours ago













                                    2












                                    2








                                    2





                                    $begingroup$


                                    C (gcc), 56 bytes





                                    d(a,b)return(sizeof((char)d))^__builtin_popcount(a^b);


                                    Try it online!



                                    Returns 0 if the pair differ by 1, non-zero otherwise. Slightly unusual for C, unless you consider it returning EXIT_SUCCESS if the pair differ by 1, any other value otherwise.



                                    Uses sizeof((char)d)) to produce the constant 1 in a pristine way while also forcing the function name to be pristine.



                                    It then XORs that 1 with the popcount of the XOR of the arguments. Luckily the ^ symbol is easy to keep pristine, as is the very long identifier __builtin_popcount.



                                    Meanwhile, here is the script used to test the solution:



                                    #!/bin/bash

                                    SOURCE_FILE=$1
                                    FOOT_FILE=$2
                                    TMP_SRC=temp.c

                                    LENGTH="$(wc -c <"$SOURCE_FILE")"
                                    BITS=$((LENGTH*8))

                                    cat "$SOURCE_FILE" >"$TMP_SRC"
                                    cat "$FOOT_FILE" >>"$TMP_SRC"
                                    if gcc -w $TMP_SRC -o t.out >/dev/null 2>&1; then
                                    if ./t.out; then
                                    echo "Candidate solution..."
                                    else
                                    echo "Doesn't even work normally..."
                                    exit
                                    fi
                                    else
                                    echo "Doesn't even compile..."
                                    exit
                                    fi

                                    for i in $(seq 1 $BITS); do
                                    ./flipbit "$i" <"$SOURCE_FILE" >"$TMP_SRC"
                                    cat "$FOOT_FILE" >>"$TMP_SRC"
                                    if gcc -w $TMP_SRC -o t.out >/dev/null 2>&1; then
                                    echo "Testing flipped bit $i:"
                                    cat "$TMP_SRC"

                                    ./t.out >/dev/null 2>&1
                                    STATUS=$?
                                    if [ "$STATUS" -eq 0 ]; then
                                    echo "It works!"
                                    exit
                                    elif [ "$STATUS" -eq 1 ]; then
                                    echo "It doesn't work..."
                                    exit
                                    else
                                    echo "It crashes"
                                    fi
                                    fi
                                    done


                                    Which uses the ./flipbit tool I wrote whose source is simply:



                                    #include <stdio.h>
                                    #include <stdlib.h>

                                    int main(int argc, char *argv[])
                                    int bittoflip = atoi(argv[1]) - 1;
                                    int ch;

                                    while ((ch = fgetc(stdin)) != EOF)
                                    if (bittoflip < 8 && bittoflip >= 0)
                                    putchar(ch ^ (1 << bittoflip));
                                    else
                                    putchar(ch);


                                    bittoflip -= 8;


                                    return 0;



                                    The tricky bits were:



                                    • Whitespace: All whitespace (including newlines) have pristine twins that will work similarly

                                    • Comparison: = doesn't work well, since it can be a comparison in every case it could appear. Similarly - doesn't work well. Thus ^ is used to assert equality with 1.

                                    • Variable names: f would clash with b, so had to use d as the function name instead.





                                    share|improve this answer









                                    $endgroup$




                                    C (gcc), 56 bytes





                                    d(a,b)return(sizeof((char)d))^__builtin_popcount(a^b);


                                    Try it online!



                                    Returns 0 if the pair differ by 1, non-zero otherwise. Slightly unusual for C, unless you consider it returning EXIT_SUCCESS if the pair differ by 1, any other value otherwise.



                                    Uses sizeof((char)d)) to produce the constant 1 in a pristine way while also forcing the function name to be pristine.



                                    It then XORs that 1 with the popcount of the XOR of the arguments. Luckily the ^ symbol is easy to keep pristine, as is the very long identifier __builtin_popcount.



                                    Meanwhile, here is the script used to test the solution:



                                    #!/bin/bash

                                    SOURCE_FILE=$1
                                    FOOT_FILE=$2
                                    TMP_SRC=temp.c

                                    LENGTH="$(wc -c <"$SOURCE_FILE")"
                                    BITS=$((LENGTH*8))

                                    cat "$SOURCE_FILE" >"$TMP_SRC"
                                    cat "$FOOT_FILE" >>"$TMP_SRC"
                                    if gcc -w $TMP_SRC -o t.out >/dev/null 2>&1; then
                                    if ./t.out; then
                                    echo "Candidate solution..."
                                    else
                                    echo "Doesn't even work normally..."
                                    exit
                                    fi
                                    else
                                    echo "Doesn't even compile..."
                                    exit
                                    fi

                                    for i in $(seq 1 $BITS); do
                                    ./flipbit "$i" <"$SOURCE_FILE" >"$TMP_SRC"
                                    cat "$FOOT_FILE" >>"$TMP_SRC"
                                    if gcc -w $TMP_SRC -o t.out >/dev/null 2>&1; then
                                    echo "Testing flipped bit $i:"
                                    cat "$TMP_SRC"

                                    ./t.out >/dev/null 2>&1
                                    STATUS=$?
                                    if [ "$STATUS" -eq 0 ]; then
                                    echo "It works!"
                                    exit
                                    elif [ "$STATUS" -eq 1 ]; then
                                    echo "It doesn't work..."
                                    exit
                                    else
                                    echo "It crashes"
                                    fi
                                    fi
                                    done


                                    Which uses the ./flipbit tool I wrote whose source is simply:



                                    #include <stdio.h>
                                    #include <stdlib.h>

                                    int main(int argc, char *argv[])
                                    int bittoflip = atoi(argv[1]) - 1;
                                    int ch;

                                    while ((ch = fgetc(stdin)) != EOF)
                                    if (bittoflip < 8 && bittoflip >= 0)
                                    putchar(ch ^ (1 << bittoflip));
                                    else
                                    putchar(ch);


                                    bittoflip -= 8;


                                    return 0;



                                    The tricky bits were:



                                    • Whitespace: All whitespace (including newlines) have pristine twins that will work similarly

                                    • Comparison: = doesn't work well, since it can be a comparison in every case it could appear. Similarly - doesn't work well. Thus ^ is used to assert equality with 1.

                                    • Variable names: f would clash with b, so had to use d as the function name instead.






                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered 5 hours ago









                                    LambdaBetaLambdaBeta

                                    2,169418




                                    2,169418











                                    • $begingroup$
                                      How do you keep the ^ operator pristine? If the bits on that were changed, what's to stop it from becoming a different operator? This would still compile, but would just give you the wrong answer. Am I misunderstanding something about the meaning of the word "pristine" here?
                                      $endgroup$
                                      – Cody Gray
                                      2 hours ago
















                                    • $begingroup$
                                      How do you keep the ^ operator pristine? If the bits on that were changed, what's to stop it from becoming a different operator? This would still compile, but would just give you the wrong answer. Am I misunderstanding something about the meaning of the word "pristine" here?
                                      $endgroup$
                                      – Cody Gray
                                      2 hours ago















                                    $begingroup$
                                    How do you keep the ^ operator pristine? If the bits on that were changed, what's to stop it from becoming a different operator? This would still compile, but would just give you the wrong answer. Am I misunderstanding something about the meaning of the word "pristine" here?
                                    $endgroup$
                                    – Cody Gray
                                    2 hours ago




                                    $begingroup$
                                    How do you keep the ^ operator pristine? If the bits on that were changed, what's to stop it from becoming a different operator? This would still compile, but would just give you the wrong answer. Am I misunderstanding something about the meaning of the word "pristine" here?
                                    $endgroup$
                                    – Cody Gray
                                    2 hours ago











                                    2












                                    $begingroup$


                                    R, 83 bytes





                                    t(identical(sum(.<-as.double(intToBits(Reduce(bitwXor,scan())))),sum(T^el(.[-T]))))


                                    Try it online!



                                    Proof that this is pristine



                                    Working around the fact that as.integer, as.double etc. are only a bit away from is.integer, is.double etc. was the hardest bit. In the end, using sum(T^el(.[-T]) as a way of both generating a one and checking that as.double has returned a >1 length vector was the best I could do. The wrapping t is to handle the fact that otherwise identical can become ide~tical.






                                    share|improve this answer









                                    $endgroup$

















                                      2












                                      $begingroup$


                                      R, 83 bytes





                                      t(identical(sum(.<-as.double(intToBits(Reduce(bitwXor,scan())))),sum(T^el(.[-T]))))


                                      Try it online!



                                      Proof that this is pristine



                                      Working around the fact that as.integer, as.double etc. are only a bit away from is.integer, is.double etc. was the hardest bit. In the end, using sum(T^el(.[-T]) as a way of both generating a one and checking that as.double has returned a >1 length vector was the best I could do. The wrapping t is to handle the fact that otherwise identical can become ide~tical.






                                      share|improve this answer









                                      $endgroup$















                                        2












                                        2








                                        2





                                        $begingroup$


                                        R, 83 bytes





                                        t(identical(sum(.<-as.double(intToBits(Reduce(bitwXor,scan())))),sum(T^el(.[-T]))))


                                        Try it online!



                                        Proof that this is pristine



                                        Working around the fact that as.integer, as.double etc. are only a bit away from is.integer, is.double etc. was the hardest bit. In the end, using sum(T^el(.[-T]) as a way of both generating a one and checking that as.double has returned a >1 length vector was the best I could do. The wrapping t is to handle the fact that otherwise identical can become ide~tical.






                                        share|improve this answer









                                        $endgroup$




                                        R, 83 bytes





                                        t(identical(sum(.<-as.double(intToBits(Reduce(bitwXor,scan())))),sum(T^el(.[-T]))))


                                        Try it online!



                                        Proof that this is pristine



                                        Working around the fact that as.integer, as.double etc. are only a bit away from is.integer, is.double etc. was the hardest bit. In the end, using sum(T^el(.[-T]) as a way of both generating a one and checking that as.double has returned a >1 length vector was the best I could do. The wrapping t is to handle the fact that otherwise identical can become ide~tical.







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered 5 hours ago









                                        Nick KennedyNick Kennedy

                                        1,36649




                                        1,36649





















                                            1












                                            $begingroup$


                                            Groovy, 47 bytes



                                            a,b->a.bitCount(a^b).equals(java.awt.Font.BOLD)


                                            Try it online!



                                            Adapted version of Kevin Cruijssen's Java answer.






                                            share|improve this answer









                                            $endgroup$

















                                              1












                                              $begingroup$


                                              Groovy, 47 bytes



                                              a,b->a.bitCount(a^b).equals(java.awt.Font.BOLD)


                                              Try it online!



                                              Adapted version of Kevin Cruijssen's Java answer.






                                              share|improve this answer









                                              $endgroup$















                                                1












                                                1








                                                1





                                                $begingroup$


                                                Groovy, 47 bytes



                                                a,b->a.bitCount(a^b).equals(java.awt.Font.BOLD)


                                                Try it online!



                                                Adapted version of Kevin Cruijssen's Java answer.






                                                share|improve this answer









                                                $endgroup$




                                                Groovy, 47 bytes



                                                a,b->a.bitCount(a^b).equals(java.awt.Font.BOLD)


                                                Try it online!



                                                Adapted version of Kevin Cruijssen's Java answer.







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered 11 hours ago









                                                Expired DataExpired Data

                                                56314




                                                56314



























                                                    draft saved

                                                    draft discarded
















































                                                    If this is an answer to a challenge…



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


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


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


                                                    More generally…



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


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




                                                    draft saved


                                                    draft discarded














                                                    StackExchange.ready(
                                                    function ()
                                                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f182830%2fpristine-bit-checking%23new-answer', 'question_page');

                                                    );

                                                    Post as a guest















                                                    Required, but never shown





















































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown

































                                                    Required, but never shown














                                                    Required, but never shown












                                                    Required, but never shown







                                                    Required, but never shown







                                                    Popular posts from this blog

                                                    Францішак Багушэвіч Змест Сям'я | Біяграфія | Творчасць | Мова Багушэвіча | Ацэнкі дзейнасці | Цікавыя факты | Спадчына | Выбраная бібліяграфія | Ушанаванне памяці | У філатэліі | Зноскі | Літаратура | Спасылкі | НавігацыяЛяхоўскі У. Рупіўся дзеля Бога і людзей: Жыццёвы шлях Лявона Вітан-Дубейкаўскага // Вольскі і Памідораў з песняй пра немца Адвакат, паэт, народны заступнік Ашмянскі веснікВ Минске появится площадь Богушевича и улица Сырокомли, Белорусская деловая газета, 19 июля 2001 г.Айцец беларускай нацыянальнай ідэі паўстаў у бронзе Сяргей Аляксандравіч Адашкевіч (1918, Мінск). 80-я гады. Бюст «Францішак Багушэвіч».Яўген Мікалаевіч Ціхановіч. «Партрэт Францішка Багушэвіча»Мікола Мікалаевіч Купава. «Партрэт зачынальніка новай беларускай літаратуры Францішка Багушэвіча»Уладзімір Іванавіч Мелехаў. На помніку «Змагарам за родную мову» Барэльеф «Францішак Багушэвіч»Памяць пра Багушэвіча на Віленшчыне Страчаная сталіца. Беларускія шыльды на вуліцах Вільні«Krynica». Ideologia i przywódcy białoruskiego katolicyzmuФранцішак БагушэвічТворы на knihi.comТворы Францішка Багушэвіча на bellib.byСодаль Уладзімір. Францішак Багушэвіч на Лідчыне;Луцкевіч Антон. Жыцьцё і творчасьць Фр. Багушэвіча ў успамінах ягоных сучасьнікаў // Запісы Беларускага Навуковага таварыства. Вільня, 1938. Сшытак 1. С. 16-34.Большая российская1188761710000 0000 5537 633Xn9209310021619551927869394п

                                                    Беларусь Змест Назва Гісторыя Геаграфія Сімволіка Дзяржаўны лад Палітычныя партыі Міжнароднае становішча і знешняя палітыка Адміністрацыйны падзел Насельніцтва Эканоміка Культура і грамадства Сацыяльная сфера Узброеныя сілы Заўвагі Літаратура Спасылкі НавігацыяHGЯOiТоп-2011 г. (па версіі ej.by)Топ-2013 г. (па версіі ej.by)Топ-2016 г. (па версіі ej.by)Топ-2017 г. (па версіі ej.by)Нацыянальны статыстычны камітэт Рэспублікі БеларусьШчыльнасць насельніцтва па краінахhttp://naviny.by/rubrics/society/2011/09/16/ic_articles_116_175144/А. Калечыц, У. Ксяндзоў. Спробы засялення краю неандэртальскім чалавекам.І ў Менску былі мамантыА. Калечыц, У. Ксяндзоў. Старажытны каменны век (палеаліт). Першапачатковае засяленне тэрыторыіГ. Штыхаў. Балты і славяне ў VI—VIII стст.М. Клімаў. Полацкае княства ў IX—XI стст.Г. Штыхаў, В. Ляўко. Палітычная гісторыя Полацкай зямліГ. Штыхаў. Дзяржаўны лад у землях-княствахГ. Штыхаў. Дзяржаўны лад у землях-княствахБеларускія землі ў складзе Вялікага Княства ЛітоўскагаЛюблінская унія 1569 г."The Early Stages of Independence"Zapomniane prawdy25 гадоў таму было аб'яўлена, што Язэп Пілсудскі — беларус (фота)Наша вадаДакументы ЧАЭС: Забруджванне тэрыторыі Беларусі « ЧАЭС Зона адчужэнняСведения о политических партиях, зарегистрированных в Республике Беларусь // Министерство юстиции Республики БеларусьСтатыстычны бюлетэнь „Полаўзроставая структура насельніцтва Рэспублікі Беларусь на 1 студзеня 2012 года і сярэднегадовая колькасць насельніцтва за 2011 год“Индекс человеческого развития Беларуси — не было бы нижеБеларусь занимает первое место в СНГ по индексу развития с учетом гендерного факцёраНацыянальны статыстычны камітэт Рэспублікі БеларусьКанстытуцыя РБ. Артыкул 17Трансфармацыйныя задачы БеларусіВыйсце з крызісу — далейшае рэфармаванне Беларускі рубель — сусветны лідар па дэвальвацыяхПра змену коштаў у кастрычніку 2011 г.Бядней за беларусаў у СНД толькі таджыкіСярэдні заробак у верасні дасягнуў 2,26 мільёна рублёўЭканомікаГаласуем за ТОП-100 беларускай прозыСучасныя беларускія мастакіАрхитектура Беларуси BELARUS.BYА. Каханоўскі. Культура Беларусі ўсярэдзіне XVII—XVIII ст.Анталогія беларускай народнай песні, гуказапісы спеваўБеларускія Музычныя IнструментыБеларускі рок, які мы страцілі. Топ-10 гуртоў«Мясцовы час» — нязгаслая легенда беларускай рок-музыкіСЯРГЕЙ БУДКІН. МЫ НЯ ЗНАЕМ СВАЁЙ МУЗЫКІМ. А. Каладзінскі. НАРОДНЫ ТЭАТРМагнацкія культурныя цэнтрыПублічная дыскусія «Беларуская новая пьеса: без беларускай мовы ці беларуская?»Беларускія драматургі па-ранейшаму лепш ставяцца за мяжой, чым на радзіме«Працэс незалежнага кіно пайшоў, і дзяржаву турбуе яго непадкантрольнасць»Беларускія філосафы ў пошуках прасторыВсе идём в библиотекуАрхіваванаАб Нацыянальнай праграме даследавання і выкарыстання касмічнай прасторы ў мірных мэтах на 2008—2012 гадыУ космас — разам.У суседнім з Барысаўскім раёне пабудуюць Камандна-вымяральны пунктСвяты і абрады беларусаў«Мірныя бульбашы з малой краіны» — 5 непраўдзівых стэрэатыпаў пра БеларусьМ. Раманюк. Беларускае народнае адзеннеУ Беларусі скарачаецца колькасць злачынстваўЛукашэнка незадаволены мінскімі ўладамі Крадзяжы складаюць у Мінску каля 70% злачынстваў Узровень злачыннасці ў Мінскай вобласці — адзін з самых высокіх у краіне Генпракуратура аналізуе стан са злачыннасцю ў Беларусі па каэфіцыенце злачыннасці У Беларусі стабілізавалася крымінагеннае становішча, лічыць генпракурорЗамежнікі сталі здзяйсняць у Беларусі больш злачынстваўМУС Беларусі турбуе рост рэцыдыўнай злачыннасціЯ з ЖЭСа. Дазволіце вас абкрасці! Рэйтынг усіх службаў і падраздзяленняў ГУУС Мінгарвыканкама вырасАб КДБ РБГісторыя Аператыўна-аналітычнага цэнтра РБГісторыя ДКФРТаможняagentura.ruБеларусьBelarus.by — Афіцыйны сайт Рэспублікі БеларусьСайт урада БеларусіRadzima.org — Збор архітэктурных помнікаў, гісторыя Беларусі«Глобус Беларуси»Гербы и флаги БеларусиАсаблівасці каменнага веку на БеларусіА. Калечыц, У. Ксяндзоў. Старажытны каменны век (палеаліт). Першапачатковае засяленне тэрыторыіУ. Ксяндзоў. Сярэдні каменны век (мезаліт). Засяленне краю плямёнамі паляўнічых, рыбакоў і збіральнікаўА. Калечыц, М. Чарняўскі. Плямёны на тэрыторыі Беларусі ў новым каменным веку (неаліце)А. Калечыц, У. Ксяндзоў, М. Чарняўскі. Гаспадарчыя заняткі ў каменным векуЭ. Зайкоўскі. Духоўная культура ў каменным векуАсаблівасці бронзавага веку на БеларусіФарміраванне супольнасцей ранняга перыяду бронзавага векуФотографии БеларусиРоля беларускіх зямель ва ўтварэнні і ўмацаванні ВКЛВ. Фадзеева. З гісторыі развіцця беларускай народнай вышыўкіDMOZGran catalanaБольшая российскаяBritannica (анлайн)Швейцарскі гістарычны15325917611952699xDA123282154079143-90000 0001 2171 2080n9112870100577502ge128882171858027501086026362074122714179пппппп

                                                    ValueError: Expected n_neighbors <= n_samples, but n_samples = 1, n_neighbors = 6 (SMOTE) The 2019 Stack Overflow Developer Survey Results Are InCan SMOTE be applied over sequence of words (sentences)?ValueError when doing validation with random forestsSMOTE and multi class oversamplingLogic behind SMOTE-NC?ValueError: Error when checking target: expected dense_1 to have shape (7,) but got array with shape (1,)SmoteBoost: Should SMOTE be ran individually for each iteration/tree in the boosting?solving multi-class imbalance classification using smote and OSSUsing SMOTE for Synthetic Data generation to improve performance on unbalanced dataproblem of entry format for a simple model in KerasSVM SMOTE fit_resample() function runs forever with no result