text:
Quine of orders
Write a program that, when run in different languages, outputs a different byte permutation of the code in each language. The exact source code is counted as one permutation.
Here "different language" can be different version(Py 2 and Py 3) or different standard flags. It's different output that forces different version.
Proper quine rules apply for the program in each language. Your score is calculated as (Language count)^6/(Code length in bytes), with a higher score being better.
Sample:
If your code is AAB and running in three different languages returns ABA, AAB and AAB, then its score is 2^6/3(only one of the two AAB count). It's fine if ABA is meaningless.

What counts as a different language?

Which definition of a proper quine applies? (Martin's, or ais523's, or maybe some other definition in these meta threads?) Do the proper quine rules apply only to interpretations of the program that are actually quines? (For what it's worth, I don't think this challenge is improved much by enforcing proper quine rules.)

To clarify, working on your example — if my code AAB prints AAB in language-1 and ABA in language-2, I assume that it must be a proper quine when viewed as a language-1 program, and there are no further restrictions involving its interpretation as a language-2 program. Is that right?

@Laikoni assume that, if it prints a different permutation then it is a different language

Is code length counted in characters or bytes? What should we do with different character encodings?

None of the programs are required to be a quine, right?

@dylnan True. Program 123 outputting 321 and 132 is allowed

What about bytes vs. characters?

Proper quine rule is to avoid some code like if(language1)output thiscode().permutation(5);else if(language2)output thiscode().permutation(6);else ...

Befunge-98, ><>, Gol><>, Fission, Wumpus, Cardinal, Beeswax and Alice Score: 86/88 = 2978.909
"65*4+059*$!#.39*0jp2+'Wk,@ ''5&.'\d&o@o&88#+\@ol?!,'.'0.6'!+Ox,++tttt=++%-$#}.6~.F4*`*R

Try it in Befunge!
Try it in ><>!
Try it in Gol><>!
Try it in Fission!
Try it in Wumpus!
Try it in Cardinal!
Try it in Beeswax!
Try it in Alice!
Verification!
Lots of 2D languages, all abusing wrapping string literals. The difference in outputs are thus:
><>, Gol><> and Befunge-98 all print the code backwards (except for the "), with the last three characters in different positions, R*", O"* and "R* respectively. Beeswax also has the code backwards, but the last three characters are interspersed in the first section of the output. Alice is mostly backwards, except for all the escaped characters (',\ and ") moved to the front instead.
Wumpus is the only actual quine, Fission puts the " at the end of the code instead of the beginning, and Cardinal puts the " between the 0 and the 5 near the start.
Proof of different permutations
Explanations:
Befunge-98:
"  Wrapping string literal pushes all other characters + a space to the stack
 65*4+  Push " to the stack
      059*$!#.39*0j   Push 1,27 to the stack
                   p  Pops the top three values of the stack (27,1,34)
                    2+  Adds 2 to the space to make "
                      'Wk,@  Prints the top 88 characters of the stack and terminates

><> and Gol><>:
To be honest, I didn't do much here. The only difference between the execution of these two languages is the @ command, which rotates the top three values of the stack in different ways for each language.
"  Wrapping string literal pushes all other characters to the stack
 65*4+  Push 34 (") to the stack
      059*$!#.  Jump to cell 45,0
                                   \@  Rotate the top three values of the stack
                                     ol?!,'.'0.  Output the whole stack, ending in a divide by 0/stack underflow error

Fission:
 "............R  Spawn a pointer going right

 "  Switch to printing mode and print every other character
 "  Switch off printing mode
  6  Teleport to other 6
 "........6'!+O   Print the "

Wumpus:
"  Bouncing string literal
 65*4+  Push a (")
      059*$!#.   Push 0 and jump to cell 0,45
                                        \  Reflect off mirror
                                       +   Add 0 to top of stack
                                 @o&88#    Print the top 88 characters of the stack

Cardinal:
                                 %   Spawn two pointer going left/right (up/down despawn immediately)
                                  -$  Right pointer jumps to cell -1,0
                      x,++tttt=++     Left pointer prints "
"  While right pointer switches to print mode and prints the code

Beeswax:
 "................*`*   Spawn pointers going in every direction
                        Every other * also spawns pointers, but they do nothing
                   `    Turn on print mode for two of the pointers going in different directions
                        This prints everything but the `
          #}.6~.F4*     Print a `

Alice:
"  Wrapping string literal pushes all other characters to the stack
   Except 's and mirrors
 65*4+  Push " to the stack
      059*$!#.  Does nothing
              39*0j  Jumps to cell 39,0
                         ''5&.    Push ' and duplicate it 5 times
                              '\  Push \
                                d&o@  Print the whole stack

Perl 5, Ruby, JavaScript (Chrome), PHP, Python 2, Python 3, 1206 bytes, score 66/1206 = 38.6865671641791
q=1//2;s=+0;s|0;"/.__id__;#";_="""q=1//2;s=+0;s|0;"/.__id__;#";_={0}{1}{0};R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q={0}{2}{0};print(_.format(Q,_,q[0:-12]+R,"%"))""";R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q="""|;#<?ob_end_clean();
eval($_='"$t"?0?[$q=37 .chr+113 .chr+38 .chr,$p=(96 .chr+39 .chr)*4,$n=10 .chr,$s=39 .chr*12,$S=34 .chr*3]:eval("printf=console.log;c=String.fromCharCode;$q=c(96);$p=c(37,113,38,39).repeat(4);$n=c(10);$s=c(39).repeat(12);$S=c(34,34,34)"):[]?[$q=q(!g)^PA,$p=HARHARHARHAR^od2od2od2od2,$n=R^X,$s=bbbbbbbbbbbb^EEEEEEEEEEEE,$S=hhh^JJJ]:[$q=O^h,$p=str_repeat(RHa3^w9GS,4),$n=R^X,$s=str_repeat(b^E,12),$S=HHH^jjj];//#');printf($x='q=1//2;s=+0;s|0;"/.__id__;#";_=%7$sq=1//2;s=+0;s|0;"/.__id__;#";_={0}{1}{0};R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q={0}{2}{0};print(_.format(Q,_,q[0:-12]+R,"%8$s"))%7$s;R=chr((39,34)[1/2>0])*12;Q=chr((39,34)[1/2==0])*3;q=%7$s|;#<?ob_end_clean();%5$seval($_=%3$s%1$s%3$s);printf($x=%3$s%2$s%3$s,$_,$x,$q,$p,$n,$s,$S,"%8$s",![]||([]+[])?$n:"");//#%4$s%6$s%7$s;print(_.format(Q,_,q[0:-12]+R,"%8$s"))%9$s',$_,$x,$q,$p,$n,$s,$S,"%",![]||([]+[])?$n:"");//#`q&%`q&%`q&%`q&%''''''''''''""";print(_.format(Q,_,q[0:-12]+R,"%"))

Validate Perl, Ruby, PHP, Python 2 and Python 3 online!
Note: running the above program in the Inspector console in Chrome (which appears to support positional arguments to console.log) returns the correct program.
Explanation
This turned out a lot longer than I'd hoped and I made my life a little harder too, so I'm likely to keep tinkering with it. I'd like to add in more languages too, but I need to find something that doesn't mind a $ sigil...
This is pretty much a standard quine format where the calculation of the quote to use is a little different for each language: in Ruby %q& is used, PHP uses ', JavaScript (Node.js) makes use of ` and Perl 5 utilises q(...). Because only the quotes change, the rest of the program is still executable and valid syntax in each language. Python 2 and 3 are wrapped around the previous program using """ for Python 2 and  ''' for Python 3.
The resultant Perl and Ruby programs aren't standard quines, additional q/%qs are added each iteration, but the first program returns correctly.
The results are:

Perl 5:
eval($_=q&...q&);printf($x=q&...q&,...);//#'%`'%`'%`'%`''''''''''''""" ...
Ruby:
eval($_=%q&...%q&);printf($x=%q&...%q&,...);//#`'`'`'`'''''''''''''""" ...
JavaScript (Chrome):
eval($_=` ...`);printf($x=`... `,...);//#%q&'%q&'%q&'%q&'''''''''''''""" ...
PHP:
eval($_='...');printf($x='...',...);//#`q&%`q&%`q&%`q&%''''''''''''""" ...
Python 2:
..._="""...""";...q="""...''''''''''''""";print(_.format(Q,_,q[0:-12]+R,"%"))
Python 3:
..._='''...''';...q='''...""""""""""""''';print(_.format(Q,_,q[0:-12]+R,"%"))

I've re-worked this a lot, I hope I haven't missed anything key here. I still have quite a way to go to be anywhere near Jo King's score...

Jelly, and M, 26/14 = 4.57
1Ɗṙ@“1Ɗṙ@ȮṾ”ȮṾ

Try it in Jelly!
Try it in M!
Ɗṙ@ȮṾ1“Ɗṙ@ȮṾ1” in Jelly
1Ɗṙ@ȮṾ“1Ɗṙ@ȮṾ” in M

I'm not sure that the Charcoal one counts as a proper quine

@H.PWiz I was about to add a comment saying that. I'll ask OP

@l4m2 do you consider the Charcoal program a proper quine? I will delete if not.

I guess it's like Quine in PHP?

@l4m2 Not sure, I don't know PHP. It works for most ASCII text I think

@dylnan Yeah, that's how it works. As far as I remember, commands in charcoal are only unicode characters, but I might be wrong.

@JoKing I've asked OP about Charcoal which is similar and they didn't really say whether it was valid. I'll just remove PHP.

Printable ASCII text is treated as a string literal, and the default command is Print if no other command or function wants the string.

@Neil Thanks. I guess that means it's not a quine, right?

There's no code, only data, so no, I don't think it does count as a quine.

Python 2 and Python 3, 26/61 =1.05
s='s=%r;print(s%%s[::(1/2>0)*2-1])';print(s%s[::(1/2>0)*2-1])

Try it in Python 2!
Try it in Python 3!
Saved 12 bytes thanks to Jo King.
Python 2 prints
s=')]1-2*)0>2/1(::[s%%s(tnirp;r%=s';print(s%s[::(1/2>0)*2-1])

Python 3 prints
s='s=%r;print(s%%s[::(1/2>0)*2-1])';print(s%s[::(1/2>0)*2-1])

This uses the fact that 1/2 is .5 in Python 3 and 0 in Python 2.

Bash/GolfScript, 72 bytes, score 26/72 = 8/9 (~0.888...)
.~0 ()
{
    declare "-f" @* ".~0" " ()
 "+@n.;
    echo '.~0;'
}
.~0;

Contains a single trailing space on the first two lines.
Try it online in Bash.
Try it online in GolfScript.
Simply modification of @jimmy23013's answer for the "Write a Polyquine" challenge. The modification that was done was removing the trailing space after the third line, and changing \n"+@n.; to \n "+@n;.
Bash will print lines 1 and 2 like this:
.~0 ()    <- Trailing space
{         <- Trailing space

And GolfScript will print lines 1 and 2 like this:
.~0 ()   <- No trailing space
 {       <- Both leading and trailing space

Here the base program, Bash output, and GolfScript outputs respectively with the new-lines replaced with \n:
.~0 () \n{ \n    declare "-f" @* ".~0" " ()\n "+@n.;\n    echo '.~0;'\n}\n.~0;
.~0 () \n{ \n    declare "-f" @* ".~0" " ()\n "+@n.;\n    echo '.~0;'\n}\n.~0;
.~0 ()\n { \n    declare "-f" @* ".~0" " ()\n "+@n.;\n    echo '.~0;'\n}\n.~0;

      ^^^ Note the difference here


text:
The house that Jack built
So, there's a famous children's rhyme...
This is the house that Jack built.

This is the malt
That lay in the house that Jack built.

This is the rat
That ate the malt
That lay in the house that Jack built.

This is the cat
That killed the rat
That ate the malt
That lay in the house that Jack built.

This is the dog
That worried the cat
That killed the rat
That ate the malt
That lay in the house that Jack built.

This is the cow with the crumpled horn
That tossed the dog
That worried the cat
That killed the rat
That ate the malt
That lay in the house that Jack built.

This is the maiden all forlorn
That milked the cow with the crumpled horn
That tossed the dog that worried the cat
That killed the rat that ate the malt
That lay in the house that Jack built.

This is the man all tattered and torn
That kissed the maiden all forlorn
That milked the cow with the crumpled horn
That tossed the dog that worried the cat
That killed the rat that ate the malt
That lay in the house that Jack built.

This is the judge all shaven and shorn
That married the man all tattered and torn
That kissed the maiden all forlorn
That milked the cow with the crumpled horn
That tossed the dog
That worried the cat
That killed the rat
That ate the malt
That lay in the house that Jack built.

This is the rooster that crowed in the morn
That woke the judge all shaven and shorn
That married the man all tattered and torn
That kissed the maiden all forlorn
That milked the cow with the crumpled horn
That tossed the dog
That worried the cat
That killed the rat
That ate the malt
That lay in the house that Jack built.

This is the farmer sowing his corn
That kept the rooster that crowed in the morn
That woke the judge all shaven and shorn
That married the man all tattered and torn
That kissed the maiden all forlorn
That milked the cow with the crumpled horn
That tossed the dog
That worried the cat
That killed the rat
That ate the malt
That lay in the house that Jack built.

This is the horse and the hound and the horn
That belonged to the farmer sowing his corn
That kept the rooster that crowed in the morn
That woke the judge all shaven and shorn
That married the man all tattered and torn
That kissed the maiden all forlorn
That milked the cow with the crumpled horn
That tossed the dog
That worried the cat
That killed the rat
That ate the malt
That lay in the house that Jack built.

Obviously, it's pretty process-based, you could totally write code for this, right?

Write some code which outputs the full text of "The house that Jack built".
Standard rules and loopholes and stuff.
Any language you like.
Try to do it in the smallest number of bytes.
I always like to see TIO links.
The case must match the rhyme.
Each line of the rhyme must be on a new line of text.
White-space before and after the line is fine.
No punctuation, except the full stop at the end of each verse.

Edit:
Earlier versions of this question contained an issue with this line
This is the rooster that crowed the morn
It was inconsistently applied.
To be clear; this should be one line on every occurrence, and should be added at once.

Further edit:
It's been declared that this question is a duplicate of:
We're no strangers to code golf, you know the rules, and so do I
However, while you could take the same approach, compressing the text as much as possible. There's also a chance to take a procedural approach to this rhyme, following the structure of the rhyme itself. Some of the solutions take this approach, so I'd say it is a similar, but distinct challenge for this reason.
This answer suggests that it's actually better to take the approach to this question which would not work for Rick Astley.
It is, however, a duplicate of the old lady song, and the 12 days of Christmas. I've voted to close it. (although, those two were not declared duplicate of each other).

Related

If another KC challenge is found with text that is accumulating prefixing or suffixes, I'd consider that a duplicate.

Related accumulating KC poem, possible duplicate. Also related.

@xnor Fair play, looks like a duplicate to me.

As @user202729 said, your rule "Each line of the rhyme must be on a new line of text." and the lines with dog, cat, rat, and malt in the verses of the man and maiden contradict each other (and also make every current answer invalid except for the encoded ones. I would suggest putting those that ... on newline That ... as well to keep things in the same pattern, or add a rule in bold to make it clearly those two verses are different from the rest of the rhyme.

@KevinCruijssen Dupe anyway? ...

It is a duplicate

@user202729 I know, that's also the reason why I haven't edited my answer yet. Ah well..

It was fun while it lasted.

JavaScript (ES6), 356 bytes
Procedural approach.
_=>`house th5 Jack built.
|malt6lay in|r565e|c56kill2dog6worri2cow with0crumpled h16toss2maiden3forl16milk2man3t5tered4 t16kiss2judge3shaven4 sh16marri2rooster6crowed in0m16woke|farmer sowing his c16kept|horse40hound40h16belonged to`.replace(/\d/g,n=>` the ,orn,ed|, all , and,at,
That `.split`,`[n]).split`|`.map(s=>`This is`+(p=' the '+s+p),p='').join`
`

Try it online!

Simple compression, 429 bytes
Using RegPack.
_=>[...'IKLMNOPQRSUVWXYZ[]^_0qxz{}~'].reduce((s,c)=>(l=s.split(c)).join(l.pop()),`TNis_ZOlt }{rQ z^}{cQ Sz^ }KM}]M}xI[I~Z0ZYZLrseULundU{hWbelongV toY~{judgeRshavenU shWmarriV[MP}PZ{ the z
ThQ xOidenRforlWmilkV]qworriV{cQS 0{rooster XcrowV in{mWwoke~_Luse XJack built.^QeOlt]{cow with{crumplV hWtossVK[OnRtQterVU tWkissVxZ

TNisY{farmer sowing NcWkept0XthQ WornzVedU andSzkillV{rQR all QatPzlay in_O{maNhis Mzqz^L{hoK{dog IXqX^}`)

Try it online!

Lol, common Arnauld, you can do much better than this. ;)

@KevinCruijssen Actually, my first guess is that a procedural approach would not be much shorter. (At least in JS and without a dictionary.)

@KevinCruijssen Finally saved ~19% with the procedural approach, which is better than I expected.

"Each line of the rhyme must be on a new line of text." This is not the case here. Any online diff tool will show it.

No, I don't care about which line feed is used. However... some verses have That tossed the dog that worried the cat and your output is That tossed the dog\nThat worried the cat. Same for the rat/malt line: some verses don't separate those.

@OlivierGrégoire Oh, I guess you're talking about the RegPack'ed version. It's based on the original version of the challenge and I didn't reflect the changes that were made afterwards.

@OlivierGrégoire (now fixed, saving 9 bytes)

Python 2, 398 397 bytes
for i in range(12):print'\nThis is the',''.join(dict(zip('012345','\nThat , the ,orn,ed, all , and'.split(','))).get(c,c)for c in'1'.join('horse51hound51h20belong3 to|farmer sowing his c20kept|rooster that crow3 in1m20woke|judge4shaven5 sh20marri3|man4tatter35 t20kiss3|maiden4forl20milk3|cow with1crumpl3 h20toss3|dog0worri3|cat0kill3|rat0ate|malt0lay in|house that Jack built.'.split('|')[~i:]))

Try it online!

Python 2, 401 398 bytes
for i in range(12):print'\nThis is the',' the '.join('horse and the hound and the horn?belonged to|farmer sowing his corn?kept|rooster that crowed in the morn?woke|judge all shaven and shorn?married|man all tattered and torn?kissed|maiden all forlorn?milked|cow with the crumpled horn?tossed|dog?worried|cat?killed|rat?ate|malt?lay in|house that Jack built.'.split('|')[~i:]).replace('?','\nThat ')

Try it online!

Saved

-3 bytes, thanks to Jonathan Frech

Though would not print'\nThis is the' be shorter than +'\n'?

@JonathanFrech Yeah, thanks :)

05AB1E, 256 245 241 bytes
“x´ž€†0ƒé€Š Jackíš.xâì0íàltx¨Ù0ÄŠxÜ³0—Äx€„ssed0‹·x«Ëed0Ð§€Ž0 crumpledÑÛx·—ed0ì›€Ÿ€‡lornx¢¢0…Ž€Ÿ»ättered€ƒ€„rnx woke0¡Ë€Ÿ shaven€ƒ shornx¤°0ÝËoster€Š crowed€†0›árnxÊÂed€„0ÃË€Êwing€ËÃÅx0î€€ƒ0 hound€ƒ0ÑÛ“0’ €€’:'x¡'€Š™ìηʒRćD'€€kG¦}„€Œ€ˆªì¸ì»¶«,

Try it online!

Java 8, 666 649 640 636 625 bytes
$->{String y="This is",x="That ",w="orn\n",A="~house that Jack built.\n\n",B="~malt\n",D="~rat\n",F="~cat\n",H="~dog\n",J="~cow with~crumpled h"+w,L="~maiden all forl"+w,N="~man all tattered and t"+w,P="~judge all shaven and sh"+w,R="~rooster that crowed in~m"+w,T="~farmer sowing his c"+w,r=y+A,a[]={B,"lay in"+A,D,"ate"+B,F,"killed"+D,H,"worried"+F,J,"tossed"+H,L,"milked"+J,N,"kissed"+L,P,"married"+N,R,"woke"+P,T,"kept"+R,"~horse and~hound and~h"+w,"belonged to"+T};for(int i:"123425642786429:8642;<:8642=><:8642?@><:8642AB@><:8642CDB@><:8642EFDB@><:8642".getBytes())r+=(i%2>0?y:x)+a[i-49];return r.replace("~"," the ");}

Well..
NOTE: It's just like every other (non-encoded) answer incorrect for the verses about the maiden and man, where the lines of the dog and cat, as well as rat and malt are on a single line, instead of new-line separated.. I'm just too lazy to fix it, since it's closed as a dupe anyway.
Explanation:
Try it online.
$->{                  // Method with empty unused parameter and String return-type
  String y="This is", //  Temp-String "This is"
         x="That ",   //  Temp-String "That "
         w="orn\n",   //  Temp-String "orn\n"
                      //  " the ...\n" temp Strings:
  A="~house that Jack built.\n\n",
  B="~malt\n",
  D="~rat\n",
  F="~cat\n",
  H="~dog\n",
  J="~cow with~crumpled h"+w,
  L="~maiden all forl"+w,
  N="~man all tattered and t"+w,
  P="~judge all shaven and sh"+w,
  R="~rooster that crowed in~m"+w,
  T="~farmer sowing his c"+w,
  r=y+A,              //  Result-String, starting at:
                      //   This is the house that Jack built.\n\n
  a[]={               //  String-array, containing:
    B,                //   the malt\n
    "lay in"+A,       //   lay in the house that Jack built.\n\n
    D,                //   the rat\n
    "ate"+B,          //   ate the malt\n
    F,                //   the cat\n
    "killed"+D,       //   killed the rat\n
    H,                //   the dog\n
    "worried"+F,      //   worried the cat\n
    J,                //   the cow with the crumpled horn\n
    "tossed"+H,       //   tossed the dog\n
    L,                //   the maiden all forlorn\n
    "milked"+J,       //   milked the cow with the crumpled horn\n
    N,                //   the man all tattered and torn\n
    "kissed"+L,       //   kissed the maiden all farlorn\
    P,                //   the judge all shaven and shorn\n
    "married"+N,      //   married the man all tattered and torn\n
    R,                //   the rooster that crowed in the morn\n
    "woke"+P,         //   woke the judge all shaven and shorn\n
    T,                //   the farmer sowing his corn\n
    "kept"+R,         //   kept the rooster that crowed in the morn\n
    "~horse and~hound and~h"+w,
                      //   the horse and the hound and the horn\n
    "belonged to"+T}; //   belonged to the farmer sowing his corn\n
  for(int i:"123425642786429:8642;<:8642=><:8642?@><:8642AB@><:8642CDB@><:8642EFDB@><:8642".getBytes())
                      //  Loop over the bytes of the String above
    r+=(i%2>0?y       //   If `i` is odd: Append "This is "
        :x)           //   Else (`i` is even): Append "That " instead
       +a[i-49];      //   And also append the string from the array at index `i-49`
  return r.replace("~"," the ");}
                      //  Return the result, with all "~" replaced with " the "

If you use a diff tool (such as DiffChecker), you'll see several differences between your text and the original one.

@OlivierGrégoire Yeah, noticed that as well after I saw user202729's comment. Since it's closed as dupe, and every answer except for the two encoded ones have the same issue I just ignored it for now..

There's also a "belonged the" that should be "belonged to the".

@OlivierGrégoire Fixed.

Retina, 322 308 bytes

0horse20hound20h3belonged to0farmer sowing his c3kept0rooster that crowed in0m3woke0judge all shaven2 sh3married0man all tattered2 t3kissed0maiden all forl3milked0cow with0crumpled h3tossed0dog1worried0cat1killed0rat1ate0malt1lay in0house that Jack built.
3
orn1
1
¶That
L^$`0.*
This is$&$'¶
2
 and
0
 the

Try it online!

@AJFaraday Sorry, it must have broken during golfing

@AJFaraday Thanks, I see the problem now, should be fixed.

Jstx, 293 bytes
↕Δ"▌ÇÇÉÇ◙ëÇÇÇÇÇÇÇ¬ÜëºΣ£•☼▀2.─&│E╧=▒√║∙►ybⁿ☯╫QΔ(☺¥ë2↕☯k`u3xò6┘[↨:ªh°♀êΔ╘δ‼δ@W$A⌐ΘsΘ↕║∞Φ⌡▌b⌐M±uc9╖#→δ¡9¼▀Ö╪♠¬╢æ¥.≈ëzTH♂⌡Q┐àÿî♥τ◄≈«‼û4_≤╛─◄→♂U┌█2Üüà╓ªçδ»Aÿ▄╜9■q▒iö♦4s⌐±[╗:áxÿº•╗.é÷╫╙σG¼╧[]┌>5←◙÷ö╣↨>≤±Bøz→▲√┐•♫◘╚←<∟⌡₧o?PB|Å╩↔Θ↨Γ»H☻▒╩z`6_ⁿ#∩⌂ε╦╬SNΦ9└├↓¥n-d┴≤α┐'F+~<,+╒↑│░»|M☯½☺E}°]dπ☻Ñö°á╠üdhP▼{Bßë

Try it online!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Return closest to zero
Description :
You are given a string of numbers (positive and negative but not decimals) along with the number of entries like so.
Like so
8
'1 2 5 0 7 -9 12 -8'
Task :
Your job is to return the number closest to zero be it +ve or -ve. Your input will be separated by spaces only. You are free to return the answer in any way you like namely :

 A string
     A float (Why would you though)
     An array (One digit array I guess)
     A number (preferred)

Since this is code golf the answer with the shortest will be the winner. I guess?
Have fun.
code snippets :

console.log(`6
'1 -2 -8 4 3 5'`) // should return 1
console.log(`3
'-12 -5 -137'`) // should return -3
console.log(`8
'1 2 5 0 7 -9 12 -8'`) // should return 0

Note :
This is my first attempt at this. Apologies in advance for any mistakes, do tell so I can correct them. Thanks

1). updated my bad.

2). Ok updated. I was not aware that is is a duplicate.

Can we take the input as a list of numbers?

Welcome to the site! As user202729 has mentioned, this is almost an exact duplicate of this existing challenge. Be sure to use the Sandbox to check if your challenges are duplicates and to catch any errors before posting. Also, make sure to read Things to avoid when writing challenges to see what to avoid and what to include.

Also -- we have a sandbox for proposed challenges.

Sorry , just joined I was not aware of this. I will be sure to check before posting. Thanks for helping.

Python 2, 41 bytes
lambda n:min(map(abs,map(int,n.split())))

Try it online!

oh i didn't see that this question had been closed while I was writing my answer....

Thanks for the answer , but since this already had an answer it was closed.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Sequence splitting
Given an arbitrary sequence consisting of 1 and A
split this sequence up so that A is at the beginning of each sub sequence.
Sequences without a leading A and Sequences without 1 before the next A will be self contained.
Example
Input
111A11A1111111A1A1AA

should result in
111
A11
A1111111
A1
A1
A
A

Above already contains the edge cases
* sequence of 1 without prior A
* subsequent A's without 1 between
Update
Open to all programming languages (functional / non-functional)

Welcome to PPCG. You'd need to add a winning criterion such as code-golf. Also, it might be a dupe -- but I didn't check yet. For future submissions, you may want to use our sandbox before posting to the main site.

You should add more examples with some edge cases, as currently looks like a simple s/A/\nA/g task.

Thanks for your input. Iam not sure if my question is best placed here now. I was really looking into results in scala and other similar programming languages. I will take this elsewhere i guess.

If you update your question to fit our criteria, I'll happily post answers in Scala and Standard ML!

s/question/challenge/

(... yes, we don't do Q&A here, sorry)

"This question appears to be off-topic. The users who voted to close gave this specific reason:
'Questions without an objective primary winning criterion...'
If this question can be reworded to fit the rules in the help center, please edit the question."

Can we use a instead of A?

I've voted to close this challenge as "without a winning criteria" because you need to explicitly state the winning criteria.

I think this challenge is too simple.

Is a trailing newline allowed?

Please add an example that starts with an A. The behavior of the current answers is very inconsistent for everything except the one example you provide.

APL (Dyalog Unicode), 12 bytes
Anonymous tacit function. Returns a list of strings.
⊢⊂⍨1⊣@1=∘'A'

Try it online! (↑ is just to display the list of strings as separate lines.)
=∘'A' Boolean list (1s and 0s) indicating As
1⊣@1 replace with a 1 at the first position
⊢⊂⍨ begin partitions of the argument at each 1 in that

Hmm, I never programmed in APL, so perhaps it's not possible/shorter, but isn't there a simple replace every A with \nA?

@KevinCruijssen Then it is time to begin! Dyalog APL has PCRE built-in, but it isn't so simple. See the discussion beginning here.

10 bytes: '.1*'⎕s'&'

@ngn There's no way you're telling me that that is a derivative of mine. Go ahead and post it or the equivalent 5-byter QuadS.

@Adám Of course, it isn't. Unfortunately it's on hold now and I can't post the 5-byter.

@ngn Not on hold any more.

@Adám really? I still see it as on hold

@ngn Oh, it was off hold, now on hold again. ⍨

Retina, 6 5 bytes
1 byte saved thanks to @Neil!
L`.1*

Try it online!
Explanation
L`      Configure the stage as "list", so that it outputs all matchings
.1*     Regex to be matched: any character followed by zero or more "1"

Retina, 6 bytes
\BA
¶A

Try it online!
An alternative to Luis's solution. Finds all A which are preceded by another character and inserts a linefeed in front of them.

Haskell, 54 37 bytes
import Data.List
groupBy(\_ x->x<'A')

Try it online!

05AB1E, 10 8 bytes
'A"
A".:

Try it online!
Can probably be golfed further, but first submission and attempt at this.
Explanation
'A"           Push A character, Push string "(new line) A"
 A"           close string
.:            Replace all. Replace "A" with "(new line) A" in input

If you want code to match output like in original post then 11 bytes
I'A" A".:#»

-2 bytes thanks to Soaku!

Welcome to PPCG!

You can save 2 bytes (never used 05AB1E, but works)

You can save another

Befunge-98 (FBBI), 14 12 bytes
-2 bytes thanks to Jo King
#@~:d%5/ja,,

Try it online!
#@            # skips @
  ~           push a byte of input
   :          duplicate it
    d%        modulo 13, 'A':0, '1':10
      5/      divided by 5, 'A':0, '1':2
        j     jump this number of blocks, skips the next two instructions for '1'
         a,   push 10 to the stack and output as a byte (\n)
           ,  output the byte of input

If there is no input left, ~ reflects the pointer and @ terminates the program

Alternatively, #@~:9%j  a,, and #@~:5%ja,  ,. The last one could be 10 bytes, but it outputs an extra null byte

Jelly, 5 bytes
1 The slooooow but shorter method which gets all ways* to partition the list and then finds the maximal as measured by its transpose:
ŒṖZÞṪ

Try it online!
* that is all 2length(input)-1 ways!
2 The speedy method using the "partition at truthy indices" atom (the five byte =”Aœṗ fails for inputs starting with A):
Ḋ=”A0;œṗ

Try the speedy one!

Japt, 6 bytes
d'A_iR

Try it online!
Explanation:
d'A_iR
d       // Replace:
 'A     //   "A" with
   _iR  //   newline + "A"

Alternative 6-byte solution
r'A"
A

Try it online!
These would be 5-byte solutions if we could take a instead of A.

Standard ML (MLton), 40 bytes
String.translate(fn#"A"=>"\nA"|x=>str x)

Try it online!
Unfortunate that String.translate is so long...

Perl 5 -p, 8 bytes
s/A/
A/g

Try it online!

JavaScript (Node.js), 27 bytes
z=>z.split(/(?=A)/).join`
`

Try it online!

Explanation :
z =>                   // lambda function taking z as input
    z.split(           // convert z to an array by splitting at
            /(?=A)/    // all `A's`
    ).                 // end split
        join`\n`       // join all via new line

Alternate :
If printing an array is okay, then :
JavaScript (Node.js), 19 bytes
z=>z.split(/(?=A)/)

Try it online!

JavaScript (Node.js), 22 bytes
s=>s.match(/A1*|^1+/g)

Try it online!

Not sure if this would pass a different test case, but the regex /[A1]1*/g is reduces this by one byte (and passes the provided test case).

Why not .1*??

Scala, 20 bytes
_.replace("A","\nA")

Try it online!
(Not sure if putting the types in the header is allowed, I'll change it if not.)

JavaScript (Node.js), 20 19 bytes
s=>s.split(/(?=A)/)

Try it online!
Thanks Pandacoder for 1 byte

It doesn't say outputting a list of lines is acceptable, so this answer is currently invalid.

@cairdcoinheringaahing Requirement says "split this sequence up", not "split with newline"

JavaScript, 26 23 bytes
-3 bytes thanks to caird coinheringaahing
s=>s.replace(/A/g,`
A`)

Try it online!

Pyth, 8 7 bytes
:Q\A"
A

Try it here
Explanation
:Q\A"\nA
:Q         Replace in the input...
  \A       ... every instance of "A"...
    "\nA   ... with a newline followed by "A".

Python 2, 29 bytes
lambda I:I.replace('A','\nA')

Try it online!

Batch, 44 bytes
@set/pa=
@for %%a in (%a:A= A%)do @echo %%a

Takes input on STDIN.

Java (JDK 10), 19 bytes
s->s.split("(?=A)")

Try it online!

Pepe, 59 bytes
rEEeREeEeeeeeEREeeeeeeeeREEreeEREEeeREEreEeREEeEReEREEeeRee

Try it online!
That was hard... Outputs with leading newline.
rEEe           # r - Get input               Take the string

REeEeeeeeE     # R - Push A                  A - splitter
REeeeeeeee     # R - Push \0                 \0 - end
REE            # R - Create label A          label A: Next + newline

 reeE          # Output newline              Output newline

 REEee         # R - Forward
 REE           # R - Create label \0         label \0: Next without newline

 reEe          # r - Output                  Output the current letter and pop it

 REEeE         # R - Rewind
 ReE           # r pointer == A, goto A      Output newline, next letter

 REEee         # R - Forward                 Else
 Ree           # r pointer != \0, goto \0    If stack isn't empty, next letter

Haskell, 29 bytes
f s=do c<-s;['\n'|c>'1']++[c]

Try it online!

R, 26 bytes
Not a whole lot to explain with this one.
cat(gsub("A","\nA",scan()))

sed, 9 bytes
s/A/\nA/g

Try it online!

sed is a language on its own, so you only have to count the bytes in the actual sed command.

As nothing else is matched beside group 1, you may skip the capturing: s/1*/&\n/g.

With Awk you could benefit of defaults: by default gsub() operates on $0; the default action is print; by default print also operates on $0: gsub("A","\nA")1.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Conway's game of life
Description :
Given an array of strings representing a grid of cells
With the key :
0 = 'dead cell'
1 = 'live cell'

write a function that returns the next iteration following the rules of Conway's Game of Life .
Rules

Any live cell with fewer than two live neighbours dies, as if caused by underpopulation.
Any live cell with two or three live neighbours lives on to the next generation.
Any live cell with more than three live neighbours dies, as if by overpopulation.
Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.

Examples :

["111" , "110" , "100"] //input
["101" , "001" , "110"] // output
/**
  * There will be other tests so no hardcoding.
**/

This is code golf shortest code wins. Good luck and have fun

Comments are not for extended discussion; this conversation has been moved to chat.

Jelly,  40  38 bytes
z0j@€0,0µ⁺ṡ3Z€ṡ€3S€€⁺Ḥ
L€ḣ@"Ç+e€€7,9,6

A monadic link accepting and returning lists of lists of ones and zeros
Try it online!
How?
Cells will be alive in the next generation if:

it was alive in a neighbourhood (including itself) of three or four
it was dead in a neighbourhood of exactly three

Therefore if double the neighbourhood plus "was alive" is seven or nine (case 1) or six (case 2) then it will be alive next generation.
(For all other possible cases the sum of double the neighbourhood and "was alive" are other integers in the range [0,19])

z0j@€0,0µ⁺ṡ3Z€ṡ€3S€€⁺Ḥ - Link 1, neighbourhood counts * 2: board
        µ⁺             - perform this monadic link twice:
z0                     -   transpose with filler zero
     0,0               -   list [0,0]
  j@€                  -   join €ach with swapped arguments (surround each with zeros)
          ṡ3           - all overlapping sub-lists of length three (i.e. lists of rows)
            Z€         - transpose €ach
              ṡ€3      - all overlapping sub-lists of €ach of length three (i.e. 3x3 neighbourhoods)
                 S€€⁺  - repeated sum for €ach for €ach (neighbourhood sum)
                     Ḥ - double
                       - Note: the result includes counts of off-board areas filling right

L€ḣ@"Ç+e€€7,9,6 - Main link: board
     Ç          - call the last link (1) as a monad (get 2 * neighbourhood counts)
L€              - length of each row of the input board
  ḣ@"           - zip with head to index with swapped arguments
                - (i.e trim the neighbourhood counts to the shape of the input board)
      +         - add (vectorises) (i.e. 2 * neighbourhood count + was alive)
          7,9,6 - list = [7,9,6]
       e€€      - exists in? for €ach for €ach

Cool. Upvoted it. Although I have no clue how jelly works.

I like the explanation. Thanks maybe I'll learn something.

There is a good tutorial and wiki at the github page linked by "Jelly" in the header :)

Cool. Thanks I will be sure to look into it. Thanks to everyone for helping me out.


text:
Is the program 32 or 64 bits?
Assignment is simple to explain: write the shortest code you need to determine whether an executable binary program supplied as parameter is 32 or 64 bits.
If there is a different kind of bitness, you can also do for it, but is not mandatory.
What I really don't want is telling me you support other bitnesses and after I get 32 or 64 as a result.
Valid outputs for 32:
32
32bit
32bits
32 bit
32 bits

The same pattern for 64.
No accepted answer.

@Pandacoder: Choose one platform and indicate for what one you have done it.

@fəˈnɛtɪk: I suggest something like a bitness program.exe command line, where bitness is a call to the code you wrote, and program.exe is the binary you just want to evaluate how many bits it is. BTW, great nick!

Jelly on Linux, 6 bytes
5ịO×32

Try it online!
Usage note: the question says "write the shortest code you need to determine whether an executable binary program supplied as parameter", and that's exactly what you need to do here; supply the entire executable binary program as the parameter. Not its filename, the program itself. (I hope you have a fairly understanding shell!) The TIO link uses the shortest known ELF program Linux will run, by Brian Raiter as the example program.
Linux uses ELF as its executable format. It turns out that the fifth byte of an ELF program specifies the processor bitwidth it's designed for: 0x01 for a 32-bit program, or 0x02 for a 64-bit program. So all we have to do is extract the byte in question (5ị), convert it from a character to a number (O), and multiply by 32 (×32).
There's probably a language that can use this exact algorithm more succinctly, but I wanted to post this answer to demonstrate the algorithm.

Why is this a community wiki?

@dylnan: a) in the hope that people will stop worrying about reputation (including me!), b) in the hope that people will edit the answer if they see something wrong with it (this has actually happened on at least one answer I've submitted, and I was in favour of it). I dislike the whole ownership/scorekeeping/gamification attitude that Stack Exchange is trying to push, so community wiki is something of a perfect fit. (Also, I used to just delete my account every answer, but chat suggested that community wiki might work better, and it means I keep the ability to edit my answers.)

I responded by upvoting your comment then realized you might not want that... Anyway, I see what you mean and respect that.

Bash + common Linux utils, 18

2 byte saved thanks to @Dennis.

file -|cut -c17-18

The input program piped in.
Try it online!

MATL (Linux), 5 bytes
5)32*

Implicitly input entire program. Get fifth byte, multiply by 32.
Try it online!

As a bonus, here's an answer that works on most (but not all) Windows executables, for 20 bytes:
t'PE'Xf1)4+)100=Q32*

Try it online!
Find the PE signature (which would fail if there's an unusual DOS stub containing PE) and see if it is followed by d (100) two bytes later (which corresponds to x64, and thus would fail for other 64 bit architectures)

Would this fail if there is PE somewhere else (e.g., in the DOS stub)?

The Windows version works for most 64-bit processors supported by the PE format, but not all. E.g. for Itanium the machine type is 0x0200, not 0x0264.

@PeterTaylor I only tested it on some local files. I suppose I can remove the Windows part

@user202729 It would indeed.

GolfScript for ELF (5 bytes)
4=32*

CJam for ELF (6 bytes)
q4=32*

or
q4=5m<

This is why I commented in the sandbox that "challenge" was not an appropriate description of this task.

Windows Bash (with core util?), test PE32 vs PE32+; 37 bytes
file $1|grep -q 2+&&echo 64||echo 32

This is a bash script works on Windows Bash (bash in Ubuntu Linux Subsystem on Windows 10), which tell given *.exe file 32 bit or 64 bit.
Not yet tested on other platform, maybe it work.

How can I claim this language?

Jelly (Windows), 24 bytes
ƈO
Ç64Ð¡Uḣ4%⁹ḅ⁹_38Ç¹¡×32

Hexdump:
00000000: 9c4f 7f0e 3634 0f00 55ed 3425 89d4 895f  .O..64..U.4%..._
00000010: 3338 0e81 0011 3332                      38....32

I have no idea why %⁹ is necessary, but it is.
Takes the whole executable from STDIN. Take from command line argument would definitely shorter but there is a (small) upper bound on the size.
Yes, Windows PE executable format is hard to parse. Also Jelly hates non-constant nilad.

ƈO

Link 1: Return the next byte value from stdin.
Ç64Ð¡Uḣ4%⁹ḅ⁹

Read the 4-byte e_lfanew at offset 60 and convert it to an integer.
_38Ç¹¡

Take the byte at (e_lfanew - 38) positions later which is the higher byte of the signature in the PE optional header, described here at the "optional header magic number" part.
×32

Multiply by 32. Get 32 for 32-bit executables (PE32) and 64 for PE32+.

"there is a (small) upper bound on the size" if you mean there's an upper bound on TIO, then no, TIO does not define Jelly and you can probably still use it locally with large command-line arguments.

@EriktheOutgolfer (at least on my Linux machine) sometimes I get a "command line too long" error for somewhat-large size.

@EriktheOutgolfer All Linux machines place several limits on command invocation. The maximum length of a single command-line argument is a compile-time constant of the kernel, usually 32 times the page size, which is 4 KiB for x86_64. It should be possible to raise it by recompiling the kernel though, so it's ultimately arbitrary.

@Dennis So it seems like it would still be valid for this solution to take via command-line arguments.

Haskell, 36 35 bytes
fmap((32*).fromEnum.(!!4)).readFile

For the ELF format
Try it online!

Ruby -n, 23 bytes
p IO.read($_)[4].ord*32

Try it online!
Linux ELF version. TIO link tests the interpreter on itself.

Bash, 36 bytes
cp $1 x
file x|egrep -o '32|64'|uniq

Try 64 bits online!
Try 32 bits online!

This may break if the executable's name contains the number 32 or 64. Try it online!

@dennis fixed it

It would be much shorter to just read the ELF from STDIN.


text:
Build a golfing language with me
A lot of PPCG users helped with the creation of this challenge, both in chat and the Sandbox, specifically Martin Ender, AdmBorkBork, Emigna and user202729
Our community has found it necessary to create a set of languages designed specifically for golfing, "golfing languages" as we call them. Such languages have evolved from the once brilliant, now clunky GolfScript to the sleek concise languages such as Jelly and Husk. As we can see, these languages are continually getting shorter and shorter for a set of tasks. So, as the obvious experts around here regarding golfing languages, we should design a language together to beat every other language that dares to compete. Introducing Bugle!

Bugle: From the acronym BuGoL: Built Golfing Language.

How this challenge will work
In case you didn't get what I'm alluding to in the introduction, this challenge is an answer-chaining challenge where we each contribute something to the interpreter of a new golfing language, improving its ability to compete on PPCG with each answer.
I will post the first answer consisting of the basis of the language spec/interpreter, and all other answers will continue from that. New submissions will provide the following things:

A change to the language's spec
An up-to-date interpreter, meeting exactly what is laid out in the changes
The language's updated score (more details in a bit)

You may change the spec in one of three ways:

You may add a single command
You may add two new commands
You may edit the behaviour of one existing command

Regarding the new interpreter, you must use the latest version, written in Python. It does not have to be golfed. Every previously added command must be testable with the latest interpreter, as well as the newest command(s) (the one you add). You must also not use offensive language at any point when updating the interpreter, such as in comments or string literals etc.
The added command(s) may do anything you wish. The only requirements are:

It doesn't produce offensive output
It isn't the same as another command
It doesn't prevent one of the sample challenges from being completed

Aside from these, it can be as specific or as general as you want. It can also be any character you want. If you aren't sure if your addition constitutes a 'new command', feel free to ask in the comments.
The language's score
You may have noticed that you have to include the language's score in all new submissions. Its score is what prevents this challenge going forever, and is defined as follows:

The current score is the sum of the byte counts it takes for the language to complete the below 20 tasks

For each of the tasks, Standard I/O rules apply, as do the standard loopholes.
The 20 tasks:

"Hello, World!" – Output the string Hello, World!
1, 2, Fizz, 4, Buzz – Output each integer from 1 to 100 (inclusive) on a separate line, with multiples of 3 being replaced by Fizz, multiples of 5 being replaced by Buzz and multiples of both by FizzBuzz
Produce the number 2014 without any numbers in your source code – Output the number 2014 without using any of the characters 0123456789 in the source code, without accessing external variables or random seeds
Obfuscated Hello World – Output the string Hello, World!, without using any of characters in at least two of the following sets: hlwd, eor01 and 27 (case-insensitive)
Sing Happy Birthday to your favourite programming language – In a language of your choice, output the following:
Happy Birthday to You
Happy Birthday to You
Happy Birthday Dear [the name of your favourite programming language]
Happy Birthday to You

We're no strangers to code golf, you know the rules, and so do I – Output the full lyrics of "Never Gonna Give You Up"
Output the sign – Given a number, print -1 if it is negative, 0 if it is 0 or 1 if it is positive
Collatz Conjecture (OEIS A006577) – Starting from an integer, divide it by 2 if it's even, or multiply it by 3 and add 1 if it's odd, and repeat the process until you reach 1. The output should be the number of iterations it takes you to reach 1.
An Array of Challenges #1: Alternating Arrays – Given an array of integers, check whether all even-indexed items are equal, and all odd-indexed items are equal, and output a truthy or falsy value accordingly
Am I an insignificant array? – Given an array of integers, check whether the absolute differences between consecutive elements are all smaller than or equal to 1, and output a truthy or falsy value accordingly
Is this number a prime? – Given a positive integer, write a full program to check whether it is prime, and output a truthy or falsy value accordingly
I'm a palindrome. Are you? – Given a string, check whether it is palindrome, while your program / function is palindrome too, and output two distinct and consistent values accordingly
Sum the numbers on standard in - Take a series of numbers in from STDIN and output their sum.
Find the Factorial - Given an integer n, output the product of all integers between 1 and n inclusive.
Shortest code to produce infinite output - Without any input, produce infinite output, that will, theoretically, never stop outputting.
Bake a slice of Pi - Output this exact text:

()()()()()()
|\3.1415926|
|:\53589793|
\::\2384626|
 \::\433832|
  \::\79502|
   \::\8841|
    \::\971|
     \::\69|
      \::\3|
       \__\|

Find the smallest number that doesn't divide N - Given a positive integer N, output the smallest positive integer that does not divide N.
Is this even or odd? - Given an integer N, output its parity as truthy/falsy values.
Output with the same length as the code - Write the shortest code whose output has the same length as the code, where the output is not the same as the code.
Golf you a quine for great good! - Write the shortest quine in your language.

In order to be valid, a new submission must have golfed submissions for at least 2 of the problems, by at least 1 byte for each. You may increase the lengths of other submissions, but the total score must decrease by at least 2 per answer. Also, please consider including a link to the updated programs. The updated solutions must not work when run with a previous version of the interpreter.
How to get cookies
I have a list of 5 challenges, which aren't compulsory to attempt, and have no bearing on your score, but are simply additional challenges to test if Bugle is capable enough. Feel free to include a solution to any number of these in your answer:

Create a Self interpreter
Create a payload capable quine
Covfefify a string
Hyperprogramming: N+N, N×N, N^N all in one
"KNOT" or "NOT"?

Descriptions not included as they aren't required for everyone to be able to compete in the challenge.
How to win
Once the minimum score (we believe to be 16, although any attempts to golf that down are much welcomed) has been reached, obviously the chain has ended as solutions cannot get a better score. Once 16 has been reached, the challenge stays alive for 1 month afterwards, to give anyone a chance to golf the solutions any more. After this month has passed, the challenge is over.
Once the challenge is over, I will be migrating the interpreter onto a GitHub repository, and going through the usual machinations of releasing a stable language. You may also begin to post solutions to challenges on PPCG at this time, using the said language, but please try not to flood the front page with answers. Instead, spread them out over a period of time.
Formatting
In order to make information easier to find in your answer, please format it as follows:
# [N]. [Score]

[New command + description]

[Interpreter/link to interpreter]

[Link to programs]

Where [N] is your answer number (1 for the first, 2 for the second etc.)
Rules

You must wait 3 hours between posting answers
You may not post twice in a row, unless no answer has been posted for 10 days (exactly 240 hours)
You may not remove previous commands.
Your interpreter doesn't have to be golfed, and its byte count is completely irrelevant here.
If someone suggests a golf to the programs while your answer is the latest, you must edit in the golfs, and update your score.

You may also do this when your answer is in the middle of the chain, so long as your score doesn't become lower than any later answers.

Please refrain from answering any existing PPCG challenges using this language, at least until the challenge is over
The interpreter is written in Python 3, and should continue that way throughout the entire chain. Changing the  language is forbidden.
Again, in order to be valid, a new submission must have golfed submissions for at least 2 of the problems, by at least 1 byte for each.

Let's get started!

Sandbox

Might as well ask: Anyone like to explain the downvote? I'd value any and all feedback you'd like to give.

Wouldn't the minimum score be 20 (1 built-in per challenge) ?

@Kaldo We're not quite sure. The quine has to be two bytes minimum, but if the empty program outputs Hello, World!, then it's 19 bytes. But if the behaviour of the empty program changes, dependant on the input, it may be able to be reduced

And it'll probably get soft-locked before it gets to the possible minimum

Should challenge 3 and 4 be measured in bytes or characters?

Can we post Bugle answers to other challenges on this site?

@user202729 They should all be measured in bytes when encoded in the Bugle encoding.

I meant "scored". For example if H is banned ĭ should be banned too as it's [BEL]H.

@WeijunZhou "Please refrain from answering any existing PPCG challenges using this language, at least until the challenge is over"

@user202729 If a challenge, such as "Output 2014" bans certain characters, than it's those characters that are banned, not characters which have the same ordinal in their encoding.

Can we strictly only add new commands, or can we also introduce new syntax constructs and the like? (note how I say "new", these obviously wouldn't upturn the language's existing syntax)

@LyricLy Syntax constructs (such as for loops) are allowed, and encouraged to be added

3. Score: 2938 2583 2532 (-51)
The new interpreter is here.
Mainly for the purposes of golfing the quine and making output easier, I've added the ability to duplicate the stack/deque and also to output the entire model in rendered text form instead of as integers.
Solutions
1. "Hello, World!" - 17 bytes (-3)
#"Hello, World!"a

5. Sing Happy Birthday to your favourite programming language - 95 bytes (-3)
#"Happy Birthday to You
Happy Birthday to You
Happy Birthday Dear Bugle
Happy Birthday to You"a

6. We're no strangers to code golf, you know the rules, and so do I - 1884 bytes (-3)
#"We're no strangers to love
You know the rules and so do I
A full commitment's what I'm thinking of
You wouldn't get this from any other guy
I just wanna tell you how I'm feeling
Gotta make you understand

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

We've known each other for so long
Your heart's been aching but
You're too shy to say it
Inside we both know what's been going on
We know the game and we're gonna play it
And if you ask me how I'm feeling
Don't tell me you're too blind to see

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

(Ooh, give you up)
(Ooh, give you up)
(Ooh)
Never gonna give, never gonna give
(Give you up)
(Ooh)
Never gonna give, never gonna give
(Give you up)

We've know each other for so long
Your heart's been aching but
You're too shy to say it
Inside we both know what's been going on
We know the game and we're gonna play it

I just wanna tell you how I'm feeling
Gotta make you understand

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you"a

16. Bake a slice of Pi - 149 bytes (-3)
#"()()()()()()
|\3.1415926|
|:\53589793|
\::\2384626|
 \::\433832|
  \::\79502|
   \::\8841|
    \::\971|
     \::\69|
      \::\3|
       \__\|"a

20. Golf you a quine for great good! - 23 bytes (-39)
$"R34RdR36Ra"R34RdR36Ra

Added Language Features

a

All: Print the entire model as text, e.g. #"Hello, World!"a prints Hello, World!

d

Stack/Deque: Push the stack on top of itself.

I have an idea for an extension to the language. If all the code consists of no known instructions, print the code. This might make cheater quines easy.

2. Score: 2938 2583
The modified interpreter is here on TIO.
String literal is the most obvious addition to the language, mainly to combat kolmogorov-complexity challenges.
Solutions
1. "Hello, World!" - 20 bytes (-28)
#"Hello, World!"[o>]

Any kolmogorov-complexity challenge can be completed using the structure #"<string>"[o>] which outputs the given string until the 0 after the string is reached.
2. 1, 2, Fizz, 4, Buzz - 419 64 bytes (-1332)
$1[1+1s:3s%{}"zziF"oooos;0s]:5s%{}"zzuB"oooos;0s]s{:O}]10o:100-]

Thanks to @user202729 for awesome golfing on this.
3. Produce the number 2014 without any numbers in your source code - 9 bytes (-4)
#"ĒĎ"[O>]

Uses the two chars 20 and 14 in Bugle codepoints.
4. Obfuscated Hello World - 19 bytes (-153)
#"Ifmmp!Xpsme"[-o>]

Meets rules #1 (no HLWDhlwd) and #3 (no 27).
5. Sing Happy Birthday to your favourite programming language - 98 bytes (-230)
#"Happy Birthday to You
Happy Birthday to You
Happy Birthday Dear Bugle
Happy Birthday to You"[o>]

6. We're no strangers to code golf, you know the rules, and so do I - 1887 bytes (-5006)
#"We're no strangers to love
You know the rules and so do I
A full commitment's what I'm thinking of
You wouldn't get this from any other guy
I just wanna tell you how I'm feeling
Gotta make you understand

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

We've known each other for so long
Your heart's been aching but
You're too shy to say it
Inside we both know what's been going on
We know the game and we're gonna play it
And if you ask me how I'm feeling
Don't tell me you're too blind to see

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

(Ooh, give you up)
(Ooh, give you up)
(Ooh)
Never gonna give, never gonna give
(Give you up)
(Ooh)
Never gonna give, never gonna give
(Give you up)

We've know each other for so long
Your heart's been aching but
You're too shy to say it
Inside we both know what's been going on
We know the game and we're gonna play it

I just wanna tell you how I'm feeling
Gotta make you understand

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you

Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you"[o>]

16. Bake a slice of Pi - 149 bytes (-290)
#"()()()()()()
|\3.1415926|
|:\53589793|
\::\2384626|
 \::\433832|
  \::\79502|
   \::\8841|
    \::\971|
     \::\69|
      \::\3|
       \__\|"[o>]

20. Golf you a quine for great good! - 62 bytes (-12)
#"[>]<o-o+[<]>[o>]<-o;<[<]>[o>]#"[>]<o-o+[<]>[o>]<-o;<[<]>[o>]

Added Language Feature

"...": String literal.

Stack / Deque: Push the Bugle codepoints of each char to the top / front of the stack / deque.
Tape / Grid: Write the Bugle codepoints of each char onto the tape / grid to the right, starting from the current cell. Does not move the cursor.
\n is handled just like other chars.
There is no escaped character for now, so you can't write " (34) to the memory using this command. It's not too big of a problem, at least for now, since all of the kolmogorov-complexity challenges listed here don't have " in the output.

Any further golfing is always welcome, especially for "Never gonna give you up" and the quine. Specifically, the above quine is very first nontrivial quine I ever made, so I strongly believe someone can come up with a shorter one.

There are the kinds of additions I hope everyone else does, rather than just adding builtins for the specific challenges. +1

@user202729 It's probably me who introduced the bug; thanks for fixing it and the FizzBuzz solution.

1. Score: 9638
The base interpreter can be found here, and the submissions here. It's rather long, so I've included it on GitHub, rather than take up most of the post.
Solutions
All of these solutions are the Unicode programs, run with the -u command line flag, but the scores are counted as though encoded with Bugle's code page.
1. "Hello, World!" - 48 bytes
$72o101o108o108o111o44o32o87o111o114o108o100o33o

Simply push then output the character code of each character in the string.
2. 1, 2, Fizz, 4, Buzz - 1396 bytes
$49o10o50o10o70o105o122o122o10o52o10o66o117o122o122o10o70o105o122o122o10o55o10o56o10o70o105o122o122o10o66o117o122o122o10o49o49o10o70o105o122o122o10o49o51o10o49o52o10o70o105o122o122o66o117o122o122o10o49o54o10o49o55o10o70o105o122o122o10o49o57o10o66o117o122o122o10o70o105o122o122o10o50o50o10o50o51o10o70o105o122o122o10o66o117o122o122o10o50o54o10o70o105o122o122o10o50o56o10o50o57o10o70o105o122o122o66o117o122o122o10o51o49o10o51o50o10o70o105o122o122o10o51o52o10o66o117o122o122o10o70o105o122o122o10o51o55o10o51o56o10o70o105o122o122o10o66o117o122o122o10o52o49o10o70o105o122o122o10o52o51o10o52o52o10o70o105o122o122o66o117o122o122o10o52o54o10o52o55o10o70o105o122o122o10o52o57o10o66o117o122o122o10o70o105o122o122o10o53o50o10o53o51o10o70o105o122o122o10o66o117o122o122o10o53o54o10o70o105o122o122o10o53o56o10o53o57o10o70o105o122o122o66o117o122o122o10o54o49o10o54o50o10o70o105o122o122o10o54o52o10o66o117o122o122o10o70o105o122o122o10o54o55o10o54o56o10o70o105o122o122o10o66o117o122o122o10o55o49o10o70o105o122o122o10o55o51o10o55o52o10o70o105o122o122o66o117o122o122o10o55o54o10o55o55o10o70o105o122o122o10o55o57o10o66o117o122o122o10o70o105o122o122o10o56o50o10o56o51o10o70o105o122o122o10o66o117o122o122o10o56o54o10o70o105o122o122o10o56o56o10o56o57o10o70o105o122o122o66o117o122o122o10o57o49o10o57o50o10o70o105o122o122o10o57o52o10o66o117o122o122o10o70o105o122o122o10o57o55o10o57o56o10o70o105o122o122o10o66o117o122o122o

Same technique as the Hello, World! example
3. Produce the number 2014 without any numbers in your source code - 13 bytes
#++O--O+O+++O

# uses the tape, + increments the cell, O outputs as an integer and - decrements
4. Obfuscated Hello World - 172 bytes
#+++++++++[>++++++++<-]>o<++++[>+++++++<-]>+o+++++++oo+++o>++++[>+++++++++++<-]>o------------o[-]++++++++[>+++++++++++<-]>-o<<<o+++o------o--------o[-]+++[>+++++++++++<-]>o

Uses its inherent similarity to brainfuck. Meets rules #1 and #3
5. Sing Happy Birthday to your favourite programming language - 328 bytes
$72o97o112o112o121o32o66o105o114o116o104o100o97o121o32o116o111o32o89o111o117o10o72o97o112o112o121o32o66o105o114o116o104o100o97o121o32o116o111o32o89o111o117o10o72o97o112o112o121o32o66o105o114o116o104o100o97o121o32o68o101o97o114o32o66o117o103o108o101o10o72o97o112o112o121o32o66o105o114o116o104o100o97o121o32o116o111o32o89o111o117o

All the kolmogorov-complexity challenges have this kind of structure, at the moment.
6. We're no strangers to code golf, you know the rules, and so do I - 6893 bytes
$[encoded data, 6892 characters]

7. Output the sign - 18 bytes
$?:Zs0=0s-s:1s-++O

Checks if the input is greater than zero, less than zero (changed to yield -1 instead of 1) and equal to zero, before taking their sum.
8. Collatz Conjecture (OEIS A006577) - 36 bytes
#$?:1-[:2s%{3×1+}2s÷]:1s-₀+₁]₀O

This performs the looping on the stack, but switches over to the tape to increment the count each iteration.
9. An Array of Challenges #1: Alternating Arrays - 35 bytes
#?>?>+>?[[<+<<->>>-]+<[-<<]>[>]?]<O

This is a slight modification of Mitch Schwartz's answer to the existing challenge, go upvote that!
10. Am I an insignificant array? - 46 bytes
$1 0-?…1[s:sr-:Z1s-2×1+×1s-Z1-L2s-×]1+Z1-O

All credit goes to Emigna for making this
11. Is this number a prime? - 31 bytes
$?:1s-:[:1s-:];L1s[×L2s-]:×%O

Uses Wilson's Theorem and calculates (n-1)!² % n
12. I'm a palindrome. Are you? - 13 bytes
$?:R=:O:=R:?$

The first half of the program, up to O, sets the stack up as [x, x] where x is either True or False. O pops the top value and outputs it. The rest of the program just makes sure that no errors are produced. Luckily, when ? encounters the end of the file, it just pushes '' (the empty string).
13. Sum the numbers on standard in - 19 bytes
$?:[?:];L0s[+L1s-]O

This can be split into two parts: ?:[?:]; and L0s[+L1s-]. The first part collects all input to the stack. The second part pushes the sum of the top two elements, while the length is greater than 1.
14. Find the Factorial - 25 bytes
$?:[:1s-:];L1s-Z[×L1s-]O

This has a similar structure to the sum program, but instead of pushing ltiple inputs, the [:1s-:]; pushes the range from 1 .. n to the stack, and [×L1s-] takes the product.
15. Shortest code to produce infinite output - 5 bytes
#+[O]

Use a while loop, with the 1 continually under the pointer. Outputs 1 forever.
16. Bake a slice of Pi - 439 bytes
$40o41o40o41o40o41o40o41o40o41o40o41o10o124o92o51o46o49o52o49o53o57o50o54o124o10o124o58o92o53o51o53o56o57o55o57o51o124o10o92o58o58o92o50o51o56o52o54o50o54o124o10o32o92o58o58o92o52o51o51o56o51o50o124o10o32o32o92o58o58o92o55o57o53o48o50o124o10o32o32o32o92o58o58o92o56o56o52o49o124o10o32o32o32o32o92o58o58o92o57o55o49o124o10o32o32o32o32o32o92o58o58o92o54o57o124o10o32o32o32o32o32o32o92o58o58o92o51o124o10o32o32o32o32o32o32o32o92o95o95o92o124o

17. Find the smallest number that doesn't divide N
$?:1:[:rs%0=s1+srr:Rs]1s-O

This uses trial division, terminating when the result of the modulo does not equal 0.
18. Is this even or odd? - 5 bytes
$2?%O

Simple modulo by 2
19. Output with the same length as the code - 16 bytes
$16:[32+:o33s-:]

Outputs the first 16 printable ASCII characters in reverse: 0/.-,+*)('&%$#"!
20. Golf you a quine for great good!
$1[93, 76, 111, 91, 49, 59, 104, 48, 79, 49, 111, 54, 51, 0]
36o1O0h;1[oL]

Credit goes to user202729 for making this

Language specification
Calling
bugle.py currently takes a series of flags, then the file name / code to be executed. As of yet, it has 4 command line flags:

-f/--file specifies that code is to be read from a file
-c/--cmd/--cmdline specifies that code is supplied via the command line.
-c and -f cannot be used in the same call
-u/--unicode tells the interpreter to read the code with the Unicode encoding. The default is to use Bugle's encoding below
-l/--length outputs the length of the file, in bytes, to STDERR after execution

The following call was used to test the above submissions
$ python bugle.py -f -u [file]

Code page
Bugle uses 512 characters in its code page. The 0xFF character is not to be used for a command, as its used to indicate that the next hex value in to index into the second half of the code page. The characters used are:
ÀÁÂÄÆÃÅĀĄ\t\nĆČÇĎÐ
ÈÉÊËĒĖĚĘÌÍÎÏĪĮĹĽ
 !"#$%&'()*+,-./
0123456789:;<=>?
@ABCDEFGHIJKLMNO
PQRSTUVWXYZ[\]^_
`abcdefghijklmno
pqrstuvwxyz{|}~¶
ŁŃŇÑŊÒÓÔÖŒÕØŌŔŘŚ
ŠŤŦÙÚÛÜŮŪŴÝŶŸŹŽŻ
àáâäæãåāąćčçďðèé
êëēėěęìíîïīįĺľłń
ňñŋòóôöœøōõŕřßśš
ťŧùúûüůūŵýŷÿźžż◊
ΑΆΒΓΔΕΈΖΗΉΘΙΊΚΛΜ
ΝΞΟΌΠΡΣΤΥΎΦΧΨΩΏ
αάβγδεέζηήθιίΐκλ
μνξοόπσςτυύΰφχψω
ώǴḰḾṔẂǵḱḿṕẃḂḞĠḢṀ
ȮṖṠṪẊḃḟġḣṁȯṗṡṫẋ§
ĂĞĬŎŬĴăğĭŏŭĵªº‹›
ƁƇƊƑƓƘⱮƝƤƬƲȤɓƈɗƒ
ɠɦƙɱɲƥʠɼʂƭʋȥ©®ıȷ
ЉЊЕРТЗУИОПШАСДФГ
ХЈКЛЧЋЅЏЦВБНМЂЖљ
њертзуиопшасдфгх
јклчћѕџцвбнмђжÞþ
†∂∆≈≠√∈∉∌∋∩∪¬∧∨⊕
¤₽¥£¢€₩‰¿¡⁇⁈‼⁉‽⸘
…°•”“„’‘≤«·»≥ᴇ∞¦
×⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾
÷₀₁₂₃₄₅₆₇₈₉₊₋₌₍₎
Or see it in table format. Note that \t and \n represent tab and newline respectively. Also take note that the 16th line ends with an unprintable character: , and may not be displayed on all browsers.
Memory
The interpreter currently has 5 memory models built in to it. Each memory model requires a character to tell the interpreter to begin using that model:

Stack ($): a standard stack, which supports values being pushed, popped etc.
Infinite tape (#): A tape, à la brainfuck, which initially is only 0s.
Infinite grid (G): A 2d grid, infinite in both directions, containing only 0s
Deque (D): A deque, as implemented by the collections module.
Register (S): A single value, which can be used to store one value.

The grid also has a single value saved in its pointer that can be written to, or write to cells.
In addition, tape and grid sizes and wrapping behaviour can be modified, by using a different invoke command. These different commands take a given number of values from the current memory model as customisation parameters:

Tape (À): Takes two values - size (int) and wrapping (bool)
Tape (Á): Takes one value - size (int). Wraps at end of the tape
Tape (Â): Takes one value - size (int). Doesn't wrap at the end
Grid (Ǵ): Takes 4 values - x size (int), y size (int), x wrap (bool) and y wrap (bool)

The memory type being used can change during a program by the use of ₀₁₂₃₄₅₆₇₈₉, which access the 0-indexed nth used memory type (₀ is the first, ₁ is the second etc.), but, currently, values cannot be swapped between different memory types.
Branching
So far Bugle has two branching commands, both terminated with a ] character:

While ([): brainfuck-style while loops. These pop a value from the stack/deque if being used, or access the cell under the pointer in tape/grid.
Example: #?[-O] counts from the input down to 0
If/else ({ and }). Single execution while loops. If the value popped is false, then the if clause is skipped, going to the else clause, separated by }. They behave the same way as while loops regarding memory access.
Example: {0}1] is a logical NOT gate

Builtin functions
Runs of digits are interpreted as integers, and are just pushed/written to the current memory model as is.
Obviously, I've equipped Bugle with some basic builtin functions, as few as I could, to allow others to add more as the chain progresses. The base commands are as follows:

+

Stack/Deque: Add the top two values
Tape/Grid: Increment the current cell

-

Stack/Deque: Subtract the top two values
Tape/Grid: Decrement the current cell

%

Stack/Deque: Modulo the top two values

:

Stack/Deque: Duplicate the top value

;

Stack/Deque: Pop the top value
Tape/Grid: Zero the current cell

<

Tape/Grid: Move left one cell

=

Stack: Are the top two values equal?
Grid: Move down one cell

>

Tape/Grid: Move right one cell

?

Stack/Deque: Evaluate a line of input
Tape/Grid: Take a character of input

L

Stack/Deque: Push the length of the stack/deque

O

All: Output the current value

R

Stack: Reverse the top element if possible, else reverse the stack

Z

Stack: Top element is positive?

^

Grid: Move up one cell

h

All: Print the full memory model

o

All: Print the current value as a character

r

Stack: Rotate the top 3 values
Deque: Rotate the deque n times, where n is the top value

s

Stack/Deque: Swap the top two values

…

Stack: Splat the top value

×

Stack: Multiply the top two values
Grid: Write the pointer value to the current cell

÷

Stack: Divide the top two values
Grid: Write the current cell to the pointer value


text:
Arithmetic Cycle
Input:
Integer n which is >=0 or >=1 (f(0) is optional)
Output:
The n'th number in the sequence below, OR the sequence up to and including the n'th number.
Sequence:
(0),1,-1,-3,0,5,-1,-7,0,9,-1,-11,0,13,-1,-15,0,17,-1,-19,0,21,-1,-23,0,25,-1,-27,0,29,-1,-31,0,33,-1,-35,0,37,-1,-39,0,41,-1,-43,0,45,-1,-47,0,49,-1,-51,0,53,-1,-55,0,57,-1,-59,0,61,-1,-63,0,65,-1,-67,0,69,-1,-71,0,73,-1,-75,0,77,-1,-79,0,81,-1,-83,0,85,-1,-87,0,89,-1,-91,0,93,-1,-95,0,97,-1,-99

How is this sequence build?
f(n=0) = 0 (optional)
f(n=1) = f(0) + n or f(n=1) = 1
f(n=2) = f(1) - n
f(n=3) = f(2) * n
f(n=4) = f(3) / n
f(n=5) = f(4) + n
etc.
Or in pseudo-code:
function f(integer n){
  Integer result = 0
  Integer i = 1
  Loop as long as i is smaller than or equal to n
  {
    if i modulo-4 is 1:
      result = result plus i
    if i modulo-4 is 2 instead:
      result = result minus i
    if i modulo-4 is 3 instead:
      result = result multiplied with i
    if i modulo-4 is 0 instead:
      result = result integer/floor-divided with i
    i = i plus 1
  }
  return result
}

But as you may have noted there are two patterns in the sequence:
0, ,-1,  ,0, ,-1,  ,0, ,-1,   ,0,  ,-1,   ,0,  ,-1,   ,...
 ,1,  ,-3, ,5,  ,-7, ,9,  ,-11, ,13,  ,-15, ,17,  ,-19,...

so any other approaches resulting in the same sequence are of course completely fine as well.
Challenge rules:

0-indexed and 1-indexed inputs will result in the same result (which is why the f(0) is optional for 0-indexed inputs if you want to include it).
You are allowed to output the n'th number of this sequence. Or the entire sequence up and including the n'th number. (So f(5) can result in either 5 or 0,1,-1,-3,0,5.)

If you choose to output the sequence up to and including the n'th number, output format is flexible. Can be a list/array, comma/space/new-line delimited string or printed to STDOUT, etc.

The divide (/) is integer/floor division, which rounds towards 0 (not towards negative infinity as is the case in some languages).

General rules:

This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
Standard rules apply for your answer, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
Default Loopholes are forbidden.
If possible, please add a link with a test for your code.
Also, please add an explanation if necessary.

Additional test cases above n=100:
Input     Output

1000      0
100000    0
123       -123
1234      -1
12345     12345
123456    0

I could not find this on http://oeis.org/ so you might want to submit it there. It's an interesting sequence, I'm surprised no one has registered it.

@pipe it seems pretty arbitrary

JavaScript (ES6), 19 bytes
n=>[0,n,-1,-n][n&3]

Try it online!
Proof
Let's assume that we have the following relations for some n multiple of 4. These relations are trivially verified for the first terms of the sequence.
f(n)   = 0
f(n+1) = n+1
f(n+2) = -1
f(n+3) = -(n+3)

And let N = n + 4. Then, by definition:
f(N)   = f(n+4) = f(n+3) // (n+4) = -(n+3) // (n+4) = 0
f(N+1) = f(n+5) = f(n+4) + (n+5)  = 0 + (n+5)       = N+1
f(N+2) = f(n+6) = f(n+5) - (n+6)  = (n+5) - (n+6)   = -1
f(N+3) = f(n+7) = f(n+6) * (n+7)  = -1 * (n+7)      = -(N+3)

Which, by mathematical induction, proves that the relations hold for any N multiple of 4.

Because most of the answers are ports of this solution, I want to add that I have verified it's provable.

I have an alternative proof.

Ah, nuts, got distracted by work while working on something very similar. +1

Out of curiosity, is there a reason to prefer "n&3" over "n%4"?

@IanF1 I guess this is just a low-level programming habit (computing a bitwise AND in assembly is easier and faster than computing a modulo). But it doesn't make much sense here and I was actually half tempted to change it to n%4 afterwards so that it works with numbers larger than 32-bit.

05AB1E, 8 bytes
Outputs the nth number
ÎD(®s)sè

Try it online!
05AB1E, 14 bytes
Outputs a list of numbers upto N using the patterns in the sequence
ÅÉāÉ·<*āÉ<‚øí˜

Try it online!
Explanation
Example using N=7
ÅÉ               # List of odd numbers upto N
                 # STACK: [1,3,5,7]
  ā              # Enumerate 1-based
   É             # is odd?
                 # STACK: [1,3,5,7],[1,0,1,0]
    ·<           # double and decrement
                 # STACK: [1,3,5,7],[1,-1,1,-1]
      *          # multiply
                 # STACK: [1,-3,5,-7]
       āÉ<       # enumerate, isOdd, decrement
                 # STACK: [1,-3,5,-7],[0,-1,0,-1]
          ‚ø     # zip
                 # STACK: [[1, 0], [-3, -1], [5, 0], [-7, -1]]
            í    # reverse each
             ˜   # flatten
                 # RESULT: [0, 1, -1, -3, 0, 5, -1, -7]

Python 2, 25 bytes
Port of Arnauld's answer:
lambda n:[0,n,-1,-n][n%4]

Try it online!

Naive solutions:
Python 3, 50 49 bytes
lambda n:n and eval('int(f(n-1)%sn)'%'/+-*'[n%4])

Try it online!

Python 2, 78 77 76 58 57 53 52 bytes
lambda n:n and eval('int(1.*f(n-1)%sn)'%'/+-*'[n%4])

Try it online!
Used a bunch of bytes on int, because python floor divides, and not towards 0, as in the question.

J, 12 bytes
Port of Arnauld's answer:
4&|{0,],_1,-

Try it online!
J, 28 bytes
Naive solution:
{(0 _1$~]),@,.(_1^i.)*1+2*i.

Outputs the nth number
Try it online!

TIS -n 2 1, 123 bytes
Outputs the nth number for 0 <= n <= 999. (The upper limit is due to language limitations).
@0
MOV UP ACC
MOV ACC ANY
L:SUB 4
JGZ L
JEZ L
ADD 5
JRO -5
@1
MOV UP ACC
JRO UP
SUB ACC
JRO 3
MOV 1 ACC
NEG
MOV ACC ANY
HCF

Try it online!

TIS -n 2 1, 124 bytes
Outputs the nth number for 0 <= n <= 999. (The upper limit is due to language limitations). Multiple n may be provided, separated by whitespace.
@0
MOV UP ACC
MOV ACC ANY
L:SUB 4
JGZ L
JEZ L
ADD 5
MOV ACC ANY
@1
MOV UP ACC
JRO UP
SUB ACC
JRO 3
MOV 1 ACC
NEG
MOV ACC ANY

Try it online!

TIS -n 3 1, 192 bytes
Outputs the values for 0..n for 0 <= n <= 999. (The upper limit is due to language limitations).
@0
MOV UP ACC
ADD 1
MOV ACC ANY
JRO -1
@1
SUB UP
JLZ C
HCF
C:ADD UP
MOV ACC ANY
ADD 1
SWP
ADD 1
MOV ACC ANY
SUB 4
JEZ W
ADD 4
W:SWP
@2
MOV UP ACC
JRO UP
SUB ACC
JRO 3
MOV 1 ACC
NEG
MOV ACC ANY

Try it online!

All use numeric I/O (the -n flag). The first two solutions use two compute nodes, one positioned above the other. The third has a stack of three nodes.
For the first two solutions, the upper node reads input, sends the original number on, then repeatedly subtracts 4 until we go negative, then adds 5 to index for our jump table. This is equivalent to (n % 4) + 1.
The third solution split this task across two nodes; the top one just repeats the limit until the end of time, and the middle node counts up in parallel the index (compared against that limit) and the modulo like above.
The lower node of all three solutions is the same; it has a jump table, and this is where the magic happens. We store the original number in ACC, then JRO (probably Jump Relative Offset) forward by 1, 2, 3, or 4, depending on what the node above says.
Working backward:

4 will a) NEGate ACC, and b) move ACC down for output.
3 will put 1 into ACC, then perform steps 4a and 4b.
2 will jump directly to step 4b.
1 will SUBtract ACC off itself (effectively zeroing ACC), then do step 2, which jumps to 4b.

C (gcc), 62 bytes
f(n,k){k=~-n;n=n?n%4?k%4?n-2&3?f(k)*n:f(k)-n:f(k)+n:f(k)/n:0;}

Try it online!

You could exactly halve your byte-count (31 bytes) by creating a port of OlivierGrégoire's Java answer: f(n){n=n%2>0?n*(2-n%4):n%4/-2;} I would add it as a second answer though, because I like your recursive approach as well. :)

@KevinCruijssen I did see their Java 10 solution and noticed its brevity, though I did not want to simply copy their solution, as the two language's arithmetic syntaxes are too similar.

Jelly, 8 bytes
,-;N;0⁸ị

Try it online!
-1 thanks to Lynn.
What others are doing (port of Arnauld's solution), supports 0.
Jelly, 17 bytes
A:A}××Ṡ¥
R_×ç+4ƭ/

Try it online!
0 is not supported.

Java (JDK 10), 25 bytes
n->n%2>0?n*(2-n%4):n%4/-2

Try it online!
Shorter than the contender algorithm in other languages with 28 bytes
n->new int[]{0,n,-1,-n}[n%4]

Try it online!

APL (Dyalog Classic), 22 12 bytes
Massive 10 bytes saved due to Erik the Outgolfer's remarks. Thank you!
4∘|⊃0,⊢,¯1,-

Try it online!
Outputs the nth number
I don't know APL, I just tried to make my J port of Arnauld's solution work in Dyalog APL.

Nice attempt! A few remarks: 1) You can replace (0,⍵,¯1,-⍵) with (0⍵¯1,-⍵). 2) You can remove the 1+ by assuming that the ⎕IO system variable is assigned to 0 (yes, that's allowed). 3) We usually don't count the f← part when submitting functions. 4) You can use the ⊃ function instead of [] indexing. All those together form this: ⎕IO←0 (don't count this) {(4|⍵)⊃0⍵¯1,-⍵}

@Erik the Outgolfer Thank you!

More advanced golfing based on this approach: 4∘|⊃0,⊢,¯1,-.

@Erik the Outgolfer - Yes, indeed! I think your 4∘|⊃0,⊢,¯1,-  is exactly what my J solution 4&|{0,],_1,- would look like in APL. Thanks again!

Actually, J is an APL variant, although more distant than other more APL-like ones like Dyalog and NARS2000.

Retina, 46 bytes
.+
*
r`(____)*$
_$.=
____
-
___.*
-1
__

_.*
0

Try it online! Explanation:
.+
*

Convert to unary.
r`(____)*$
_$.=

Convert back to decimal, but leave n%4+1 underlines.
____
-

In the case that that's 4, then the result is -n.
___.*
-1

Case 3: -1
__

Case 2: n
_.*
0

Case 1: 0

Haskell, 50 bytes
f 0=0
f n=([(+),(-),(*),quot]!!mod(n-1)4)(f(n-1))n

Try it online!
Arnauld's solution, ported to Haskell is 23 bytes:
z n=cycle[0,n,-1,-n]!!n

Cubix, 20 19 bytes
Iun:^>s1ns:u@Ota3s0

Try it online!
Ports the same approach to cubix.
On a cube:
    I u
    n :
^ > s 1 n s : u
@ O t a 3 s 0 .
    . .
    . .

The first bit ^Iu:n>s1ns:u0s builds the stack and then 3at copies the appropriate item to TOS, then O outputs and @ ends the program.

Whitespace, 84 83 bytes
[S S S N
_Push_0][S N
S _Duplicate_0][T   T   S _Store][S S S T   S N
_Push_2][S S T  T   N
_Push_-1][T T   S _Store][S S S T   N
_Push_1][S N
S _Duplicate_1][T   N
T   T   _Read_STDIN_as_integer][S S S T T   N
_Push_3][S S S T    N
_Push_1][T  T   T   ][S S T T   N
_Push_-1][T S S N
_Multiply][T    T   S _Store][T T   T   _Retrieve_input][S S S T    S S N
_Push_4][T  S T T   _Modulo][T  T   T   _Retrieve_result][T N
S T _Print_as_integer]

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.
Try it online (with raw spaces, tabs and new-lines only).
Port of @Arnauld's JavaScript answer.
Explanation (example input n=7):
Command   Explanation         Stack        Heap                  STDIN   STDOUT   STDERR

SSSN      Push 0              [0]
SNS       Duplicate top (0)   [0,0]
TTS       Store               []           {0:0}
SSSTSN    Push 2              [2]          {0:0}
SSTTN     Push -1             [2,-1]       {0:0}
TTS       Store               []           {0:0,2:-1}
SSSTN     Push 1              [1]          {0:0,2:-1}
SNS       Duplicate top (1)   [1,1]        {0:0,2:-1}
TNTT      Read STDIN as nr    [1]          {0:0,1:7,2:-1}        7
SSSTTN    Push 3              [1,3]        {0:0,1:7,2:-1}
SSSTN     Push 1              [1,3,1]      {0:0,1:7,2:-1}
TTT       Retrieve input      [1,3,7]      {0:0,1:7,2:-1}
SSTTN     Push -1             [1,3,7,-1]   {0:0,1:7,2:-1}
TSSN      Multiply (-1*7)     [1,3,-7]     {0:0,1:7,2:-1}
TTS       Store               [1]          {0:0,1:7,2:-1,3:-7}
TTT       Retrieve input      [7]          {0:0,1:7,2:-1,3:-7}
SSSTSSN   Push 4              [7,4]        {0:0,1:7,2:-1,3:-7}
TSST      Modulo (7%4)        [3]          {0:0,1:7,2:-1,3:-7}
TTT       Retrieve            [-7]         {0:0,1:7,2:-1,3:-7}
TNST      Print as integer    []           {0:0,1:7,2:-1,3:-7}           -7
                                                                                error

Stops with error: Exit not defined.


text:
XOR reduction bools
Description :
Given a string of space separated binary digits or space separated booleans or an array of binary digits or array of booleans . Your job is to find the xor of each until you end up with one answer either 0 or 1. The inputs will always be valid and will only be either 0 or 1.
Example :
1 0 0 1 0 --> 0
1 0 1 1 1 0 0 1 0 0 0 0 --> 1

This is code golf so shortest code will win. Good luck.

Your job is to find the xor of each until you end up with one answer either 0 or 1 Can you clarify a bit more what that means?

given a string find the xor of first two then the xor of next two and so on. keep at it till you end with one digit.

Use the Sandbox! That's 3 challenges in a row that you propose that have troubles. Go to the sandbox, expose your challenge and update it based on community feedback. Then only post it on this site.

Hi, I've downvoted this question because it is very trivial. Most answers are going to be one or two variations, with very little room for creative golfing.

Can the list of booleans be empty ?

@Adám : done . Ton : that is up to you

JavaScript (ES6), 18 bytes
s=>eval(s.join`^`)

Try it online!

Java (JDK 10), 12 bytes
s->s.sum()%2

Try it online!
If a string is really required, then 20 bytes:
s->s.chars().sum()%2

Try it online!
The "string" answer uses the fact that a space is codepoint 32, which mod 2 returns 0.

Wow. I feel kinda stupid now ;)

Python 2, 17 bytes
lambda a:sum(a)%2

Try it online!

This answer is not valid. given a string of space separated binary digits. and not an array

Also may I ask why did you downvote the question ? is there something wrong

@MuhammadSalman ... I guess TFeld didn't downvote it. How do you know that?

You can rollback to your original answer, the spec has been changed to allow arrays

@cairdcoinheringaahing, Thanks :)

05AB1E, 2 bytes
OÉ

Try it online.
Explanation:

O: Take the sum of the input-array
É: Evaluates sum % 2 == 1, returning 1 if the sum is odd, 0 otherwise

3 bytes:
A leading Ç can be added if the space-delimited string input was still mandatory, instead of a boolean-array.
Try it online.

Ç: Push the ASCII values of all characters, and implicitly convert it to a list. 0 1 would become [48, 32, 49] in that case. The O (sum) and É (is odd?) will still act the same.

JavaScript (Node.js), 23 bytes
a=>a.reduce((c,d)=>c^d)

Try it online!

Welcome to PPCG!

MATL, 3 2 bytes
so

Input can be a numeric vector of the form [1 0 0 1 0], or a string such as '10010' (thanks to @Giuseppe for noticing!).
Try it online!
Explanation
The code is so simple that it hardly needs an explanation, but here it goes.
s    % Implicit input: numeric vector (or string). Sum of the numbers. (For string
     % input, the ASCII codes are summed. Character '1' is odd, '0' is even, and
     % space is even too, so the parity is the same as with numeric vector input)
o    % Parity. Implicit display

heck, this would work on a string, since space=32 and doesn't change the parity.

Oh, good idea! My previous version used U to convert from string to numeric vector, but indeed it can be removed

SNOBOL4 (CSNOBOL4), 44 bytes
A	X =X + INPUT	:S(A)
	OUTPUT =REMDR(X,2)
END

Try it online!

Perl 5 -p040, 10 bytes
Assumes the input list can't be empty
$\^=0+$_}{

Try it online!

Java 10, 41 bytes
b->{var r=1<0;for(var c:b)r^=c;return r;}

The variable r is initially set to false, since we are XORing b[0] with it. Try it online here.

Jelly, 5 3 2 bytes
^/

Try it online!
-2 bytes thanks to user202729!

OSḂ also works.

@user202729 So it does! Thanks!

Add++, 8 bytes
L~,€Os2%

Try it online!

(Traditional) APL, 3 or 4 bytes
TIO, courtesy Adám
≠/⍎⎕

Analysis:
⎕ - Accept input.
⍎ - "unquote" it (if it's a quoted string, this will convert it to a numeric vector. If it's already a numeric vector, this is effectively a null op)
/ - reduction - apply the operator to the left to each successive item in the vector to the right
≠ - "not equal" - when applied strictly to boolean arguments, this is functionally identical to XOR (which is not implemented as a separate operator in APL)
If it may be assumed that the input will be a numeric vector instead of a quoted string, then the 'unquote' can be removed, saving one byte:
≠/⎕

HI. Can you kindly provide a TIO link. Thanks

I've never been able to get quad-input in APL to work at TIO, that's why I didn't do so here.

Ah I see. Oh well. Btw you can update your answer, it will be more easier now

Input is essentially the APL session (except that ⎕ and default output happens in Output and ⍞ output happens in Debug). For convenience, you can define your workspace in Header, Code and Footer, but only Code is counted into the char/byte count: Try it online!

@Adám - Thank you. I'm not sure why I was never able to get it to work.

Befunge-98 (FBBI), 8 bytes
#.~+2%#@

Try it online!

You can use #q~+2% instead of #.~+2%#@ and output via exit code to save 2 bytes. (In TIO you need to expand the debug tab if you want to see the exit code)

Japt, 2 bytes
r^

Try it
Does exactly what it says on the tin, reduce the array by XORing.

Cubix, 11 bytes
i?+<^<@Oa1<

Try it online!
It's been a while, so it feels good to write a Cubix answer!

Whispers v2, 38 bytes
> Input
> 2
>> ∑1
>> 3%2
>> Output 4

Try it online!
I feel like 3 answers is too many, but I wanted to get Whispers out again. I'm still working on an XOR approach

C (gcc), 41 39 38 bytes
Saved a few bytes with inspiration from ceilingcat.
Saved another byte thanks to Jonathan Frech
r;f(char*s){for(r=0;*s;)r^=*s++;r&=1;}

Try it online!

Can s=r&1 not be r&=1?

Ruby, 42 bytes
->s{s.split(' ').reduce(0){|a,b|a^b.to_i}}

Try it online!

APL (Dyalog Unicode), 2 bytesSBCS
Tacit prefix function.
≠/

Try it online!
/ is reduction and ≠ is XOR because XOR only gives 1 if its arguments are unequal.

Julia 0.6, 12 bytes
b->⊻(b...)

Try it online!
⊻ is the xor symbol, and b... distributes an array as individual elements before sending it to the xor function (since xor needs multiple arguments passed separately, not a single array argument).
A bit more interestingly, a version that accepts space separated (/comma-separated/unseparated) boolean values as a string, and returns the xor result :
Julia 0.6, 22 bytes
b->sum(Int.([b...]))%2

Try it online!