I reverse the source code, you negate the input!I double the source, you double the output!I reverse the source code, you negate the output!Character counts in source codeSource Code MetamorphosisQuine / Reverse QuineDouble-duty quine: quine!dlroW ,olleHInput ∩ Source CodeSource code GO!I double the source, you double the output!Third time the charmQuine outputs itself in binaryI reverse the source code, you negate the output!

Audire, with accusative or dative?

Should the pagination be reset when changing the order?

The relationship of noch nicht and the passive voice

What are sources for Magic Items that are not adventure-specific?

What was the deeper meaning of Hermione wanting the cloak?

All numbers in a 5x5 Minesweeper grid

How often is duct tape used during crewed space missions?

Is there any actual security benefit to restricting foreign IPs?

Why would a fighter use the afterburner and air brakes at the same time?

I feel like most of my characters are the same, what can I do?

Delete empty subfolders, keep parent folder

What are the end bytes of *.docx file format

Can I separate garlic into cloves for storage?

Applications of mathematics in clinical setting

Lead Amalgam as a Material for a Sword

Removing rows containing NA in every column

Why is the stock market so unpredictable?

Find all files in directories named foo

Microservices and Stored Procedures

What is the word for a person who destroys monuments?

Should I inform my future product owner that there is a good chance that a team member will leave the company soon?

How to influence manager to not schedule team meetings during lunch?

What do solvers like Gurobi and CPLEX do when they run into hard instances of MIP

How does one calculate the distribution of the Matt Colville way of rolling stats?



I reverse the source code, you negate the input!


I double the source, you double the output!I reverse the source code, you negate the output!Character counts in source codeSource Code MetamorphosisQuine / Reverse QuineDouble-duty quine: quine!dlroW ,olleHInput ∩ Source CodeSource code GO!I double the source, you double the output!Third time the charmQuine outputs itself in binaryI reverse the source code, you negate the output!






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








8












$begingroup$


Blatant rip-off of a rip-off. Go upvote those!



Your task, if you wish to accept it, is to write a program/function that outputs/returns its integer input/argument. The tricky part is that if I reverse your source code, the output must be the original integer negated.



Examples



Let's say your source code is ABC and its input is 4. If I write CBA instead and run it, the output must be -4.



Let's say your source code is ABC and its input is -2. If I write CBA instead and run it, the output must be 2.



An input of 0 may give 0 or -0, however, if you do support signed zero, -0 should give 0.










share|improve this question









$endgroup$




















    8












    $begingroup$


    Blatant rip-off of a rip-off. Go upvote those!



    Your task, if you wish to accept it, is to write a program/function that outputs/returns its integer input/argument. The tricky part is that if I reverse your source code, the output must be the original integer negated.



    Examples



    Let's say your source code is ABC and its input is 4. If I write CBA instead and run it, the output must be -4.



    Let's say your source code is ABC and its input is -2. If I write CBA instead and run it, the output must be 2.



    An input of 0 may give 0 or -0, however, if you do support signed zero, -0 should give 0.










    share|improve this question









    $endgroup$
















      8












      8








      8


      0



      $begingroup$


      Blatant rip-off of a rip-off. Go upvote those!



      Your task, if you wish to accept it, is to write a program/function that outputs/returns its integer input/argument. The tricky part is that if I reverse your source code, the output must be the original integer negated.



      Examples



      Let's say your source code is ABC and its input is 4. If I write CBA instead and run it, the output must be -4.



      Let's say your source code is ABC and its input is -2. If I write CBA instead and run it, the output must be 2.



      An input of 0 may give 0 or -0, however, if you do support signed zero, -0 should give 0.










      share|improve this question









      $endgroup$




      Blatant rip-off of a rip-off. Go upvote those!



      Your task, if you wish to accept it, is to write a program/function that outputs/returns its integer input/argument. The tricky part is that if I reverse your source code, the output must be the original integer negated.



      Examples



      Let's say your source code is ABC and its input is 4. If I write CBA instead and run it, the output must be -4.



      Let's say your source code is ABC and its input is -2. If I write CBA instead and run it, the output must be 2.



      An input of 0 may give 0 or -0, however, if you do support signed zero, -0 should give 0.







      code-golf math number source-layout






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 8 hours ago









      AdámAdám

      29.8k2 gold badges82 silver badges214 bronze badges




      29.8k2 gold badges82 silver badges214 bronze badges























          20 Answers
          20






          active

          oldest

          votes


















          2














          $begingroup$


          Brain-Flak, 7 bytes



          #)]}improve this answer









          $endgroup$



















            2














            $begingroup$


            Brain-Flak, 7 bytes



            #)][(


            Try it online!



            Reversed:



            ([])#


            Try it online!






            shareimprove this answer









            $endgroup$




            Brain-Flak, 7 bytes



            #)]{[(


            Try it online!



            Reversed:



            ([])#


            Try it online!







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 5 hours ago









            RileyRiley

            11.2k1 gold badge16 silver badges48 bronze badges




            11.2k1 gold badge16 silver badges48 bronze badges


























                1














                $begingroup$


                Gaia, 2 bytes



                _@


                Try it online!



                _	| implicit push input and negate
                @ | push input
                | implicit print TOS


                Reversed:



                @	| push input
                _ | negate
                | implicit print TOS





                share|improve this answer









                $endgroup$



















                  1














                  $begingroup$


                  Gaia, 2 bytes



                  _@


                  Try it online!



                  _	| implicit push input and negate
                  @ | push input
                  | implicit print TOS


                  Reversed:



                  @	| push input
                  _ | negate
                  | implicit print TOS





                  share|improve this answer









                  $endgroup$

















                    1














                    1










                    1







                    $begingroup$


                    Gaia, 2 bytes



                    _@


                    Try it online!



                    _	| implicit push input and negate
                    @ | push input
                    | implicit print TOS


                    Reversed:



                    @	| push input
                    _ | negate
                    | implicit print TOS





                    share|improve this answer









                    $endgroup$




                    Gaia, 2 bytes



                    _@


                    Try it online!



                    _	| implicit push input and negate
                    @ | push input
                    | implicit print TOS


                    Reversed:



                    @	| push input
                    _ | negate
                    | implicit print TOS






                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 8 hours ago









                    GiuseppeGiuseppe

                    19.3k3 gold badges16 silver badges71 bronze badges




                    19.3k3 gold badges16 silver badges71 bronze badges
























                        1














                        $begingroup$


                        PowerShell, 18 14 bytes





                        $args#"sgra$"-


                        Try it online! !enilno ti yrT



                        First of the trivial comment-abuse answers






                        share|improve this answer











                        $endgroup$










                        • 1




                          $begingroup$
                          Oh, God. Not this again.
                          $endgroup$
                          – JL2210
                          7 hours ago















                        1














                        $begingroup$


                        PowerShell, 18 14 bytes





                        $args#"sgra$"-


                        Try it online! !enilno ti yrT



                        First of the trivial comment-abuse answers






                        share|improve this answer











                        $endgroup$










                        • 1




                          $begingroup$
                          Oh, God. Not this again.
                          $endgroup$
                          – JL2210
                          7 hours ago













                        1














                        1










                        1







                        $begingroup$


                        PowerShell, 18 14 bytes





                        $args#"sgra$"-


                        Try it online! !enilno ti yrT



                        First of the trivial comment-abuse answers






                        share|improve this answer











                        $endgroup$




                        PowerShell, 18 14 bytes





                        $args#"sgra$"-


                        Try it online! !enilno ti yrT



                        First of the trivial comment-abuse answers







                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited 7 hours ago

























                        answered 8 hours ago









                        VeskahVeskah

                        2,2575 silver badges24 bronze badges




                        2,2575 silver badges24 bronze badges










                        • 1




                          $begingroup$
                          Oh, God. Not this again.
                          $endgroup$
                          – JL2210
                          7 hours ago












                        • 1




                          $begingroup$
                          Oh, God. Not this again.
                          $endgroup$
                          – JL2210
                          7 hours ago







                        1




                        1




                        $begingroup$
                        Oh, God. Not this again.
                        $endgroup$
                        – JL2210
                        7 hours ago




                        $begingroup$
                        Oh, God. Not this again.
                        $endgroup$
                        – JL2210
                        7 hours ago











                        1














                        $begingroup$


                        05AB1E, 2 bytes



                        (I


                        Try it online!



                        Reversed



                        ( negates nothing
                        I pushes input

                        I pushes input
                        ( negates input





                        share|improve this answer










                        New contributor



                        jasanborn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.





                        $endgroup$














                        • $begingroup$
                          It is supposed to only negate the input in one direction, leaving it as-is in the other. Clearly, 1-character solution cannot be valid.
                          $endgroup$
                          – Adám
                          7 hours ago










                        • $begingroup$
                          My bad, I misunderstood
                          $endgroup$
                          – jasanborn
                          7 hours ago















                        1














                        $begingroup$


                        05AB1E, 2 bytes



                        (I


                        Try it online!



                        Reversed



                        ( negates nothing
                        I pushes input

                        I pushes input
                        ( negates input





                        share|improve this answer










                        New contributor



                        jasanborn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.





                        $endgroup$














                        • $begingroup$
                          It is supposed to only negate the input in one direction, leaving it as-is in the other. Clearly, 1-character solution cannot be valid.
                          $endgroup$
                          – Adám
                          7 hours ago










                        • $begingroup$
                          My bad, I misunderstood
                          $endgroup$
                          – jasanborn
                          7 hours ago













                        1














                        1










                        1







                        $begingroup$


                        05AB1E, 2 bytes



                        (I


                        Try it online!



                        Reversed



                        ( negates nothing
                        I pushes input

                        I pushes input
                        ( negates input





                        share|improve this answer










                        New contributor



                        jasanborn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.





                        $endgroup$




                        05AB1E, 2 bytes



                        (I


                        Try it online!



                        Reversed



                        ( negates nothing
                        I pushes input

                        I pushes input
                        ( negates input






                        share|improve this answer










                        New contributor



                        jasanborn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.








                        share|improve this answer



                        share|improve this answer








                        edited 7 hours ago





















                        New contributor



                        jasanborn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.








                        answered 7 hours ago









                        jasanbornjasanborn

                        114 bronze badges




                        114 bronze badges




                        New contributor



                        jasanborn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.




                        New contributor




                        jasanborn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.
















                        • $begingroup$
                          It is supposed to only negate the input in one direction, leaving it as-is in the other. Clearly, 1-character solution cannot be valid.
                          $endgroup$
                          – Adám
                          7 hours ago










                        • $begingroup$
                          My bad, I misunderstood
                          $endgroup$
                          – jasanborn
                          7 hours ago
















                        • $begingroup$
                          It is supposed to only negate the input in one direction, leaving it as-is in the other. Clearly, 1-character solution cannot be valid.
                          $endgroup$
                          – Adám
                          7 hours ago










                        • $begingroup$
                          My bad, I misunderstood
                          $endgroup$
                          – jasanborn
                          7 hours ago















                        $begingroup$
                        It is supposed to only negate the input in one direction, leaving it as-is in the other. Clearly, 1-character solution cannot be valid.
                        $endgroup$
                        – Adám
                        7 hours ago




                        $begingroup$
                        It is supposed to only negate the input in one direction, leaving it as-is in the other. Clearly, 1-character solution cannot be valid.
                        $endgroup$
                        – Adám
                        7 hours ago












                        $begingroup$
                        My bad, I misunderstood
                        $endgroup$
                        – jasanborn
                        7 hours ago




                        $begingroup$
                        My bad, I misunderstood
                        $endgroup$
                        – jasanborn
                        7 hours ago











                        1














                        $begingroup$


                        Jelly, 2 bytes



                        oN


                        Try it online! and its reverse.



                        oN - (input) OR ((input) negated)

                        No - ((input) negated) OR (input)





                        share|improve this answer









                        $endgroup$














                        • $begingroup$
                          Heh, you can also do ḷN, no need for the OR logic. :D
                          $endgroup$
                          – Erik the Outgolfer
                          5 hours ago







                        • 1




                          $begingroup$
                          Na, words give aN aesthetic effect :)
                          $endgroup$
                          – Jonathan Allan
                          5 hours ago















                        1














                        $begingroup$


                        Jelly, 2 bytes



                        oN


                        Try it online! and its reverse.



                        oN - (input) OR ((input) negated)

                        No - ((input) negated) OR (input)





                        share|improve this answer









                        $endgroup$














                        • $begingroup$
                          Heh, you can also do ḷN, no need for the OR logic. :D
                          $endgroup$
                          – Erik the Outgolfer
                          5 hours ago







                        • 1




                          $begingroup$
                          Na, words give aN aesthetic effect :)
                          $endgroup$
                          – Jonathan Allan
                          5 hours ago













                        1














                        1










                        1







                        $begingroup$


                        Jelly, 2 bytes



                        oN


                        Try it online! and its reverse.



                        oN - (input) OR ((input) negated)

                        No - ((input) negated) OR (input)





                        share|improve this answer









                        $endgroup$




                        Jelly, 2 bytes



                        oN


                        Try it online! and its reverse.



                        oN - (input) OR ((input) negated)

                        No - ((input) negated) OR (input)






                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered 7 hours ago









                        Jonathan AllanJonathan Allan

                        60.3k5 gold badges44 silver badges187 bronze badges




                        60.3k5 gold badges44 silver badges187 bronze badges














                        • $begingroup$
                          Heh, you can also do ḷN, no need for the OR logic. :D
                          $endgroup$
                          – Erik the Outgolfer
                          5 hours ago







                        • 1




                          $begingroup$
                          Na, words give aN aesthetic effect :)
                          $endgroup$
                          – Jonathan Allan
                          5 hours ago
















                        • $begingroup$
                          Heh, you can also do ḷN, no need for the OR logic. :D
                          $endgroup$
                          – Erik the Outgolfer
                          5 hours ago







                        • 1




                          $begingroup$
                          Na, words give aN aesthetic effect :)
                          $endgroup$
                          – Jonathan Allan
                          5 hours ago















                        $begingroup$
                        Heh, you can also do ḷN, no need for the OR logic. :D
                        $endgroup$
                        – Erik the Outgolfer
                        5 hours ago





                        $begingroup$
                        Heh, you can also do ḷN, no need for the OR logic. :D
                        $endgroup$
                        – Erik the Outgolfer
                        5 hours ago





                        1




                        1




                        $begingroup$
                        Na, words give aN aesthetic effect :)
                        $endgroup$
                        – Jonathan Allan
                        5 hours ago




                        $begingroup$
                        Na, words give aN aesthetic effect :)
                        $endgroup$
                        – Jonathan Allan
                        5 hours ago











                        1














                        $begingroup$


                        Labyrinth / Hexagony, 6 bytes



                        Labyrinth:



                        ?!@!`?


                        Try it online! and its reverse.



                        Hexagony:



                        ?!@!~?


                        Try it online! and its reverse.



                        How?



                        ? - take a signed integer
                        (` / ~) - negate
                        ! - output top-of-stack / current-memory-edge
                        @ - exit





                        share|improve this answer











                        $endgroup$



















                          1














                          $begingroup$


                          Labyrinth / Hexagony, 6 bytes



                          Labyrinth:



                          ?!@!`?


                          Try it online! and its reverse.



                          Hexagony:



                          ?!@!~?


                          Try it online! and its reverse.



                          How?



                          ? - take a signed integer
                          (` / ~) - negate
                          ! - output top-of-stack / current-memory-edge
                          @ - exit





                          share|improve this answer











                          $endgroup$

















                            1














                            1










                            1







                            $begingroup$


                            Labyrinth / Hexagony, 6 bytes



                            Labyrinth:



                            ?!@!`?


                            Try it online! and its reverse.



                            Hexagony:



                            ?!@!~?


                            Try it online! and its reverse.



                            How?



                            ? - take a signed integer
                            (` / ~) - negate
                            ! - output top-of-stack / current-memory-edge
                            @ - exit





                            share|improve this answer











                            $endgroup$




                            Labyrinth / Hexagony, 6 bytes



                            Labyrinth:



                            ?!@!`?


                            Try it online! and its reverse.



                            Hexagony:



                            ?!@!~?


                            Try it online! and its reverse.



                            How?



                            ? - take a signed integer
                            (` / ~) - negate
                            ! - output top-of-stack / current-memory-edge
                            @ - exit






                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited 6 hours ago

























                            answered 6 hours ago









                            Jonathan AllanJonathan Allan

                            60.3k5 gold badges44 silver badges187 bronze badges




                            60.3k5 gold badges44 silver badges187 bronze badges
























                                1














                                $begingroup$


                                Perl 6 / Raku, 3 bytes





                                *-0


                                Try it online!



                                Creates a Whatever code block. Read in normally its standard block equivalent is -> x x - 0, but in reverse it becomes -> x 0 - x.






                                share|improve this answer









                                $endgroup$



















                                  1














                                  $begingroup$


                                  Perl 6 / Raku, 3 bytes





                                  *-0


                                  Try it online!



                                  Creates a Whatever code block. Read in normally its standard block equivalent is -> x x - 0, but in reverse it becomes -> x 0 - x.






                                  share|improve this answer









                                  $endgroup$

















                                    1














                                    1










                                    1







                                    $begingroup$


                                    Perl 6 / Raku, 3 bytes





                                    *-0


                                    Try it online!



                                    Creates a Whatever code block. Read in normally its standard block equivalent is -> x x - 0, but in reverse it becomes -> x 0 - x.






                                    share|improve this answer









                                    $endgroup$




                                    Perl 6 / Raku, 3 bytes





                                    *-0


                                    Try it online!



                                    Creates a Whatever code block. Read in normally its standard block equivalent is -> x x - 0, but in reverse it becomes -> x 0 - x.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered 5 hours ago









                                    guifaguifa

                                    7033 silver badges10 bronze badges




                                    7033 silver badges10 bronze badges
























                                        1














                                        $begingroup$


                                        Klein, 2 bytes



                                        Works in all 12 topologies!



                                        @-


                                        Try it online!



                                        Reverse



                                        -@


                                        Try it online!



                                        - negates the input and @ ends the program






                                        share|improve this answer











                                        $endgroup$



















                                          1














                                          $begingroup$


                                          Klein, 2 bytes



                                          Works in all 12 topologies!



                                          @-


                                          Try it online!



                                          Reverse



                                          -@


                                          Try it online!



                                          - negates the input and @ ends the program






                                          share|improve this answer











                                          $endgroup$

















                                            1














                                            1










                                            1







                                            $begingroup$


                                            Klein, 2 bytes



                                            Works in all 12 topologies!



                                            @-


                                            Try it online!



                                            Reverse



                                            -@


                                            Try it online!



                                            - negates the input and @ ends the program






                                            share|improve this answer











                                            $endgroup$




                                            Klein, 2 bytes



                                            Works in all 12 topologies!



                                            @-


                                            Try it online!



                                            Reverse



                                            -@


                                            Try it online!



                                            - negates the input and @ ends the program







                                            share|improve this answer














                                            share|improve this answer



                                            share|improve this answer








                                            edited 2 hours ago

























                                            answered 6 hours ago









                                            Sriotchilism O'ZaicSriotchilism O'Zaic

                                            37.9k10 gold badges169 silver badges383 bronze badges




                                            37.9k10 gold badges169 silver badges383 bronze badges
























                                                1














                                                $begingroup$


                                                J, 3 bytes



                                                -&0


                                                Try it online!



                                                -&0 is "argument minus 0"



                                                0&- is "0 minus argument"






                                                share|improve this answer









                                                $endgroup$










                                                • 1




                                                  $begingroup$
                                                  this is really quite nice :)
                                                  $endgroup$
                                                  – Conor O'Brien
                                                  48 mins ago















                                                1














                                                $begingroup$


                                                J, 3 bytes



                                                -&0


                                                Try it online!



                                                -&0 is "argument minus 0"



                                                0&- is "0 minus argument"






                                                share|improve this answer









                                                $endgroup$










                                                • 1




                                                  $begingroup$
                                                  this is really quite nice :)
                                                  $endgroup$
                                                  – Conor O'Brien
                                                  48 mins ago













                                                1














                                                1










                                                1







                                                $begingroup$


                                                J, 3 bytes



                                                -&0


                                                Try it online!



                                                -&0 is "argument minus 0"



                                                0&- is "0 minus argument"






                                                share|improve this answer









                                                $endgroup$




                                                J, 3 bytes



                                                -&0


                                                Try it online!



                                                -&0 is "argument minus 0"



                                                0&- is "0 minus argument"







                                                share|improve this answer












                                                share|improve this answer



                                                share|improve this answer










                                                answered 1 hour ago









                                                JonahJonah

                                                4,8022 gold badges12 silver badges22 bronze badges




                                                4,8022 gold badges12 silver badges22 bronze badges










                                                • 1




                                                  $begingroup$
                                                  this is really quite nice :)
                                                  $endgroup$
                                                  – Conor O'Brien
                                                  48 mins ago












                                                • 1




                                                  $begingroup$
                                                  this is really quite nice :)
                                                  $endgroup$
                                                  – Conor O'Brien
                                                  48 mins ago







                                                1




                                                1




                                                $begingroup$
                                                this is really quite nice :)
                                                $endgroup$
                                                – Conor O'Brien
                                                48 mins ago




                                                $begingroup$
                                                this is really quite nice :)
                                                $endgroup$
                                                – Conor O'Brien
                                                48 mins ago











                                                0














                                                $begingroup$


                                                Triangular, 8 bytes



                                                $.%..|.$


                                                Try it online!



                                                Ungolfed:



                                                 $ Read an integer
                                                . % Output it
                                                . . | Negate (doesn't matter here)
                                                . $


                                                Reversed:



                                                $.|..%.$


                                                Try it online!






                                                share|improve this answer









                                                $endgroup$



















                                                  0














                                                  $begingroup$


                                                  Triangular, 8 bytes



                                                  $.%..|.$


                                                  Try it online!



                                                  Ungolfed:



                                                   $ Read an integer
                                                  . % Output it
                                                  . . | Negate (doesn't matter here)
                                                  . $


                                                  Reversed:



                                                  $.|..%.$


                                                  Try it online!






                                                  share|improve this answer









                                                  $endgroup$

















                                                    0














                                                    0










                                                    0







                                                    $begingroup$


                                                    Triangular, 8 bytes



                                                    $.%..|.$


                                                    Try it online!



                                                    Ungolfed:



                                                     $ Read an integer
                                                    . % Output it
                                                    . . | Negate (doesn't matter here)
                                                    . $


                                                    Reversed:



                                                    $.|..%.$


                                                    Try it online!






                                                    share|improve this answer









                                                    $endgroup$




                                                    Triangular, 8 bytes



                                                    $.%..|.$


                                                    Try it online!



                                                    Ungolfed:



                                                     $ Read an integer
                                                    . % Output it
                                                    . . | Negate (doesn't matter here)
                                                    . $


                                                    Reversed:



                                                    $.|..%.$


                                                    Try it online!







                                                    share|improve this answer












                                                    share|improve this answer



                                                    share|improve this answer










                                                    answered 8 hours ago









                                                    squidsquid

                                                    1,0711 silver badge10 bronze badges




                                                    1,0711 silver badge10 bronze badges
























                                                        0














                                                        $begingroup$


                                                        Japt, 3 bytes



                                                        TnU


                                                        Try it | Reversed



                                                        Same method as my earlier solution, with T being 0 and U being the input.






                                                        share|improve this answer









                                                        $endgroup$



















                                                          0














                                                          $begingroup$


                                                          Japt, 3 bytes



                                                          TnU


                                                          Try it | Reversed



                                                          Same method as my earlier solution, with T being 0 and U being the input.






                                                          share|improve this answer









                                                          $endgroup$

















                                                            0














                                                            0










                                                            0







                                                            $begingroup$


                                                            Japt, 3 bytes



                                                            TnU


                                                            Try it | Reversed



                                                            Same method as my earlier solution, with T being 0 and U being the input.






                                                            share|improve this answer









                                                            $endgroup$




                                                            Japt, 3 bytes



                                                            TnU


                                                            Try it | Reversed



                                                            Same method as my earlier solution, with T being 0 and U being the input.







                                                            share|improve this answer












                                                            share|improve this answer



                                                            share|improve this answer










                                                            answered 8 hours ago









                                                            ShaggyShaggy

                                                            21.6k3 gold badges21 silver badges72 bronze badges




                                                            21.6k3 gold badges21 silver badges72 bronze badges
























                                                                0














                                                                $begingroup$


                                                                V (vim), 5 bytes



                                                                É-ó--


                                                                Try it online!



                                                                Hexdump:



                                                                00000000: c92d f32d 2d .-.--





                                                                share|improve this answer









                                                                $endgroup$



















                                                                  0














                                                                  $begingroup$


                                                                  V (vim), 5 bytes



                                                                  É-ó--


                                                                  Try it online!



                                                                  Hexdump:



                                                                  00000000: c92d f32d 2d .-.--





                                                                  share|improve this answer









                                                                  $endgroup$

















                                                                    0














                                                                    0










                                                                    0







                                                                    $begingroup$


                                                                    V (vim), 5 bytes



                                                                    É-ó--


                                                                    Try it online!



                                                                    Hexdump:



                                                                    00000000: c92d f32d 2d .-.--





                                                                    share|improve this answer









                                                                    $endgroup$




                                                                    V (vim), 5 bytes



                                                                    É-ó--


                                                                    Try it online!



                                                                    Hexdump:



                                                                    00000000: c92d f32d 2d .-.--






                                                                    share|improve this answer












                                                                    share|improve this answer



                                                                    share|improve this answer










                                                                    answered 8 hours ago









                                                                    DJMcMayhemDJMcMayhem

                                                                    42.3k12 gold badges160 silver badges330 bronze badges




                                                                    42.3k12 gold badges160 silver badges330 bronze badges
























                                                                        0














                                                                        $begingroup$


                                                                        APL (Dyalog Unicode), 13 bytes





                                                                        (⊢-∘0)⍝)⊢-∘0(


                                                                        Try it online!



                                                                        Trivial answer. Returns arg-0 or 0-arg.






                                                                        share|improve this answer









                                                                        $endgroup$














                                                                        • $begingroup$
                                                                          Whoa, this can be done trivially in three bytes!
                                                                          $endgroup$
                                                                          – Adám
                                                                          7 hours ago















                                                                        0














                                                                        $begingroup$


                                                                        APL (Dyalog Unicode), 13 bytes





                                                                        (⊢-∘0)⍝)⊢-∘0(


                                                                        Try it online!



                                                                        Trivial answer. Returns arg-0 or 0-arg.






                                                                        share|improve this answer









                                                                        $endgroup$














                                                                        • $begingroup$
                                                                          Whoa, this can be done trivially in three bytes!
                                                                          $endgroup$
                                                                          – Adám
                                                                          7 hours ago













                                                                        0














                                                                        0










                                                                        0







                                                                        $begingroup$


                                                                        APL (Dyalog Unicode), 13 bytes





                                                                        (⊢-∘0)⍝)⊢-∘0(


                                                                        Try it online!



                                                                        Trivial answer. Returns arg-0 or 0-arg.






                                                                        share|improve this answer









                                                                        $endgroup$




                                                                        APL (Dyalog Unicode), 13 bytes





                                                                        (⊢-∘0)⍝)⊢-∘0(


                                                                        Try it online!



                                                                        Trivial answer. Returns arg-0 or 0-arg.







                                                                        share|improve this answer












                                                                        share|improve this answer



                                                                        share|improve this answer










                                                                        answered 7 hours ago









                                                                        J. SalléJ. Sallé

                                                                        2,5984 silver badges24 bronze badges




                                                                        2,5984 silver badges24 bronze badges














                                                                        • $begingroup$
                                                                          Whoa, this can be done trivially in three bytes!
                                                                          $endgroup$
                                                                          – Adám
                                                                          7 hours ago
















                                                                        • $begingroup$
                                                                          Whoa, this can be done trivially in three bytes!
                                                                          $endgroup$
                                                                          – Adám
                                                                          7 hours ago















                                                                        $begingroup$
                                                                        Whoa, this can be done trivially in three bytes!
                                                                        $endgroup$
                                                                        – Adám
                                                                        7 hours ago




                                                                        $begingroup$
                                                                        Whoa, this can be done trivially in three bytes!
                                                                        $endgroup$
                                                                        – Adám
                                                                        7 hours ago











                                                                        0














                                                                        $begingroup$

                                                                        JavaScript, 11 bytes



                                                                        n=>n//n->=n


                                                                        Try it Online! | Reversed






                                                                        share|improve this answer









                                                                        $endgroup$



















                                                                          0














                                                                          $begingroup$

                                                                          JavaScript, 11 bytes



                                                                          n=>n//n->=n


                                                                          Try it Online! | Reversed






                                                                          share|improve this answer









                                                                          $endgroup$

















                                                                            0














                                                                            0










                                                                            0







                                                                            $begingroup$

                                                                            JavaScript, 11 bytes



                                                                            n=>n//n->=n


                                                                            Try it Online! | Reversed






                                                                            share|improve this answer









                                                                            $endgroup$



                                                                            JavaScript, 11 bytes



                                                                            n=>n//n->=n


                                                                            Try it Online! | Reversed







                                                                            share|improve this answer












                                                                            share|improve this answer



                                                                            share|improve this answer










                                                                            answered 7 hours ago









                                                                            ShaggyShaggy

                                                                            21.6k3 gold badges21 silver badges72 bronze badges




                                                                            21.6k3 gold badges21 silver badges72 bronze badges
























                                                                                0














                                                                                $begingroup$


                                                                                C++ (gcc), 29 bytes



                                                                                Function-like macro:



                                                                                #define f(x)-x//x)x(g enifed#


                                                                                Try it online!






                                                                                share|improve this answer









                                                                                $endgroup$



















                                                                                  0














                                                                                  $begingroup$


                                                                                  C++ (gcc), 29 bytes



                                                                                  Function-like macro:



                                                                                  #define f(x)-x//x)x(g enifed#


                                                                                  Try it online!






                                                                                  share|improve this answer









                                                                                  $endgroup$

















                                                                                    0














                                                                                    0










                                                                                    0







                                                                                    $begingroup$


                                                                                    C++ (gcc), 29 bytes



                                                                                    Function-like macro:



                                                                                    #define f(x)-x//x)x(g enifed#


                                                                                    Try it online!






                                                                                    share|improve this answer









                                                                                    $endgroup$




                                                                                    C++ (gcc), 29 bytes



                                                                                    Function-like macro:



                                                                                    #define f(x)-x//x)x(g enifed#


                                                                                    Try it online!







                                                                                    share|improve this answer












                                                                                    share|improve this answer



                                                                                    share|improve this answer










                                                                                    answered 7 hours ago









                                                                                    NishiokaNishioka

                                                                                    1614 bronze badges




                                                                                    1614 bronze badges
























                                                                                        0














                                                                                        $begingroup$


                                                                                        Befunge-98 (FBBI), 6 bytes



                                                                                        &.@.-&


                                                                                        Try it online! Try it reversed!






                                                                                        share|improve this answer









                                                                                        $endgroup$



















                                                                                          0














                                                                                          $begingroup$


                                                                                          Befunge-98 (FBBI), 6 bytes



                                                                                          &.@.-&


                                                                                          Try it online! Try it reversed!






                                                                                          share|improve this answer









                                                                                          $endgroup$

















                                                                                            0














                                                                                            0










                                                                                            0







                                                                                            $begingroup$


                                                                                            Befunge-98 (FBBI), 6 bytes



                                                                                            &.@.-&


                                                                                            Try it online! Try it reversed!






                                                                                            share|improve this answer









                                                                                            $endgroup$




                                                                                            Befunge-98 (FBBI), 6 bytes



                                                                                            &.@.-&


                                                                                            Try it online! Try it reversed!







                                                                                            share|improve this answer












                                                                                            share|improve this answer



                                                                                            share|improve this answer










                                                                                            answered 6 hours ago









                                                                                            ovsovs

                                                                                            20.2k2 gold badges13 silver badges62 bronze badges




                                                                                            20.2k2 gold badges13 silver badges62 bronze badges
























                                                                                                0














                                                                                                $begingroup$


                                                                                                Stax, 2 bytes



                                                                                                pN


                                                                                                Run and debug it






                                                                                                share|improve this answer









                                                                                                $endgroup$



















                                                                                                  0














                                                                                                  $begingroup$


                                                                                                  Stax, 2 bytes



                                                                                                  pN


                                                                                                  Run and debug it






                                                                                                  share|improve this answer









                                                                                                  $endgroup$

















                                                                                                    0














                                                                                                    0










                                                                                                    0







                                                                                                    $begingroup$


                                                                                                    Stax, 2 bytes



                                                                                                    pN


                                                                                                    Run and debug it






                                                                                                    share|improve this answer









                                                                                                    $endgroup$




                                                                                                    Stax, 2 bytes



                                                                                                    pN


                                                                                                    Run and debug it







                                                                                                    share|improve this answer












                                                                                                    share|improve this answer



                                                                                                    share|improve this answer










                                                                                                    answered 6 hours ago









                                                                                                    OliverOliver

                                                                                                    6,6702 gold badges9 silver badges36 bronze badges




                                                                                                    6,6702 gold badges9 silver badges36 bronze badges
























                                                                                                        0














                                                                                                        $begingroup$


                                                                                                        Retina 0.8.2, 13 bytes



                                                                                                        -*$1#$
                                                                                                        )^(|-^


                                                                                                        Try it online! It's impossible for the first line to match anything, so nothing happens. In reverse:



                                                                                                        ^-|(^)
                                                                                                        $#1$*-


                                                                                                        Try it online! Explanation: Either a leading - or a leading empty string is matched. This is replaced with - repeated according to the number of empty strings that were matched.






                                                                                                        share|improve this answer









                                                                                                        $endgroup$



















                                                                                                          0














                                                                                                          $begingroup$


                                                                                                          Retina 0.8.2, 13 bytes



                                                                                                          -*$1#$
                                                                                                          )^(|-^


                                                                                                          Try it online! It's impossible for the first line to match anything, so nothing happens. In reverse:



                                                                                                          ^-|(^)
                                                                                                          $#1$*-


                                                                                                          Try it online! Explanation: Either a leading - or a leading empty string is matched. This is replaced with - repeated according to the number of empty strings that were matched.






                                                                                                          share|improve this answer









                                                                                                          $endgroup$

















                                                                                                            0














                                                                                                            0










                                                                                                            0







                                                                                                            $begingroup$


                                                                                                            Retina 0.8.2, 13 bytes



                                                                                                            -*$1#$
                                                                                                            )^(|-^


                                                                                                            Try it online! It's impossible for the first line to match anything, so nothing happens. In reverse:



                                                                                                            ^-|(^)
                                                                                                            $#1$*-


                                                                                                            Try it online! Explanation: Either a leading - or a leading empty string is matched. This is replaced with - repeated according to the number of empty strings that were matched.






                                                                                                            share|improve this answer









                                                                                                            $endgroup$




                                                                                                            Retina 0.8.2, 13 bytes



                                                                                                            -*$1#$
                                                                                                            )^(|-^


                                                                                                            Try it online! It's impossible for the first line to match anything, so nothing happens. In reverse:



                                                                                                            ^-|(^)
                                                                                                            $#1$*-


                                                                                                            Try it online! Explanation: Either a leading - or a leading empty string is matched. This is replaced with - repeated according to the number of empty strings that were matched.







                                                                                                            share|improve this answer












                                                                                                            share|improve this answer



                                                                                                            share|improve this answer










                                                                                                            answered 3 hours ago









                                                                                                            NeilNeil

                                                                                                            88.9k8 gold badges46 silver badges188 bronze badges




                                                                                                            88.9k8 gold badges46 silver badges188 bronze badges
























                                                                                                                0














                                                                                                                $begingroup$


                                                                                                                Haskell, 8 bytes



                                                                                                                Anonymous identity function, turning into subtraction from 0 when reversed.





                                                                                                                id--)-0(


                                                                                                                Try it online!



                                                                                                                Reversed:



                                                                                                                (0-)--di


                                                                                                                Try it online!






                                                                                                                share|improve this answer









                                                                                                                $endgroup$



















                                                                                                                  0














                                                                                                                  $begingroup$


                                                                                                                  Haskell, 8 bytes



                                                                                                                  Anonymous identity function, turning into subtraction from 0 when reversed.





                                                                                                                  id--)-0(


                                                                                                                  Try it online!



                                                                                                                  Reversed:



                                                                                                                  (0-)--di


                                                                                                                  Try it online!






                                                                                                                  share|improve this answer









                                                                                                                  $endgroup$

















                                                                                                                    0














                                                                                                                    0










                                                                                                                    0







                                                                                                                    $begingroup$


                                                                                                                    Haskell, 8 bytes



                                                                                                                    Anonymous identity function, turning into subtraction from 0 when reversed.





                                                                                                                    id--)-0(


                                                                                                                    Try it online!



                                                                                                                    Reversed:



                                                                                                                    (0-)--di


                                                                                                                    Try it online!






                                                                                                                    share|improve this answer









                                                                                                                    $endgroup$




                                                                                                                    Haskell, 8 bytes



                                                                                                                    Anonymous identity function, turning into subtraction from 0 when reversed.





                                                                                                                    id--)-0(


                                                                                                                    Try it online!



                                                                                                                    Reversed:



                                                                                                                    (0-)--di


                                                                                                                    Try it online!







                                                                                                                    share|improve this answer












                                                                                                                    share|improve this answer



                                                                                                                    share|improve this answer










                                                                                                                    answered 3 hours ago









                                                                                                                    Ørjan JohansenØrjan Johansen

                                                                                                                    6,7041 gold badge15 silver badges34 bronze badges




                                                                                                                    6,7041 gold badge15 silver badges34 bronze badges
























                                                                                                                        0














                                                                                                                        $begingroup$


                                                                                                                        Wolfram Language (Mathematica), 9 bytes



                                                                                                                        1&0+#-0&1


                                                                                                                        Try it online!



                                                                                                                        Forward: read ((1)&*0+#-0)&*1=#&



                                                                                                                        Backward: read ((1)&*0-#+0)&*1=-#&






                                                                                                                        share|improve this answer











                                                                                                                        $endgroup$



















                                                                                                                          0














                                                                                                                          $begingroup$


                                                                                                                          Wolfram Language (Mathematica), 9 bytes



                                                                                                                          1&0+#-0&1


                                                                                                                          Try it online!



                                                                                                                          Forward: read ((1)&*0+#-0)&*1=#&



                                                                                                                          Backward: read ((1)&*0-#+0)&*1=-#&






                                                                                                                          share|improve this answer











                                                                                                                          $endgroup$

















                                                                                                                            0














                                                                                                                            0










                                                                                                                            0







                                                                                                                            $begingroup$


                                                                                                                            Wolfram Language (Mathematica), 9 bytes



                                                                                                                            1&0+#-0&1


                                                                                                                            Try it online!



                                                                                                                            Forward: read ((1)&*0+#-0)&*1=#&



                                                                                                                            Backward: read ((1)&*0-#+0)&*1=-#&






                                                                                                                            share|improve this answer











                                                                                                                            $endgroup$




                                                                                                                            Wolfram Language (Mathematica), 9 bytes



                                                                                                                            1&0+#-0&1


                                                                                                                            Try it online!



                                                                                                                            Forward: read ((1)&*0+#-0)&*1=#&



                                                                                                                            Backward: read ((1)&*0-#+0)&*1=-#&







                                                                                                                            share|improve this answer














                                                                                                                            share|improve this answer



                                                                                                                            share|improve this answer








                                                                                                                            edited 3 hours ago

























                                                                                                                            answered 3 hours ago









                                                                                                                            attinatattinat

                                                                                                                            2,7463 silver badges11 bronze badges




                                                                                                                            2,7463 silver badges11 bronze badges































                                                                                                                                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%2f193021%2fi-reverse-the-source-code-you-negate-the-input%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

                                                                                                                                Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

                                                                                                                                Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

                                                                                                                                199年 目錄 大件事 到箇年出世嗰人 到箇年死嗰人 節慶、風俗習慣 導覽選單