text:
Test if two numbers are equal
Challenge

Input two integers.

Integer I/O must be decimal.

If the integers are equal, output a truthy value.
Otherwise, output a falsy value.

Clarifications

You will never receive non-integer inputs.
You will never receive an input that is outside the bounds [-2³¹, 2³¹).

Rules

Standard loopholes are disallowed.
This is code-golf. Shortest answer wins, but will not be selected.

I can't tell you the reason for the other downvotes, but mine is because I firmly believe that trivial questions like this are bad for the site. -- Peter Taylor

A reminder: as this is ridiculously trivial in most languages, please vote according to difficulty. Just because it's a 1 byte builtin in some golfing languages doesn't mean those answers are better than well-golfed longer solutions in, say, Brain-Flak.

Can the truthy value be 0 and falsy value be anything but 0?

Depends. Is that how if sees it in your language?

@All downvoters: If you're downvoting this then you have to downvote the add two numbers challenge and the multiply two numbers challenge too because they're "too trivial".

@CalculatorFeline But not all trivial challenges are the same level of trivial. In most languages without built-ins to add two numbers or check for equality (especially those without numerical input), I would expect the equality check to be easier to implement. Example: my BF equality check is 45 bytes, while the shortest BF addition program is 224 bytes.

A signed integer on 32-bits maximum value is 2³¹-1 (but maybe it's on purpose you wrote 2³¹)

"Decimal" is not a correct way to describe a numeric type like C int.  It only makes sense when talking about string representation of numbers, or with decimal floating point (https://en.wikipedia.org/wiki/Decimal_floating_point) where the bit pattern representing the number uses base 10, not base 2.  Or maybe a BCD integer.  IIRC, IBM's POWER architecture has decimal float support, which is useful for some financial stuff, but most architectures only have IEEE binary32 / binary64.  But anyway, a numeric type is probably best described as a binary integer, or simply "an integer".

@PeterCordes That line is meant to say that integers are input in decimal.

So are you trying to rule out a C function like int f(int a, int b){ return a==b;}?  Because int in C represents numbers with base-2 bit-patterns, not decimal.  (The details are implementation-defined, but there are enough requirements in the C standard that I don't think an implementation could legally choose a BCD (binary-coded-decimal) representation.  At least not for unsigned char.)  I think you're getting mixed up by source code that looks like int a = 1234;.  That uses a decimal representation in the source, but not in the program.  int a=0x4d2; is identical to 1234.

i.e. by the time a function gets its numeric args from the caller, they're just binary integers.  Everything about how they were written in the source is lost, in most programming languages.

@PeterCordes I mostly mean I/O. Integers can be represented in many ways internally. I'll update the question.

Brachylog, 0 bytes

Try it online!
One number from STDIN and one from command-line arguments.

The right tool for the job.

brainfuck, 45 49 41 37 34 bytes
,[>,]>+<<[<]>[<,[->-<]>[>]>],[>]>.

Try it online!
Takes the two integers separated by a single null byte. Null bytes are falsy in BF and everything else is truthy, so this prints a single 0x01 byte for truthy and a single 0x00 for falsy.
This is my first time golfing in BF, so feel free to give me suggestions...
Explanation
,[>,]       Read in everything from STDIN until the null byte is reached
>+          Move one space to the right and increment; this will be a flag telling us
            the numbers are still equal
<<[<]>      Move back to the beginning of the input
[           For each character in the input:
  <,          Move to the left and input a character
  [->-<]      Subtract this char from the char at the same spot in the original number
  >[>]        If this is not zero (there is a difference between the two characters)
                move to the hole before the flag
  >           Move one character to the right
              If we're in the hole before the flag this moves us onto the flag;
              the loop runs once more and deposits us two spots to the right
]           Endwhile
            When the while loop finishes we will be one spot to the left of the flag
            or already to the right if the program found a difference between the numbers
            However: we will still be just to the left of the flag for cases like 24 vs 245
,           So we input another byte (the next digit of the second number or 0x00)
[>]         and move past the flag if it's non-zero
>.          Move right (onto the flag or past the flag) and output

Here's a TIO link to see be able to the output of the program in hexbytes: Try it online!.

@Cowsquack doesn’t work anymore

///, 9 bytes
//f///t/f

Try it online!
Prints a t if they are equal, otherwise prints f.
Since there is no way to take input in ///, it is hard-coded.
/NUM1/f//NUM2/t/f

Explanation:
With example inputs of 12 and 121213. (Should return false.)

Input. /12/f//121213/t/f
Replace other occurrences of the first number with f. /ff13/t/f
Replace the modified new number with a t. Since the modified string is not f, , f stays the same. f.
Output. f.

With example inputs of 501 and 501. (Should return true.)

Input. /501/f//501/t/f
Replace other occurrences of the first number with f. /f/t/f
Replace the modified new number with a t. Since the modified string is f,f changes to t.
Output. t.

Credit to @user202729 for coming up with the better approach!

That's... actually really clever, it took me a minute to figure out how it works.

@ETHproductions Thanks! :)

Could you tell the rest of us?

@cairdcoinheringaahing Done, is that good?

i agree with @ETHproductions. That's brilliant

@cairdcoinheringaahing Thank you. :)

12 == 1212? https://tio.run/##K85JLM5ILf7/X9/QSF8fSBgapemX6Kf9/w8A I suggest https://tio.run/##K85JLM5ILf7/X9/QSD9NH0gC6RL9tP//AQ instead.

@Mendeleev No it doesn't. The previous version did, but user202729 found a fix, which was edited in.

yup, 16 bytes
I struggled to find an esolang where this was non-trivial (and that was not already covered). I present to you, this:
**-{0~-}0~-|0~-#

Try it online!
This works as follows:
**-{0~-}0~-|0~-#
**                  take two inputs on the stack
  -                 subtract them
   {0~-}0~-         this is "absolute value":
   {   }              while TOS is > 0
    0~-               this is negate:
    0                   push 0                 [TOS, 0]
     ~                  swap                   [0, TOS]
      -                 subtract               [-TOS]
                    thus, this negates positive numbers
        0~-         negate again to get a positive number
                    this maps equal numbers to `0` and unequal numbers to their
                    absolute differences
           |        take ln(TOS). This gives `-Infinity` for equal numbers, and
                    some value >= 0 for other numbers.
            0~-     negate. this gives Infinity for equal numbers, and a number <= 0
                    for unequal numbers
               #    output as number

Now, {...} is yup's loop and is the closest thing to a condition. It repeats the inside so long as the TOS is positive and defined. Thus, any negative or 0 value is falsey, and any positive value is truthy. Infinity is truthy, being greater than 0.

Brain-Flak, 26 bytes
Straight from the wiki.
Please don't upvote trivial answers.
([{}]{})((){[()](<{}>)}{})

Try it online!

There is a shorter version that "results in 0 if they are equal some other number otherwise" ({}[{}])

Verbosity, 507 503 bytes
Include<MetaFunctions>
Include<Output>
Include<Input>
Include<Integer>
Include<Boolean>
Input:DefineVariable<i; 0>
Output:DefineVariable<o; 0>
Boolean:DefineVariable<c; 0>
Integer:DefineVariable<a; Input:ReadEvaluatedLineFromInput<i>>
Integer:DefineVariable<b; Input:ReadEvaluatedLineFromInput<i>>
Boolean:DefineVariable<r; Boolean:ArgumentsAreEqual<c; a; b>>
Boolean:DefineVariable<q; Boolean:LogicalNot<c; r>>
Output:DisplayAsText<o; q>
DefineMain<> [
MetaFunctions:ExecuteScript<MetaFunctions@FILE>
]

Try it online!
Saved 4 bytes thanks to Mr. Xcoder
Haha, no-one shall lose to Verbosity! Outputs with a Boolean<> wrapper around the result. The Boolean:LogicalNot is required due to an ongoing bug with booleans.
The ungolfed version:
Include<MetaFunctions>
Include<Output>
Include<Input>
Include<Integer>
Include<Boolean>

Input:DefineVariable<STDIN; 0>
Output:DefineVariable<STDOUT; 0>
Boolean:DefineVariable<constant; 0>

Integer:DefineVariable<FirstInput; Input:ReadEvaluatedLineFromInput<STDIN>>
Integer:DefineVariable<SecondInput; Input:ReadEvaluatedLineFromInput<STDIN>>
Boolean:DefineVariable<result; Boolean:ArgumentsAreEqual<constant; FirstInput; SecondInput>>

Boolean:RedefineVariable<result; Boolean:LogicalNot<constant; result>>

Output:DisplayAsText<STDOUT; result>

DefineMain<> [
    MetaFunctions:ExecuteScript<MetaFunctions@FILE>
]

Try it online!

503 bytes?

@Mr.Xcoder Yep, how did I miss that?

480 bytes?

Retina, 9 bytes
^(.+)¶\1$

Counts the number of times the first line matches the second.
Try it online!

Can't you use space separated inputs for -1 byte?

@CalculatorFeline The pilcrow (¶) counts as one byte in ISO 8859-1 encoding, so it's all the same.

Deduplication stages are really helpful when it comes to equality. (But to be honest, even I forget that they exist half of the time...)

Python 3, 10 bytes
int.__eq__

Try it online!

Damn, 30 seconds too late

Please explain the downvote. Have you tested this?

I couldn't make it work in python 2, so I specified it to python 3

Retina, 5 bytes
Byte count assumes ISO 8859-1 encoding.
D`
¶$

Try it online!
Explanation
D`

Deduplicate with the implicit regex .+, i.e. if the two lines are identical, clear the second one (the separating linefeed remains though).
¶$

Try to match a linefeed followed by the end of the string. This is only possible if the first stage cleared the second line, i.e. if the two numbers were equal.

Japt, 2 bytes
¥V

Try it online

Java, 41 36 12 bytes
-4 bytes thanks to @totallyhuman - Changed floats to ints
-1 byte by removing space between second method argument and comma.
-24 by converting the whole program to a lambda (woo).
(i,j)->i==j;

Takes the form of a java.util.function.BiFunction< Boolean, Integer, Integer >  using an expression lambda.

@totallyhuman Thanks! Got a bit confused since the description said "2 decimal integers"

float isn't decimal either; it's IEEE binary32.  "decimal" is a stupid way of describing binary integers.  It only makes sense when talking about their string representation, or with decimal floating point (https://en.wikipedia.org/wiki/Decimal_floating_point), which isn't provided in hardware by most FPUs.  IIRC, IBM's POWER architecture has decimal float support, which is useful for some financial stuff.

TI-BASIC, 13 bytes
Prompt A,B
If A=B
Disp 1
Else
Disp 0

Pretty self-explanatory. Prompts for two numbers and prints 1 if they are euqal, 0 otherwise.

You can shorten this to 8 bytes with Prompt A,B:A=B since the result of the = operator is 0 or 1 and will be implicitly displayed at the end of the program.

Cascade, 5 4 bytes
#&
=

Turns out I didn't need the second & due to wrapping
Try it online!

Flurry -nin, 134 bytes
<<>[(<<>()>)<<>[({}){}]>][<><<>[<>{{}}]()>]()()[<><<>()>]>({})[<><<>(){}>[()[<><<>()>]]]{{}{<{}{()[<>{}[<><<>()>]]}>}{{}(<>()){}}()}{}

Run example
$ pgm="..." # the program above
$ ./flurry -nin -c $pgm 0 0
1
$ ./flurry -nin -c $pgm 123 45
0
$ ./flurry -nin -c $pgm 123 123
1

There is no task that is trivial in every language. Seriously.
Since Flurry's only representation of a number is Church numeral, this program takes only non-negative integers as input. Outputs 1 if two Church numerals represent the same number, 0 otherwise.
Implements the following function:
// (n+1-m) * (m+1-n), where a-b gives zero if a < b
// This gives 1 when m==n (both sides of * are 1)
// and 0 otherwise (one side is 0)
main = (\npm. <SK> (m p (succ n)) (n p (succ m))) n pred m

// succ n = n + 1
succ = S<SK>

// pred n = n - 1 (pred 0 = 0); implemented using pair construct
next-pair-helper = \fmn. f n (succ n) = \fm. S f succ = \f. K(S f succ)
= {()[<>{}[<><<>()>]]}
next-pair = \p. <p next-pair-helper>
= {<{}{()[<>{}[<><<>()>]]}>}
pred = \n. n next-pair zero-pair K
= {{}{<{}{()[<>{}[<><<>()>]]}>}{{}(<>()){}}()}

It's not trivial in 1+, though.

Jelly, 1 byte
=

Try it online!
Explanation:
= Takes two arguments and returns a 1 if they are equal, and a 0 if they are not.
  Implicit print.

Alternatively, e tests for equality, and _ will subtract the input values from one another, yielding 0 for equals and any other value for different number.

Also an answer for MATL

Works in APL and J too.

Ohm, 1 byte
E

Try it online!
Because = is too mainstream.

OCaml, 3 bytes
(=)

Brackets are necessary, plain = is a syntax error

sed, 14 bytes
Includes +1 for -r
s/^(.+),\1$//

sed doesn't have truthy/falsy values, so I use the empty string as truty and everything else as falsy. This make sense because /^$/ is the simplest (fully matching) if statement.
Try it online!

Haskell, 4 bytes
(==)

Try it online! (The function has to be named)

JavaScript (ES6), 12 bytes
x=>y=>!(x-y)

Because 0 is false and all other numbers are true in JavaScript, if x-y equals 0, a not ! of that 0 will return true, and a not ! of any other number will return false. Two bytes longer than simple comparison x==y as shown in @Shaggy's answer.

MSM, 31 bytes
'?ddF',',',.....T',',':'?....':

MSM is stack based, so the two input numbers are expected to be on top of the stack, i.e. on the right of the string. MSM has neither numbers nor booleans so we are free to choose a (reasonable) representation:
T      True
F      False
123    numbers are just sequences of ascii digits. There's no literal
       representation in MSM source code, so you have to construct them
       digit by digit:  321.. -> 123 (remember: . is concatenation)

TIO doesn't support MSM out of the box, so I've included the JS interpreter from the esolang page.
Try it online!
How it works: (I use a and b for the two numbers on the stack).
Excerpt from the MSM command reference:
'   quote, push next char on the stack, even if it is a command
?   skip next command if the two top elements of the stack are equal
,   drop
:   expand string at top of the stack and push each char of it on the stack
.   concatenate two top elements

everything else is pushed

Stack trace:
' ? d d F ' , ' , ' , . . . . . T ' , ' , ' : ' ? . . . . ' : a b
d d F ' , ' , ' , . . . . . T ' , ' , ' : ' ? . . . . ' : a b ?

The next 6 chars are pushed on the stack and concatenated with 5 dots
T ' , ' , ' : ' ? . . . . ' : a b ? ,,,Fdd

The next 5 chars are pushed on the stack and concatenated with 4 dots
' : a b ? ,,,Fdd ?:,,T

: and the two numbers are pushed
? ,,,Fdd ?:,,T : a b

Now it gets interesting. If the two numbers are equal, ,,,Fdd is skipped
?:,,T : a b           -- ?:,,T as a whole is not a command, so it's pushed
: a b ?:,,T           -- expand
a b ? : , , T         -- push a b
? : , , T a b         -- a b are still equal, so skip :
, , T a b             -- drop a b
T                     -- MSM stops, output is True

If the two numbers are not equal, don't skip ,,,Fdd, but push it:
,,,Fdd ?:,,T : a b
: a b ,,,Fdd ?:,,T    -- expand
a b ,,,Fdd ? : , , T  -- push up to ?
? : , , T a b ,,,Fdd  -- number b is never equal to ,,,Fdd so expand
, , T a b , , , F d d -- drop two dummy values
T a b , , , F         -- push T a b
, , , F T a b         -- drop b a T
F                     -- stop

Cubix, 11 bytes
O0O1II-!//@

Try it online!
This was harder than expected. Outputs 0 for falsy and 10 for truthy.

Hexagony, 20 bytes
-4 Bytes thanks to Jo King by using conditional wrapping.
?}?".@!\!.!_1/@_-<~.

Try it online!
More readable version:
   ? } ? "
  . @ ! \ !
 . ! _ 1 / @
_ - < ~ . . .
 . . . . . .
  . . . . .
   . . . .

Prints 0 for truthy and 1 for falsy.
There's a no-op at the end to keep it at a sidelength of 4.
It might be possible to reduce the sidelength by one and safe a few more bytes.

If I can print 0 for truthy and anything else for falsy, this would be a valid solution aswell:
  ? } ?
 / - ! @
" / . . .
 . . . .
  . . .

This is basically just subtraction and seems like cheating to me.

Welcome to PPCG!

20 bytes by using the built-in branching instead of another <. Technically it's 19 bytes, but an extra . is needed to keep it side length 4. I'll have a look into a side length 3 version

Whitespace, 60 bytes
[S S S N
_Push_0][S N
S _Duplicate_0][S N
S _Duplicate_0][T   N
T   T   _Read_STDIN_as_integer][T   T   T   _Retrieve][S S S T  N
_Push_1][S N
S _Duplicate_1][T   N
T   T   _Read_STDIN_as_integer][T   T   T   _Retrieve][T    S S T   _Subtract][N
T   S N
_If_0_Jump_to_Label_EQUAL][T    N
S T _Print_as_integer][N
N
N
_Exit_program][N
S S N
_Create_Label_EQUAL][S S S T    N
_Push_1][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).
Outputs 1/0 as truthy/falsey values. 3 bytes could be saved by removing NNN if 1/01 as truthy/falsey values are allowed.
Pseudo-code:
Integer i = STDIN as number
Integer j = STDIN as number
If(i == j):
  Call function EQUAL()
Print 0 to STDOUT
Exit program

function EQUAL:
  Print 1 to STDOUT
  Exit automatically with error

Keg, 1 byte(SBCS on Keg wiki)
=

Explanation:
=# Test whether they are equal

1 byte

Caboose, 24 bytes
print(input()==input());

TIO

Flurry, 30 bytes
{}{{}{}}[{}{{{}}}[<>()]](){{}}

You can test it with the interpreter:
$ for i in {0..5}; do
$   for j in {0..5}; do
$     ./Flurry -nin -c '{}{{}{}}[{}{{{}}}[<>()]](){{}}' $i $j
$   done | xargs
$ done
1 0 0 0 0 0
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 0
0 0 0 0 1 0
0 0 0 0 0 1

In Flurry, popping from the stack returns the I combinator (λa. a), which also happens to be the Church numeral representation for the number 1. Thus we can compute N != M using the following method:

Push 0 to the stack.
Push 1 to the stack N times.
Pop from the stack M times and ignore the value.
Pop from the stack and return the value.

This is how the program works conceptually, but we can combine the first two steps and the second two steps using a few tricks.

{{}} represents the I combinator (1 = I = λa. a).
{{{}}} is a function that pushes its argument to the stack and returns the I combinator (λa. (push a; λb. b))
[<>()] represents zero (0 = S K = λab. b).
By applying the input number to both of these terms, we obtain the expression n{{{}}}[<>()], which has the following semantics:

If n > 1, push 0 to the stack, followed by n - 1 ones, and return 1.
If n = 0, push nothing to the stack and return 0.

{{}{}} is a function that takes an argument a, pops a value b from the stack, and returns ba. In this case, a and b are both guaranteed to be either zero or one, so it effectively returns 0 if (a, b) == (1, 0) and 1 otherwise.
By applying the input number to this term, and to the result of the previous term, we obtain the expression n {{}{}} [m {{{}}} 0], which has the following semantics:

If m = 0, [m {{{}}} 0] pushes nothing and returns 0. Since the stack is empty, {{}{}} always pops one, so its return value is always 1. Thus the entire expression is 0 if n = 0 and 1 otherwise.
If m > 0, [m {{{}}} 0] pushes 0 followed by n - 1 ones and returns 1. Thus {{}{}} always returns the value popped from the stack, and n {{}{}} 1 pops n times and returns the last value popped. The entire expression is 0 if n = m and 1 otherwise.

The last step is to take the resulting number (representing whether the values are unequal) and negate it by applying it to () and {{}}.

JavaScript (ES6), 10 bytes
x=>y=>x==y

05AB1E, 1 byte
Q

Try it online!

Python 2, 15 bytes
lambda x,y:x==y

Try it online!

Mathematica, 6 bytes
#==#2&

Or you could do Equal or SameQ for 5 bytes each.

Go, 36 32 bytes
-4 bytes thanks to powelles.
func f(x,y int)bool{return x==y}

Try it online!

You can group function inputs by type (x,y int)

Pyth, 2 bytes
qE

Try it here :)

GolfScript, 2 bytes
~=

Try it online!

Kotlin, 39 30 bytes
fun f(x:Int,y:Int)=print(x==y)

Try it online!

you could make this a lambda {x:Int,y:Int->print(x==y)}

dc, 12 9 bytes
[1]sF=F0+

Try it online!

QBIC, 4 bytes
?:=:

This takes a and b in from the command line and prints -1 when equal, 0 when not.
Alternative 4-byter
?:-:

This prints the result of subtracting b from a and gives 0 for equals, and any other value else-wise.

Perl 6, 4 bytes
*==*

Try it
This creates a WhateverCode lambda, Each * represents a parameter

09D, 13 bytes
310310412D301

Outputs 1 if the values are equal, otherwise 0
Explanation:
310310412D301
3                 Read..
 1                ..from I/O (STDIN)
  0               ..to stack
   310            Read 2nd input as above
      4           Apply math function...
       12D        ..isEqual, pop both items and push a 1
                     if they are equal, otherwise push a 0
          3       Read..
           0      ..from stack
            1     ..to I/O (STDOUT)

Braingolf, 4 bytes
e1:0

Outputs 1 if inputs are equal, otherwise 0
Explanation:
e1:0  Implicit input to stack
e     If last 2 items are equal..
 1    ..push 1 to stack
  :   else
   0  ..push 0 to stack
      Implicit endif
      Implicit output of last item on stack

C, 20 bytes
f(a,b){return a==b;}

Lua, 18 bytes
a,b=...print(a==b)

Try it online!

Add++, 3 bytes
L,=

Try it online!
Yay for lambda functions!

Decimal, 13 bytes
81D81D412D301

Pretty simple. Ungolfed:
81D  ; builtin - read INT to stack
81D  ; builtin - read INT to stack
412D ; compare for equality
301  ; print to STDOUT

Try it online!

Triangular, 6 bytes
$.$%=<

Try it online!
Formats into this triangle:
  $
 . $
% = <

Commands executed (without no-ops or directionals): $$=%
Pretty simple.

$ - read input as integer
= - compare top two stack values for equality
% - print result

Cubically, 8 5 bytes
$:$=%

Explanation:
$      read integer input
 :     set notepad to input
  $    read integer input
   =   compare notepad to input
    %  print notepad

Try it online!

Triangularity, 17 bytes
..)..
.I)1.
I=...

Try it online!
Triangularity, 17 bytes
..)..
.D@I.
sI=..

Try it online!

Noether, 4 bytes
II=P

Try it online!

TI-Basic, 3 bytes
not(variance(Ans

Gives {1} as truthy value or {0} for falsy. -1 bytes thanks to lirtosiast!

not(variance(Ans

@lirtosiast Good tip, thanks!

Python 2 - 15 bytes
lambda a,b:a==b
Like this:
def equality(a, b): Declare a function
    return a == b   Return True if equal, False if not

PowerShell, 36 20 bytes
-16 bytes thanks to @mazzy (Basically their answer!)
!($args[0]-$args[1])

Try it online!
Simple. Takes arguments from commandline arguments.

I don't know much about powershell, but aren't you using more bytes to shorten $args to $a than you would be if you just wrote $args twice?

Great! Gabriel Mills, try this !($args[0]-$args[1]) or $a,$b=$args;!($a-$b) or param($a,$b)!($a-$b)

1+, 10 bytes
."."\</<*:

This is likely to be ungolfed: tell me if there's a better approach.
Explanation:
First, I'll name the two input A and B.
."." pushes A, duplicate it, pushes B, duplicate it. So now the stack is: A A B B.
\ rotates the stack, so the stack is now B A A B.
</<* Pushes A <= B, move it to the bottom of the stack, and pushes B <= A, then multiply them, as they are both boolean, this is equivalent to the and operation.
: Outputs the result.

x86_64 machine language on Linux, 8 bytes
0:   31 c0                   xor    %eax,%eax
2:   39 f7                   cmp    %esi,%edi
4:   0f 94 c0                sete   %al
7:   c3                      retq

Try it online!

Why are you bothering to return a 64 or 32-bit integer truth value?  The x86-64 SysV calling convention (used on Linux) only requires bool return values to be in the low 8 bits; the remaining bits of rax are allowed to hold garbage.  The only reason you (or gcc) would xor-zero eax would be for performance reasons to avoid a potential false dependency.

In assembly language, you should choose your calling convention to optimize for the problem.  For example, you should return the compare result in ZF (so ZF=1 means equal).  Then the whole function is only 4 bytes.

><>, 3 bytes
=n;

Try it online!
Takes command line arguments.
I feel unclean posting an answer to this one..

Clam, 5 4 bytes
p:rr

Explanation
p    - Print...
  r  - Next input
 :   - Equal to
   r - Next input

C, 19 bytes
f(a,b){return a-b;}

Try it online!
C, 18 bytes
#define f(a,b) a-b

Try it online!
"Truthy" value is 0 and "Falsy" value is anything but.

APL (Dyalog Classic), 5 1 bytes
=

Try it online!
My first APL answer!

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


text:
Does the nth char equal the nth from last char?
Inspired by Does the start equal the end
Given a string s and an integer n, output a truthy/falsey as to whether the nth char in s equals the nth from the end char in s.
Input
A non-empty string and an integer. You can use 0-based indexing or 1-based indexing. The integer is guaranteed to be valid based on the string. For example, if the string is "supercalifragalistic123", the integer can be from 1 to 23 for 1-based indexing, and 0 to 22 for 0-based indexing. Please note that n can be larger than half the length of s.
Input is limited to printable ASCII.
Output
A truthy/falsey value based on whether the nth value in s equals the nth from last value in s.
Please note that the last char is in position 0 for 0-based indexing and position 1 for 1-based indexing. Think of it as comparing the string to its reverse.
Test Cases
0-indexed
"1", 0         Truthy 1 == 1
"abc", 1       Truthy b == b
"aaaaaaa", 3   Truthy a == a
"[][]", 1      Falsey ] != [
"[][]", 0      Falsey [ != ]
"ppqqpq", 2    Truthy q == q
"ababab", 5    Falsey a != b
"12345", 0     Falsey 1 != 5
"letter", 1    Truthy e == e
"zxywv", 3     Falsey w != x

1-indexed
"1", 1         Truthy 1 == 1
"abc", 2       Truthy b == b
"aaaaaaa", 4   Truthy a == a
"[][]", 2      Falsey ] != [
"[][]", 1      Falsey [ != ]
"ppqqpq", 3    Truthy q == q
"ababab", 6    Falsey a != b
"12345", 1     Falsey 1 != 5
"letter", 2    Truthy e == e
"zxywv", 4     Falsey w != x

Sandbox (deleted)

Would it be acceptable to take n as a code-point? (for esoteric languages such as brain-flak)

@DJMcMayhem sure.

Jelly, 5  4 bytes
=UƓị

Try it online!
There should be no shorter answers in Jelly. An program would need comparison, reversal/negation, an index call, and a byte for control flow (Ɠ in this case), which adds up to four bytes.
How it works
 =UƓị
       - (implicit) input string
 =     - equals (vectorizing by characters because a string is a charlist)
  U    - the reversed string
    ị  - get the element at the index of:
   Ɠ   - the input index

-1 byte thanks to @ais523, using Ɠ

Failed 4 byte solution from original version of post: ịµU=

You can improve it to four bytes by making it monadic rather than dyadic (and taking n from standard input rather than an argument): Try it online! This technique is often useful when you're wasting a byte on control flow and an additional byte on ³, as the Ɠ costs one byte but makes the ³ implicit and often gives you more control flow flexibility.

@ais512 Good idea, I have actually never used the input before in an answer because implicit arguments tend to be more efficient.

JavaScript (ES6), 26 bytes
s=>n=>s[n]==s.substr(~n,1)

Alternatively:
s=>n=>s[n]==s.slice(~n)[0]

This one almost works, but fails when n == 0 (because s.slice(-1,0) == ""):
s=>n=>s[n]==s.slice(~n,-n)

Another 26-byte solution that @RickHitchcock pointed out:
s=>n=>s[n]==s[s.length+~n]

Nice use of ~, would never have though of that for this.

MATL, 5 bytes
tP=w)

Try it online!
Explanation:
t   % Duplicate the input

Stack:
    ['ppqqpq' 'ppqqpq']

P   % Reverse the top element of the stack

Stack:
    ['ppqqpq' 'qpqqpp']

=   % Equals. Push an array of the indices that are equal

Stack:
    [[0 1 1 1 1 0]]

w   % Swap the top two elements

Stack:
    [[0 1 1 1 1 0], 3]

)   % Grab the a'th element of b

Very clever approach!

@LuisMendo Thankyou! That is quiet the complement coming from you :)

Now we see if Jelly can beat this xD

Python, 24 22 bytes
-2 bytes thanks to Adnan.
lambda s,n:s[n]==s[~n]

Try it online!

I think you can replace -n-1 by ~n.

Why only Python2? Seems to work on Python3 just fine, you should change it to just 'Python'.

@sagiksp it's the default template output in TIO

Oh, makes sense.

@sagiksp Yeah, it's the template from TIO but updated. :)

Octave, 22 bytes
@(s,n)s(n)==s(end-n+1)

Try it online!
Or the same bytecount:
@(s,n)s(n)==flip(s)(n)

Try it online!
Explanation:
It's quite straight forward. The first one takes a string s and an integer n as inputs and checks the n'th element s(n) against the "last-n+1" element for equality.
The second one checks the n'th element s(n) against the n'th element of s reversed.

05AB1E, 7 5 bytes
-2 bytes thanks to Adnan
ÂøsèË

Try it online! or Try all tests
Â     # Add a reversed copy on top of the original string
 ø    # Zip
  sè  # Extract the nth element
    Ë # Check if they are equal

Try it online!

ÂøsèË saves two bytes

@Adnan Thanks! I knew there was a 1 byte way to add a reversed copy, I just couldn't remember how it was labeled.

@ComradeSparklePony I forgot to update it to include Adnan's suggestion.

Haskell, 22 bytes
s#n=s!!n==reverse s!!n

0-basd. Usage example: "letter" # 1 -> True.
Try it online!

Alice, 24 bytes
/t.~e?/-mom
\I!RtI&1n;@/

Try it online!
Input consists of the string on one line, and the number on the second line.  Output is Jabberwocky if the characters are the same, and nothing otherwise.
Explanation
This program is mostly in ordinal mode, with one command in cardinal mode.  Linearized, the program is as follows:
I.ReI&1m;mt!~t?&-no

I  % Input first line
   % STACK: ["ppqqpq"]
.  % Duplicate top of stack
   % STACK: ["ppqqpq", "ppqqpq"]
R  % Reverse top of stack
   % STACK: ["ppqqpq", "qpqqpp"]
e  % Push empty string
   % STACK: ["ppqqpq", "qpqqpp", ""]
I  % Input next line
   % STACK: ["ppqqpq", "qpqqpp", "", "3"]
&  % (cardinal mode) Pop stack and repeat next command that many times
   % STACK: ["ppqqpq", "qpqqpp", ""], ITERATOR: [3]
1  % Append "1" to top of stack
   % STACK: ["ppqqpq", "qpqqpp", "111"]
m  % Truncate so the top two strings on the stack have the same length
   % STACK: ["ppqqpq", "qpq", "111"]
;  % Discard top of stack
   % STACK: ["ppqqpq", "qpq"]
m  % Truncate again
   % STACK: ["ppq", "qpq"]
t  % Extract last character
   % STACK: ["ppq", "qp", "q"]
!  % Move top of stack to tape
   % STACK: ["ppq", "qp"]
~  % Swap
   % STACK: ["qp", "ppq"]
t  % Extract last character
   % STACK: ["qp", "pp", "q"]
?  % Copy data from tape onto top of stack
   % STACK: ["qp', "pp", "q", "q"]
&  % Iterator: effectively a no-op in ordinal mode when the top of the stack is a 1-character string
   % STACK: ["qp", "pp", "q"], ITERATOR: ["q"]
-  % Remove occurrences: here, result is "" iff the characters are equal
   % STACK: ["qp", "pp", ""]
n  % Logical Not (for a consistent truthy value)
   % STACK: ["qp", "pp", "Jabberwocky"]
o  % Output top of stack

@MartinEnder Jabberwocky?

@StephenS Jabberwocky.

@StephenS Btw, I don't get notifications if you just mention me on random posts. Pings only work if the post is mine or I've commented myself (and I think if I edited the post). You're usually better off pinging me in chat.

@MartinEnder I kind of knew that, but it wasn't important enough to ping you. Thanks for the confirmation and the link :)

V, 26, 16, 13 bytes
ä$Àñã2xñVpøˆ±

Try it online!
Hexdump:
00000000: e424 c0f1 e332 78f1 5670 f888 b1         .$...2x.Vp...

1 indexed.
Explanation:
ä$                  " Duplicate this line horizontally
  Àñ   ñ            " Arg1 times...
    ã               "   Move to the center of this line
     2x             "   And delete two characters
        V           " Select this whole line
         p          " And replace it with the last pair of characters we deleted
          ø         " Count the number of matches of the following regex...
           <0x88>   "   Any character
                 ±  "   Followed by itself

For reference, my original answer was:
Àñx$x|ñxv$hhpÓ¨.©±/1
ñllS0

Try it online! (0 indexed)
Hexdump:
00000000: c0f1 7824 787c f178 7624 6868 70d3 a82e  ..x$x|.xv$hhp...
00000010: a9b1 2f31 0af1 6c6c 5330                 ../1..llS0

Try it online!  This is a bit shorter.  Man the Àñx$x|ñ feels like too many characters.  I tried a regex only, but it ended up being like 24 long!

@nmjcman101 Turns out it can be much shorter than that using newer features.

Oh wow I'm out of practice, I can barely even read V anymore

@nmjcman101 I've posted an explanation (and golfed a little more)

Java 8, 43 42 bytes
s->n->s.charAt(n)==s.charAt(s.length()+~n)

Try it here.

Cubix, 22 bytes
..@.IAp):tBvpptc?1.\O0

1-indexed, takes input as index,string, separated by a space.
Try it online
Cubified
    . .
    @ .
I A p ) : t B v
p p t c ? 1 . \
    O 0
    . .

Explanation
This is mostly linear.  The main logic is
IAp):tBpptc

IA           Get the first input as an int and the rest as a string.
  p):        Move the index to the top of the stack, increment it, and copy it.
     t       Look up the appropriate character in the string.
      Bpp    Reverse the stack and put the index and character back on top.
         t   Look up the appropriate character in the reversed string.
          c  XOR the two characters.

We then branch with ? to Output 1 if the result is 0 and 0 otherwise.

C#, 28 27 bytes
s=>n=>s[n]==s[s.Length+~n];

Saved a byte thanks to @KevinCruijssen.
Compiles to a Func<string, Func<int, bool>>.

You can save a byte by changing s.Length-n-1 to s.Length+~n.

@KevinCruijssen Thanks, nice trick never would have thought of that.

I will be completely honest, I got it from the comment of the JS answer myself. :) Byte-operations aren't really my expertise.

Ruby, 22  20 18 bytes
->s,n{s[n]==s[~n]}

I guess ->s,n{s[n]==s[~n]} should work? (Got no idea of ruby)

It does, nice! Thanks!

CJam, 8 bytes
l~_W%.==

Try it online!
0-indexed index goes first.

R 51 bytes
function(s,n){s=el(strsplit(s,''));s[n]==rev(s)[n]}

Anonymous function, uses 1-based indexing

43 bytes: function(s,n)(s=utf8ToInt(s))[n]==rev(s)[n]

Clojure, 27 bytes
#(nth(map =(reverse %)%)%2)

Wow, this was shorter than I expected.

APL (Dyalog), 10 5 bytes
⊃=⊃∘⌽

This is a tacit function, which needs to be assigned a name such as f←⊃=⊃∘⌽, and then called as int f string.
Thanks to @Adám for a whopping 5 bytes.
How it works:
⊃=⊃∘⌽  ⍝ Main function; tacit.
       ⍝ Inputs are ⍺ = 1 (left) and ⍵ = 'abca' (right).
⊃      ⍝ ⍺⊃⍵, meaning 'pick the ⍺-th element of ⍵'
 =     ⍝ Compare to
    ⌽  ⍝ ⌽⍵, meaning 'invert ⍵'
  ⊃    ⍝ Again, ⍺⊃⍵, but:
   ∘   ⍝ Compose. This turns ⌽ into the right argument for ⊃,
       ⍝ which becomes 'pick the ⍺-th element from ⌽(the inverse of)⍵'

Try it online!
The 22 byte answer was edited out. If you want to see it, check the revision history.

" it takes the input in a non conventional way" -- taking 2 element input as the left and right args in APL is completely standard and always acceptable unless the OP specifically forbids it for some bizarre reason.

@Jonah yeah, people in chat enlightened me about that. I left it as is because OP doesn't specify clearly if it's okay or not. I'll edit that when I get back to my PC so the shorter answer appears first.

Regarding "implicitly assumes": Actually, this function will work even when called monadically, and will then appear to use 1 as default left argument. Try it online! The functions don't assume anything; they are being applied dyadically because they are given both a left and a right argument.

@Adám I thought that happened because, when called monadically, ⊃ takes the first element of the argument? Anyway, I'll edit to clarify.

J, 6 5 bytes
{]=|.

Try it online!
-4 bytes thanks to FrownyFrog for {(=|.)
See original answer explanation -- idea is similar enough, but this is accomplished with a dyadic hook whose right verb is itself a monadic hook.
Try it online!
original answer (10 bytes)
{=/@(,:|.)

,:|. right arg on top of reverse right arg
=/ are they elementwise equal?
{ take from that boolean list the index indicated by the left arg
Try it online!

C# (Visual C# Interactive Compiler), 20 bytes
I don't have enough reputation to comment on TheLethalCoder's answer, but in C# 8 you can save some more bytes.
s=>n=>s[n]==s[^++n];

Try it online!

Lua, 46 bytes
function f(s,n)return s:byte(n)==s:byte(-n)end

Try it online!

you can't assume the input is already in s, and you need to output it as well

Mathematica, 34 Bytes
s=StringTake;s[#,{#2}]==s[#,{-#2}]&

StringTake[#, #2] takes the first #2 characters of #. StringPart would work well in this case. #~(s=StringPart)~-#2==s@##&

my wrong. fixed!

#~s~{#2}==#~s~{#2}& would always yield True...

final fixed!....

That fixes it, but StringPart does not require a List: #~(s=StringPart)~-#2==s@##& or s=StringPart;s@##==#~s~-#2& works too.

Actually, you can take a List of Strings as input, so #[[#2]]==#[[-#2]]& would suffice

very nice. I didn't know about it

Note that this is not a function. & (Function) have higher priority than ; (CompoundExpression), so that is interpreted as CompoundExpression[s=StringTake,s[#,{#2}]==s[#,{-#2}]&].

PHP>=7.1, 36 Bytes
[,$t,$p]=$argv;echo$t[$p]==$t[~+$p];

Online Version

~+$p saves one byte.

Perl 6, 27 bytes
{[eq] $^a.comb[$^b,*-1-$b]}

Test it
{ # bare block lambda with two placeholder parameters ｢$a｣ and ｢$b｣

  [eq]        # reduce using string equality operator

    $^a       # declare first positional parameter

    .comb\    # split that into individual characters

    [         # index into that sequence

      $^b,    # declare and use second parameter

      *-1-$b  # closure that subtracts one and the
              # second parameter of the outer block
              # (｢*｣ is the parameter of this closure)

    ]
}

Pyth, 8 7 bytes
q@zQ@_z

With the input reversed: first the index, then the string. It is 0-indexed.
Explanations:
q@zQ@_z
 @zQ        Get the nth (Qth) character
     _z     Reverse the string
    @       Get the nth character of the reversed string. Implicit input of the index
q           Test equality

Try it online!

C, 36 35 bytes
#define f(s,n)s[n]==s[strlen(s)+~n]

Uses 0-based indexing, naturally.
Try it online!

I think -1-n can be +~n.

Factor, 24 bytes
[ 2dup nth -rot nth* = ]

Try it online!
Explanation
nth* is like nth except it indexes from the back; if 0 nth is the first element, 0 nth* is the last.
             ! 1 "[][]"
2dup         ! 1 "[][]" 1 "[][]"
nth          ! 1 "[][]" 93
-rot         ! 93 1 "[][]"
nth*         ! 93 91
=            ! f

Thunno, \$ 8 \log_{256}(96) \approx \$ 6.58 bytes
Drz.=sAI

Attempt This Online!
0-indexed. Change AI to AH if you want it to be 1-indexed.
Explanation
Drz.=sAI  # Implicit input
Dr        # Duplicate and reverse
  z.=     # Zipped equality
     sAI  # Swap and index in
          # Implicit output

Vyxal, 4 bytes
fḂ=i

Try it Online!
Explanation
fḂ=i  # Implicit input
f     # Flatten into a list of characters
 Ḃ    # Bifurcate: duplicate and reverse
  =   # Are they equal (vectorises)
   i  # Index in
      # Implicit output

ZSH, 32
f(){read s n;[ $s[n] = $s[-n] ]}

Try it online!

Japt, 10 9 8 bytes
gV ¥Ug~V

Try it online!

QBIC, 18 bytes
?_s;,:,1|=_sA,-a,1

Explanation
?        =     PRINT -1 if equal, 0 otherwise, between
 _s     |      A substring of
   ;,:,1          A$ string (read from cmd line), from the n'th pos, length 1
 _sA,-a,1      And a substring of A$, n'th pos from the right, also 1 length
               The second Substring is auto-terminated because EOF.

CJam, 11 bytes
q~_2$=@@~==

Bad. Too much stack manipulation.

C++, 57 Bytes
Assuming header includes don't count.
bool c(std::string s,int i){return s[i]==s[s.size()-i];}

I'm pretty sure you can remove the spaces at int i){ and s[i]==s[ to make it 54 bytes.

I don't think this is valid. The first parameter needs to be given an identifier, otherwise you cannot refer to it. But you don't need the space between the closing parenthesis of the function signature and the opening brace of its definition, so this would only increase your code size by 1 byte. You'd get a net decrease by removing the spaces around the equals sign, as Kevin suggested.

In addition to removing spaces and including s in the parameter list you could also replace bool by int.

#include<string> int c(std::string s,int i){return s[i]==s[s.size()-i];}(line break of course) is the smallest I get to compile. If you find a compiler that includes <string> on default you may drop it.

shouldn't it be s[s.size()-i-1] or at least s[s.size()+~i]?

><> (with this interpreter), 25 bytes
i:0(?v
]&=n;>~{:}[:}]&r[}

It doesn't work in TIO: the TIO interpreter doesn't reverse the new stack when doing the [ instruction, but the fish playground does — compare "abcde"5[ooooo; run here and here, for example.
The string input is taken from STDIN, and we assume n is already on the stack. Uses 1-indexing.
The fish gets the nth character with [:}]&, which siphons off the first n things on the stack into a new, reversed stack, manipulates that a bit, then puts the things back and saves the nth character in the register. It then reverses the whole stack and does the same again, and returns 1 if the two characters are equal, and 0 otherwise.
This seems to work at TIO, for 26 bytes:
i:0(?v
]&=n;>~{:}[{:}]&r[{

REXX, 41 bytes
parse arg n,=(n)l+1''-(n)r+1 .
return l=r

Arguments are given in n,s order since n is required for parsing s.

Crystal, 26 24 Bytes
def c(s,n)s[n]==s[~n]end

-2 Bytes from  Felipe Nardi Batista, thanks.
Try it online!

Welcome to the site! A nice solution, to improve your answer I would recommend adding a "Try it online" link that shows an implementation of your answer.

s[n]==s[~n] saves 2 bytes

@Notts90, i don't think there are any online crystal-interpreters. :(
The homepage provides one, but I don't think it has an API?

@Domii look at the try it online link in my previous comment, it's lists crystal as one of the languages it supports.

@Notts90 Oh sry. I missed that link because the color is almost the same as the rest. Thanks :D

@Domii no worries, when you have created your code in there click the link button at the top and it even has an option that's formatted for Stack Exchange.

C, 73 bytes
Compiles as-is with GCC 6.3.1 (no flags). Some unnecessary obfuscation included.
main(c,v)char**v;{c=atoi(v[2]);putchar((*++v)[c]-(*v)[strlen(*v+1)-c]);}

Usage
$./a.out abcdcba 6

Truthy = nothing, falsey = garbage.

Lua, 35 bytes
Uses 1-indexing.
s,n=...print(s:byte(n)==s:byte(-n))

Try it online!

shortC, 23 bytes
Df(s,n)s[n]==s[Ss)-1-n]

Try it online!
Substitutions in this program:

D -> #define
S -> strlen(
No auto-inserted closing stuff :(

Perl 5, 23 + 3 (-lF) = 26 bytes
say$F[$n=<>]eq$F[-1-$n]

Try it online!
Uses 0 indexing

Itr, 6 bytes
ä¡Y=à@
0-indexed
online interpreter
Explanation
ä       ; duplicate the first (implicit) input
 ¡      ; reverse it
  Y=    ; zip the two lists with equality
    à@  ; get the element at the index given by the second index
        ; implicit output

Javascript, 20 bytes
s=>n=>s[n]==s.at(~n)

Thunno 2, 3 bytes
Ḳ=i

Try it online!
Explanation
Ḳ=i  # Implicit input
Ḳ    # Bifurcate the input string
 =   # Check for equality (vectorised)
  i  # Index into this list
     # Implicit output

clever! thank you for styling the Try Thunno page better lol. and no i didn’t entirely forget about the docs site, i’ll get that done soonTM

That's ok. (Also, the restyling was mainly lyxal telling me what code to put where lol :p)

PowerShell, 18 bytes
$a[$b]-eq$a[-$b-1]

Try it online!

Uiua, 5 bytes
⊡:=⇌.

Try it!
⊡:=⇌.
    .  # duplicate
   ⇌   # reverse
  =    # elementwise equal
 :     # flip
⊡      # pick

source: Stack Exchange

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

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

sort: votes


text:
Create a Muriel-like language and implementation
Muriel is a language where the only way to loop is to create a quine and execute it. Your job is to create your own language with this property and an implementation of it in a pre-existing language.
We will define a Muriel-like language like as follows:

It has a built-in command for executing code in its own language, similar to Muriel's @ command or python's exec.
It is Turing complete.
If you remove the built-in execution command it is no longer Turing complete.

Muriel is Muriel-like with @ as its built-in execution command. Smurf is also Muriel-like (its built-in execution command is x). Python is not Muriel-like, since it is still Turing complete if you remove exec.
Your job is to create a Muriel-like programming language, and then to provide an implementation of it in a language of your choice. Your score is the length of the implementation, which you are trying to minimize.
Notes:

Your built-in execution does not need to function exactly like Muriel. It is up to you how it handles termination of the child program, errors, scoping, etc...
The language you write the implementation can not itself be Muriel-like. (This is so that @ is not a valid entry.) It also must have existed before this post.

Is Underload a Muriel-like language?

@JerryJeremiah Does my edit make it clearer?

@alephalpha That wiki says "Without ^, the remaining program will always decrease in size, eventually halting." If this is true, then yes, Underload is Muriel-like.

What do you do if your target language has multiple eval commands? (Eg Python's exec and eval) Require the removal of all of them to lose TCness?

@PyRulez I think this should be [tag:popularity-contest] rather than code-golf, because otherwise the choice of implementation language would make it a chameleon challenge

@Uriel what's a chameleon challenge?

A challenge that looks like one thing (implement a language) but is another (choose your base language very carefully).

Could Brainfuck be considered Muriel-like, if you interpret all characters as appending themselves to the top of a “loop stack” (separate from the memory), [ pushing a new empty string if the memory cell is truthy, and ] popping and evaluating?

@xigoi I think with that description, technically yes, lol. I suppose all programmable computing is about code executing other code, when you think about it.

Python 3 and "The minimum TC subset of Underload but with the characters changed to 2019, reversed, and with a 0 on top", 156 129 bytes
c,n,*s=input(),0,[]
while c:
 i,*c=c;q="6">i
 if n:n+=q*int(i)-q;s[n and-1]+=i,
 elif q:n="1"<i;s+=s[-1]*(1-n),
 else:c=s.pop()+c

Try it online!
Explanations in the header, ungolfed code in the footer.

RIP grand chart

CJam, CFU analogue of the ():~^ subset of Underload, 12 bytes
q_"_\~\""--~

CJam already happens to be a stack-based language with an eval instruction, which makes it a good candidate for having a Muriel-like subset.
In particular, we define a subset with the following instructions:

"...": Push a string ... to the stack. Quotes and backslashes inside the string can be escaped using backslashes. Equivalent to Underload's ().
_: Duplicate the top stack value. Equivalent to Underload's :.
\: Swap the top two stack values. Not strictly necessary for Turing-completeness, but we need to permit backslashes anyway. Equivalent to Underload's ~.
~: Execute the top stack value. Equivalent to Underload's ^.

Explanation of the code:
q            | read input
  "_\~\""-   | remove all these characters: "_\~
 _        -  | remove all characters in the resulting string from the input
           ~ | execute the result


text:
Find the rectangle
Overview
Given a 2 dimensional array of values with a filled in rectangle, find the position and size of the rectangle. Do it in the fewest array accesses as possible.
Requirements

The x and y values in the output must be 0-indexed. The top left corner is (0, 0).
The output should be the 4-tuple (x, y, width, height).
This is a fastest-algorithm challenge, so do it in as few array accesses as possible. An "array access" is the use of abc[x][y], .indexOf, or .contains. Getting the bounds of the array is free.
You may not copy the array to another format.
You may not store any information about the inputs into your program ahead of time. That's cheating. It should be completely general. The inputs are fixed so everyone is on an equal playing field, and so your program isn't given a bad score from simple bad luck.
While not strictly a requirement, to keep track of "array accesses", you can have a counter that is incremented after every access.

Example Inputs and Outputs
Given the following 2D array
((0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 1, 1, 1, 1, 1, 0, 0),
 (0, 0, 0, 1, 1, 1, 1, 1, 0, 0),
 (0, 0, 0, 1, 1, 1, 1, 1, 0, 0),
 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0))

Your program should return (3, 2, 5, 3), specifying that the rectangle starts at x=3 and y=2 and is 5 units wide and 3 units tall.
Input:
((1, 1, 1, 0, 0, 0, 0, 0, 0, 0),
 (1, 1, 1, 0, 0, 0, 0, 0, 0, 0),
 (1, 1, 1, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0))

Output: (0, 0, 3, 3)
Input:
((0, 0, 0, 0, 0, 1, 1, 1, 1),
 (0, 0, 0, 0, 0, 1, 1, 1, 1),
 (0, 0, 0, 0, 0, 1, 1, 1, 1),
 (0, 0, 0, 0, 0, 1, 1, 1, 1),
 (0, 0, 0, 0, 0, 1, 1, 1, 1))

Output: (5, 0, 4, 5)
Input:
((0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0, 1, 1, 0, 0),
 (0, 0, 0, 0, 0, 0, 1, 1, 0, 0),
 (0, 0, 0, 0, 0, 0, 1, 1, 0, 0),
 (0, 0, 0, 0, 0, 0, 1, 1, 0, 0))

Output: (6, 2, 2, 4)
Input:
((0, 0, 0, 0, 0, 0),
 (0, 1, 1, 1, 1, 0),
 (0, 1, 1, 1, 1, 0),
 (0, 1, 1, 1, 1, 0),
 (0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0))

Output: (1, 1, 4, 3)
Input:
((0, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 0, 0, 0, 0, 0),
 (0, 0, 0, 1, 0, 0, 0, 0))

Output: (3, 7, 1, 1)
Scoring
Your program's score is determined by the sum of the number of array accesses it takes to solve all 6 of those examples. For example, if it takes 20 accesses to solve the first 5, and 15 for the last, your program's score will be 115. Lower score is better.

@Daffy But it is allowed to take advantage of the placement of the examples, right? As in it doesn't have to be the fastest for all possible arrays, just these examples

@ASCII-only This is a bit tricky to account for, but the "spirit" of the challenge is to have a general solution. I should not be able to reverse engineer your program to learn anything about the examples. For instance, checking x=3,y=2 explicitly to speed up the first example is against the requirements.

@Daffy But what about checking in reverse to gain an advantage for #3, #4 and #6

@ASCII-only That's a bit of a grey area, but I think for these purposes it's general enough.

@ASCII-only What would probably be crossing the line, though, is starting your search by checking around the border to get an advantage on #2, #3, #4, and #6. Checking the border like that is not something you're likely to find in real-world code.

Can you define array access? Is getting the length an access? How about a .indexOf or .contains function?

@StephenS It can be assumed that every input will have exactly one rectangle. Anything else need not be considered. arr[x][y] is an access, .indexOf is an access, .contains also is, but getting the bounds of the array is not. I'm not sure what you mean by hidden test cases.

@Daffy thanks. test cases that you can run on our programs, but that we can't preprogram for, aka that you don't tell us.

@StephenS It should be valid for every 2 dimensional array with exactly one rectangle. Though I see what you mean, that would prevent cheating, though it makes it easy for me to cheat. I'm not sure how I'd get around that.

If I convert the input into another format how do the operations count then? ie a string

I think counting a single array access for .indexOf is a deviation from what I'd understand an array access to be. If you intend it, I suggest prominently mentioning it in the spec so that reading comments doesn't give an advantage. Exactly what built-ins count as an access though? For example, what about finding the first instance from a starting index, or from the right? Counting?

I think the cleanest way to define this is to have a black-box function that, given a pair of coordinates, outputs the value at that coordinate of the array. The function is a black-box oracle that the code can query, but cannot access to the internals of. Then, each function call is an access.

@xnor That probably would be better. Though I don't want to have people rewrite their code because of an oversight on my part ;)

This  new rule is very exploitable: an "array access" is any built-in function that retrieves information about the content of the array. One can call repr or list or copy on the array to determine it fully, then do everything else without any accesses.

@xnor Good point. Perhaps I should limit it to what's already been used. Namely .indexOf.

@Daffy can you clarify as to whether abc[x].indexOf(1) is one array access or two?

@StephenS Since it references only one item in the grid, I think that should count for one.

JavaScript, 40 operations
function findRect(arr) {
  var found = false;
  var c = 0;
  for (i = 0; i < arr.length; i++) {
    if (!found) {
      first = arr[i].indexOf(1);
      c++;
      if (~first) {
        found = true;
        x = first;
        y = i;
      }
    }
    if (found) {
      last = arr[i].lastIndexOf(1);
      c++;
      if (~last) {
        width = last - x + 1;
        height = i - y + 1;
      } else {
        console.log(c);
        return [x,y,width,height];
      }
    }
  }
  console.log(c);
  return [x,y,width,height];
}

var globalC = 0;

function findRect(arr) {
  var found = false;
  var c = 0;
  for (i = 0; i < arr.length; i++) {
    if (!found) {
      first = arr[i].indexOf(1);
      c++;
      if (~first) {
       found = true;
        x = first;
        y = i;
      }
    }
    if (found) {
      last = arr[i].lastIndexOf(1);
      c++;
      if (~last) {
       width = last - x + 1;
        height = i - y + 1;
      } else {
       console.log(c);
        globalC += c;
        return [x,y,width,height];
      }
    }
  }
  console.log(c);
  globalC += c;
  return [x,y,width,height];
}

console.log(findRect([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 1, 1, 1, 1, 1, 0, 0],
 [0, 0, 0, 1, 1, 1, 1, 1, 0, 0],
 [0, 0, 0, 1, 1, 1, 1, 1, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]));

 console.log(findRect([[1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
 [1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
 [1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]));

 console.log(findRect([[0, 0, 0, 0, 0, 1, 1, 1, 1],
 [0, 0, 0, 0, 0, 1, 1, 1, 1],
 [0, 0, 0, 0, 0, 1, 1, 1, 1],
 [0, 0, 0, 0, 0, 1, 1, 1, 1],
 [0, 0, 0, 0, 0, 1, 1, 1, 1]]));

 console.log(findRect([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 1, 1, 0, 0],
 [0, 0, 0, 0, 0, 0, 1, 1, 0, 0],
 [0, 0, 0, 0, 0, 0, 1, 1, 0, 0],
 [0, 0, 0, 0, 0, 0, 1, 1, 0, 0]]));

 console.log(findRect([[0, 0, 0, 0, 0, 0],
 [0, 1, 1, 1, 1, 0],
 [0, 1, 1, 1, 1, 0],
 [0, 1, 1, 1, 1, 0],
 [0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0]]));

 console.log(findRect([[0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 0, 0, 0, 0, 0],
 [0, 0, 0, 1, 0, 0, 0, 0]]));

 console.log(globalC);

PowerShell, 34 50 Operations
I was doing some string manipulation earlier. I removed any string manipulation, as it was clarified as forbidden, at the cost of some extra operations.
function Get-SquareCoordinates{
    param(
        [array]$array
    )

    $count = 0             # Record the count
    $flag = $false         # Loop exit flag
    $rowIndex = -1         # Row location in array

    # Find the top left corner
    do{

        $rowIndex++
        # Check if this row contains 1
        $result = $array[$rowIndex].IndexOf(1)

        # If there is no 1 then -1 would be in $result
        if($result -ge 0){$x,$y=$result,$rowIndex;$flag=$true}

        # Increase the counter
        $count++
    } while(!$flag)

    # Start from the back of the array and find the last index of 1
    $w,$h = 0,0              # To store the width and height of the rectangle
    $flag = $false         # Loop exit flag
    $rowIndex = $array.Count          # Row location in array

    # Find the bottom right corner
    # Start checking the rows backwards
    do{
        $rowIndex--
        # Check if this row contains 1 and add the count of all the ones to the index of the first one found
        $result = $array[$rowIndex].IndexOf(1) + ($array[$rowIndex]-match1).Count - 1

        # If there is no 1 then -1 would be in $result
        if($result -ge 0){
            $w,$h= ($result-$x+1),($rowIndex-$y+1)
            $flag=$true
        }

        # Increase the counter by 2. First to find the one and the second to count the 1's on the line
        $count=$count+2
    } while(!$flag)

    Write-Host "Determined using $count array operations" -ForegroundColor Green
    $x,$y,$w,$h
}

Using the inputs exactly as in the questions, where each is saved as a variable it would net me the answers as an array of integers and spit out a console line containing the amount of operations it took to find the dimensions.
$array1, $array2, $array3,$array4,$array5,$array6 | ForEach-Object{
    (Get-SquareCoordinates $_) -join ", "
}

Determined using 9 array operations
3, 2, 5, 3
Determined using 11 array operations
0, 0, 3, 3
Determined using 3 array operations
5, 0, 4, 5
Determined using 5 array operations
6, 2, 2, 4
Determined using 12 array operations
1, 1, 4, 3
Determined using 10 array operations
3, 7, 1, 1

My algorithm is more efficient when the box is near the beginning of a lengthy array, but yours crushes mine otherwise. I don't know how to get rid of my .lastIndexOf for every line of the box (other than coming from the end like you do).

@StephenS I don't have access to a lastindexof method so I had to do something different. Before an edit I turned the array row into a string and used the string lastindexof() method. Now I just count the ones in the row. Are you able to count your ones instead of using lastindex of?

Oh, wait, I think I found the difference. It was bugging me. You have $result = $array[$rowIndex].IndexOf(1) as one operation, I have it as two - we'll need to get OP's decision on that. I have it as an access separate from an indexOf, you have them together counted as one access. (and you have the same thing here: $result = $array[$rowIndex].IndexOf(1) + ($array[$rowIndex]-match1).Count - 1 - you count that as 2, I'm counting that as 3 - two accesses, one indexOf)

@StephenS.. hmmmm. You are right that is grey for me as well. I am just calling the indexof method on part of the array. The arrays used in this question are jagged arrays in powershell. an array of arrays. not a true 2d. So I don't see it as 2 ops. Either way the Q is closed so perhaps a new one will show up with more concrete guidelines

Yep, I understand - we'd need OP to clarify first. If it gets reopened we can worry about it. If I called indexOf and access together (and it counted as only one access) I'd save an operation a line. If OP clarifies and it gets reopened we can worry about it then

OP: "@StephenS Since it references only one item in the grid, I think that should count for one."


text:
Separate the psychopaths!
Dr. Trump is the head psychiatrist at a mental hospital, which is populated by murdering psychopaths. If 2 psychopaths are left together, they will end up brutally injuring or even killing each other, so Dr. Trump needs to build walls to separate these psychopaths, but owing to the limited amount of funds he has left, he has to minimise the number of walls he builds. Walls of a room can either be horizontal or vertical in nature and of any length.
Help Dr. Trump minimise the number of walls he builds to separate all the psychopaths in a 2*n psych ward.
Also, do keep in mind that the shortest code wins.
Input
The first 2 lines contains the position of psychopaths (denoted by '#') and empty spaces (denoted by '-').
Output
An integer which is equal to the minimum number of walls to build to separate all the psychopaths from each other.
Input Constraints
1 <= n <= 1000000
Sample Test Cases
Test Case 1
Sample Input
##########
##########

Sample Output
10

Test Case 2
Sample Input
#-#-#
-#-#-

Sample Output
3

Test Case 3
Sample Input
#-----
------

Sample Output
0

do you mean minimise the number of walls?

yes. You have to minimise the number of walls to be built, so that no psychopath ends up killing another.

The first part says minimise rooms, so you might want to edit that. btw maybe put spaces in Dr. Ake.

@ETHproductions- you are correct. i mistyped it. My bad

@DestructibleLemon- Thank you for pointing it out. I've made the necessary changes.

Testcase 1 seems unsolvable without placing walls on psychopaths. Is that allowed?

Why would you place walls on the psychopaths? There are 10 psychopaths in both lines: which means 9 walls between them to separate them from the one beside them. Then, put a wall in the middle to separate each pair of psychopaths. That makes a total of 10 @CalculatorFeline

I'd like this challenge a lot better if the doctor had a different last name. There's absolutely no need to bring politics into it.

This is borderline "Unclear what you're asking" because there are assumptions which aren't spelt out in the question. CalculatorFeline's comment illustrates one of them: there's no explanation of where the walls can be built. Another would be that the walls can cross each other for free (which would make much more sense if the question were about drawing lines rather than building walls: it already stretches common sense that the cost of a wall is independent of its length, and I can't find any rationalisation of that which allows + not to count as three walls).

@Dennis- Here's the deal. Everything need not be what it seems. Just because it says Dr. Trump need not imply that I am referring to the President of the United States. At this day and age, If I use any name, there will be at least one person in the world that will get offended by it, that need not mean that we stop our daily lives to think of ways to appease other people, because, quite frankly, I don't see the point of judging a programming challenge by the names attached to it.

@PeterTaylor- Any suggestions on how I can improve the language? This is just my second question here. Thanks in advance.

Python, 270 228 166 156 bytes
a=input();b=input();m=lambda s:[c=="#"for c in s];f=m(a);g=m(b);s=p=0
for i in range(len(a)):q=2*f[i]+g[i];r=p&q;s+=r!=0;p=r or p|q
print(s+(any(f)&any(g)))

PEP8-ified:
a = input()
b = input()
m = lambda s: [c == "#"for c in s]
f = m(a)
g = m(b)
s = p = 0
for i in range(len(a)):
    q = 2*f[i]+g[i]
    r = p & q
    s += r != 0
    p = r or p | q
print(s+(any(f) & any(g)))

Try it online!
This is my first time here, be gentle please ;)
There is always a horizontal wall in the middle, except when prisoners are only on one side -- the addition in print() takes this into account. Strategy here is to break horizontal bar into sections such that there is no more than one prisoner on each side, for each section.
The for loop uses an int, p, to hold two bit flags, indicating whether the current top/bottom section already contains a psychopath. We & this with the flags from the new gridsquare to check whether we are going to overflow, and need to place a wall; if so, we increment s. We also use p&q to decide how to update the state: if we overflow, we hold onto just the overflowed prisoner (p&q). Otherwise, we | the new prisoners onto our current prisoner state. Using and and or as a ternary operator again here.
There are some helper functions at the top, as well as throwaway variable names for values used more than once.
Edit:
It seems like this got simpler as it got shorter. It used to use all kinds of wacky behaviour

Nice answer, welcome to the site! I think you could do a,b=input() and have the input given with a comma between. I'm not sure if that's an allowed format though.

Thank you Wheat Wizard! Those are all useful. I had the spaces there because my editor didn't highlight the and when it was next to the number, guess it was lexing it wrong.

Thats a common parser problem, SE does it with its syntax highlighting as well.  Here is a version with my suggestions added  I noticed that you could also do s=p=0 to save some bytes.

A bit more convoluted but the second r!=0 can be replaced with just r.  If r is false it will short the and and return zero either way, if r is non-zero it will return r or(p|q) either way.

I get the logic, but can you show the running code here ?

Wheat Wizard: forgot 0 was false-y in Python, for some reason I had it in my head that all numbers were true. Thank you!


text:
Battle of the letters
Your task is simple: tell me who wins the battle of the letters.
The troops
There are three different "troops" in this battle, summarized by this table.
name | health | damage
   A       25       25
   B      100        5
   C       10       50

You may use any three unique characters to represent the the troops, but must specify if they are not these letters.
The battle
Suppose we have a sample battle:
ABC # army 1
CBA # army 2

Each army repeatedly fires at the leftmost unit, until it is dead; then they move to the troop to the right and repeat. So army 2 attacks A in army 1 until A is dead, then move to B, then C. Army 1 attacks C first, then B, then A. Assume the armies attack at the same time, and thus troops will always fire if they were alive before the round and can kill each other at the same time. They fire in order from left to right.
The battle would play out as so:
ABC
CBA

BC # A (25 hp) killed by C (-50 hp), B (100 hp) attacked by B (-5 hp) and A (-25 hp), has 70 hp
BA # C (10 hp) killed by A (-25 hp), B (100 hp) attacked by B (-5 hp) and C (-50 hp), has 45 hp

BC # B (70 hp) attacked by B (-5 hp) and A (-25 hp), has 40 hp
A  # B (45 hp) killed by B (-5 hp) and C (-50 hp)

BC # B (40 hp) attacked by A (-25 hp), has 15 health
   # A (25 hp) killed by B (-5 hp) and C (-50 hp), army 2 dead

Therefore, army 1 wins the battle!
Input
Two strings, the first representing army 1 and the second army 2. They are not necessarily the same size (because who said it would be a fair fight?)
Output
Any three unique, constant values to represent army 1 winning, army 2 winning, or the unlikely event of a tie. Yes, it is possible for the last troops to kill each other, ending in a tie.
Battles
ABC
CBA
Army 1

CCCCC
CCCCC
Tie

CABCAB
ABBABBA
Army 2

Standard loopholes apply. You must submit a full program.
This is code-golf, shortest solution wins.

"constant" Why?

Also, A beats B and C ties B and A ties C. Changing either of A's values to 20 would make it tie B.

Are we allowed to use a different input representation? Say, 012 instead of ABC?

@Grimy: Yes, I will edit the post.

Pyth 145 97 bytes
=Y.d[,\A,25 25,\B,*TT5,\C,T*5T)Km=G@YdzJm=H@YdwW&KJMX0hG_smedH gKJ gJKI<hhK0=tK)I<hhJ0=tJ;?K1?J2Z

A little less naive than before.
Try it online!
Explanations:
Let's cut the program in several parts.
=Y.d[,\A,25 25,\B,*TT5,\C,T*5T)

     ,\A,25 25                     Create this list: ['A', [25, 25]]
              ,\B,*TT5             Create this list: ['B', [100, 5]]
                      ,\C,T*5T     Create this list: ['C', [10, 50]]
  .d[                         )    From the three lists, create a dictionary whose keys are the letters, and values are the inner lists
=Y                                 Assign to the variable Y

The dictionary Y is: {'A': [25, 25], 'C': [10, 50], 'B': [100, 5]}. Then:
Km=G@YdzJm=H@YdwMX0hG_smedH

 m=G@Ydz                           For all letters in first input string, make a copy of Y[letter]. Make a list of all those values...
K                                  ...and assign the list to the variable K
         m=H@Ydw                   For all letters in second input string, make a copy of Y[letter]. Make a list of all those values...
        J                          ...and assign the list to the variable J
                MX0hG_smedH        Create a function g which takes two lists of couples, and subtract the sum of the second elements of the couples of the second list from the first element of the first couple of the first list

At this point, K is a list of couples that represents the first army. Each couple of this list is a letter of the army, and is (health, damage) for that letter. J is exactly the same, but for the second army. g is a function which takes two armies, and deals the damage made by the second army to the first one. Now:
W&KJ gKJ gJKI<hhK0=tK)I<hhJ0=tJ;

W&KJ                               While K not empty and J not empty
     gKJ                           Call g(K,J). That computes the damages to first army
         gJK                       Call g(J,K). That computes the damages to second army
            I<hhK0=tK)             If the first army's first letter is dead, remove it
                      I<hhJ0=tJ    If the second army's first letter is dead, remove it
                               ;   End of while loop

When the while loop is over, K and J have their final value. If they are both empty, it's a tie; otherwise the non-empty army win. That is handled by the last piece of code:
?K1?J2Z

?K1                                If K non-empty, display 1. Else...
   ?J2                             ...if J non-empty, display 2. Else...
      Z                            ...display zero

That's it!

Haskell, 199 193 179 176 171 bytes
a!b=(t<$>a)?(t<$>b)
t v=[(5,5),(20,1),(2,10)]!!(fromEnum v-65)
m=sum.map snd
f=filter((>0).fst)
[]?[]=0
[]?_=2
_?[]=1
a@((c,d):e)?b@((h,i):j)=f((c-m b,d):e)?f((h-m a,i):j)

Try it online!
Small trick: divided all the army stats by 5.

C#, 446 Bytes
using System.Linq;(c,d)=>{int z=c.Length,v=d.Length,j=0,k=0,l=0,m=0,q=0;int[]e=(c+d).Select(x=>x!='A'?x=='B'?100:10:25).ToArray(),f=e.Skip(z).ToArray();e=e.Take(z).ToArray();int[]g=(c+d).Select(x=>x!='A'?x=='B'?5:100:25).ToArray(),h=g.Skip(z).ToArray();g=g.Take(z).ToArray();try{for(;;){for(q=l;q<z;q++){if(e[j]<=0)j++;e[j]-=h[q];}for(q=k;q<v;q++){if(f[m]<=0)m++;f[m]-=g[q];}if(e[k]<=0)k++;if(f[l]<=0)l++;}}catch{}return k-z>=l-v?k-z>l-v?0:2:1;};

Formatted version:
         (c, d) => {
                int z = c.Length, v = d.Length, j = 0, k = 0, l = 0, m = 0, q = 0;

                int[] e = (c + d).Select(x => x != 'A' ? x == 'B' ? 100 : 10 : 25).ToArray(), f = e.Skip(z).ToArray();
                e = e.Take(z).ToArray();

                int[] g = (c + d).Select(x => x != 'A' ? x == 'B' ? 5 : 100 : 25).ToArray(), h = g.Skip(z).ToArray();
                g = g.Take(z).ToArray();

                try {
                    for (;;) {
                        for (q = l; q < z; q++) {
                            if (e[j] <= 0) j++; e[j] -= h[q];
                        }
                        for (q = k; q < v; q++) {
                            if (f[m] <= 0) m++; f[m] -= g[q];
                        }
                        if (e[k] <= 0) k++; if (f[l] <= 0) l++;
                    }
                }
                catch {
                }

                return k - z >= l - v ? k - z > l - v ? 0 : 2 : 1;
            };

Outputs 1 if army1 wins , 2 for army2 and 0 for tie

Can you add a formatted/expanded version? 446 bytes is high even for C# I'm sure there will be some improvements.

For starters you have multiple lines declaring int[] I think you can combine them, ``<=0is the same as<1surely? Do you need thetry-catch`?

Javascript (ES6) - 316 269 Bytes
I'm sure this can be golfed like hell, but this is what I've come up with :)
I managed to shave off 47 bytes though!
Outputs 0 for tie, 1 for Team 1 and 2 for Team 2.
l=(d,f)=>{for(t=[d,f].map(g=>g.split``.map(k=>[[25,100,10],[25,5,50]].map(m=>m[k.charCodeAt()-65])));(w=t.map(g=>g.some(k=>0<k[0])))[0]&&w[1];)t.forEach((g,k,m)=>m[k].sort(o=>0>o[0])[0][0]-=m[+!k].filter(o=>0<o[0]).reduce((o,p)=>o+p[1],0));return w[0]||w[1]?w[0]?1:2:0}

Readable:
function ltt(a,b){
    t=[a,b].map(x=>x.split``.map(c=>[[25,100,10],[25,5,50]].map(e=>e[c.charCodeAt()-65])))
    while((w=t.map(_=>_.some(x=>x[0]>0)))[0]&&w[1]){
        t.forEach((y,i,n)=>n[i].sort(j=>j[0]<0)[0][0]-=n[+!i].filter(x=>x[0]>0).reduce((h,v)=>h+v[1],0))
    }
    return(!w[0]&&!w[1])?0:(w[0])?1:2
}

Demo:

l=(d,f)=>{for(t=[d,f].map(g=>g.split``.map(k=>[[25,100,10],[25,5,50]].map(m=>m[k.charCodeAt()-65])));(w=t.map(g=>g.some(k=>0<k[0])))[0]&&w[1];)t.forEach((g,k,m)=>m[k].sort(o=>0>o[0])[0][0]-=m[+!k].filter(o=>0<o[0]).reduce((o,p)=>o+p[1],0));return w[0]||w[1]?w[0]?1:2:0}

var prnt=(g,h)=>{
  n=l(g,h);
  return(n==0)?"Tie!":`Team ${n} wins!`
}

console.log("ABCB - ABC: " + prnt("ABCB","ABC"));
console.log("BAAA - BBC: " + prnt("BAAA","BBC"));
console.log("AAAA - BBC: " + prnt("AAAA","BBC"));
console.log("ABC - BBC: " + prnt("ABC","BBC"));
console.log("ABC - CBA: " + prnt("ABC","CBA"));

Just noticed that current version can't evaluate ties, which the 316 byte version could. I'll look into it


text:
Create a folder
Challenge
Given an input x, create a directory (AKA folder) in the file system with the name x.
Languages that are not able to create file system directories are excluded from this challenge.
The directory may be created anywhere, as long as the location is writable to the user running the program. Assume that the program is run as a non-privileged user on a modern Linux (or Windows if needed) desktop system.
Clarifications

Assume that the current directory is $HOME/%USERPROFILE%.
Assume that no file or directory exists with the name given.
Assume that the filename will only contain the characters abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.
Assume that the filename will always be 8 characters long or shorter.

Rules

The directory must actually be created. You can't just say "I made it in /dev/null".
Standard loopholes apply.
This is code-golf.

Apart from leaving zero room for golfing (in what languages would the straightforward approach not be the shortest?), your challenge is also unclear. Does the third paragraph mean we have to create it in our home folder? Can we assume we're already there? What if a directory or file of the same name already exists?

Also, you might consider waiting a few minutes for feedback before complaining about the lack of it.

@Dennis Clarified.

Which characters can appear in the filename?

@Dennis a-zA-Z0-9 upto 8 chars

You should really start using the Sandbox, Mendeleev.

MATLAB/Octave, 6 bytes
@mkdir

Creates a function handle named ans to the built-in function mkdir which accepts the folder to be created as a string
ans('folder_to_create')
ans('/absolute/path/to/folder/to/create')

Where do you get input?

@Mendeleev It's passed to the function

all right, thanks for clarifying

Ruby, 11 + 1 = 12 bytes
+1 for -n
Dir.mkdir$_

Try it online!

Julia 0.5, 5 bytes
mkdir

Try it online!

Java, 33 31 bytes
-2 bytes thanks to @Phoenix - removing curly braces around lambda.
s->new java.io.File(s).mkdir();

In the form of a Consumer<String> where s is the name of the folder to create.

You don't need the curly brackets for a lambda like that, I think.

@Phoenix You are correct. Thanks!

Your code now has a curly brace on the end that you seen to have missed.

@Phoenix thanks again, I'm not very good at this ;P

Bash, 8 bytes
mkdir $1

Try it online!

Python, 18 bytes
import os
os.mkdir

Batch, 6 bytes
@md %*

Try it online!

can't you remove the @? other answers output to stdout as well

Go, 46 bytes
import."os"
func f(n string){Mkdir(n,ModeDir)}

Wolfram Language (Mathematica), 14 bytes
Run["md "<>#]&

Try it online!

The trivial approach is longer. Surprise! (demonstrates that Mathematica is very verbose)
Works on Windows only, where md is the command to create a directory. See this answer or this answer.

Explanation:
Run["md "<>#]&   Anonymous function.

    "md "        String literal "md ". (with a trailing space to separate
                   the command and the parameter (directory name)
           #     The input.
         <>      `StringJoin` together.
Run[        ]    Runs as a command.

Mathematica, 15 bytes
CreateDirectory

C#, 35 bytes
System.IO.Directory.CreateDirectory

Does what it says on the tin.

Batch, 2 bytes
md

md means make directory. Here it is in action:
C:\tmp>set f=md

C:\tmp>%f% foo

C:\tmp>dir f*.*
 Volume in drive C is OS
 Volume Serial Number is 6CC3-3025

 Directory of C:\tmp

02-Feb-18  09:56    <DIR>          foo
               0 File(s)              0 bytes
               1 Dir(s)  378,122,883,072 bytes free

APL (Dyalog Unicode), 6 bytes
Prefix function.
⎕MKDIR

Try it online!

tcl, don't know how to count
My count could be:

13, if everything on file mkdir $x is accounted.

12, if file mkdir $as how I have seen in some answers x is not taken into account

11, because in tcl whenever you use the value of x , you type $x, so only file mkdir  is taken into account

10, if is file mkdir by removing the trailing space from previous.

Source:
file mkdir $x

demo — Please reserve it for question asker. Look at files tree at the left where there is only root and main.tcl . Click the Execute button, it will run a script command on the green area; In the top of the files tree there is a Refresh button symbolized by an icon, click it and see folder1 and folder2 appearing.


text:
Tips for golfing in TeX/LaTeX
What tips do people have for golfing in TeX/LaTeX? Please post one tip per answer, each at least somewhat specific to TeX/LaTeX.

Context: I noticed this answer and that there is no tips question for TeX/LaTeX, so I'm creating this one. There's some overlap with the narrower question tips for golfing in TikZ (as TikZ is a specific macro package on top of TeX/LaTeX): answers to this question will probably also apply there, but not the other way around.

How can you golf a non-programming language?

@TheGreatDuck Very poorly :-)

@TheGreatDuck Actually, TeX is a programming language, even if usually it's used only as a typographical one.

Consider internal LaTeX macros rather than the documented ones
For example, \roman is a documented LaTeX macro that works on LaTeX counters. To turn 42 into XLIV you'd have to use something like
\newcounter{z}
\setcounter{z}{42}
\roman{z}

Instead, by looking up how \roman is implemented (use \show\roman to get this interactively, instead of reading the source files), one can see that it's implemented in terms of a useful macro called \@roman, and instead use that directly:
\catcode`@11
\@roman{42}

\catcode`@11 is the golfy way of writing \makeatletter (clean way in LaTeX) or \catcode`\@=11 (clean way in plain TeX). It's needed only once at the beginning, after this you can use macro names containing @.

~ can be used as a macro (as can other active characters)
Example
Before:
\def\a{...some definition...} ... use \a...

After:
\def~{...some definition...} ... use ~...

Explanation: Generally macros in TeX are “control sequences”: you can define \something or \a. But you can go even shorter, by using an active character. The only active character that is present by default (in plain TeX / LaTeX) is ~ (used for “ties”, i.e. defined as \penalty \@M \ in plain TeX (a penalty of 10000 followed by a space), and as \nobreakspace {} in LaTeX). But nothing stops you from redefining it for whatever purpose you need.
Further: you can do the same with any other character by setting its catcode to \active (13). For example, making Z an active character has a "cost" of 12 bytes: \catcode`Z13. Then you can use simply Z everywhere instead of a macro like \z. For some characters that start out with a special meaning, the direct backtick approach doesn't work and you need one more character: \catcode`\Z13 or \catcode90=13.

\def can match fixed patterns
Let's say you had \def\a #1 #2 {...some definition here...}. Then when you call it on a string like \a Act42, Scene26, inside the macro the arguments may be assigned like #1 <- Act42,, #2 <- Scene26 and then you'd have to do some further work to extract out the relevant parts. Instead, one could directly write
\def\a Act#1, Scene#2 {...some definition here...}

and then calling it as \a Act42, Scene26 would directly set #1 <- 42 and #2 <- 26.
(This is basically the definition of \def, but it's easy to forget as one doesn't typically do this in LaTeX, preferring to pass arguments into {} as if they were function calls.)

Choosing between plain TeX and LaTeX
A lot can be said about this, but in short, compare a typical plain TeX document that prints "Hello" with a typical LaTeX document for the same:
Hello
\bye

versus
\documentclass{article}
\begin{document}
Hello
\end{document}

The "cost" of LaTeX (wrt code golf) is obvious; the "benefit" of course is that LaTeX comes with a library of many pre-written macros and packages, some of which may be useful for the task at hand.

I was stuck into using LaTeX because of  \@Roman (getting the uppercase to work in plain would cost a lot of bytes) -- but plain TeX would often be shorter.

\input ... is shorter than \usepackage{...}
For example, you can write
\input color

instead of
\usepackage{color}

which is 6 less bytes.

It is useful to point out however that \usepackage becomes more efficient as the number of packages you include goes up.  Since you can use more than one package with only one \usepackage statement, but require an \input for every package, If you are using 3 or more packages, \usepackage becomes the better option.

If using LaTeX, use a short documentclass (idea by Chris H)
Instead of starting with the typical
\documentclass{article}

one can choose shorter document classes like book or even
\documentclass{ecv}

or
\documentclass{tui}

You should remember to stay within the specs of the question,  article by default numbers its pages, this can be considered extra output.  Perhaps a meta question is  in order to determine what document classes should be allowed.

@WheatWizard Good point. I think it may be up to the individual question whether page numbers are considered extra output.

I reckon a minimal class would be a good idea - a single letter name and no page numbering

I've put together a g.cls which is just article.cls with \pagenumbering{gobble} but as github is down I can't put it up for now

g.cls

Creating an environment called myenvironment generates the commands \myenvironment and \endmyenvironment. These are used internally to begin and end the environment. In some cases they can be used as shortcuts. For example, instead of
\begin{itemize}
\item abc
\end{itemize}

one can do
\itemize
\item abc
\enditemize

Not supported, not reliable, doesn't work in all cases, use at your own peril, etc. etc.

You can often do \itemize{...} for even more savings.

Run lines together.  Line breaks are rarely needed in LaTeX/TeX, as compared to many long-form languages.

\usepackage{packagea,packageb,packagec} works, so long as you're not passing options to the packages.

Use local { ... } groups wisely
As pointed out in this answer, active characters like ~ can be used as a macro name. Unfortunately, ~ is the only active character by default, and changing the catcode for another character is expensive: \catcode`!13 takes 12 bytes. If the new macro definition is only needed in a small region of your code, local groups can be a solution.
When TeX enters a new local group opened by {, it creates a new grouping level on the internal save stack. This means that all current macros and registers are saved. Any modifications to them (unless explicitly marked as \global) are now only being active until the group is closed by }. This means that ~ can be redefined within a group, used there with the new definition, and the old defintion will automatically be restored after the group has finished.
Here's an example:
\def~{abc}
~ -- {\def~{123}~} -- ~

This outputs

abc - 123 - abc

An interesting side effect of this grouping mechanism is that the old values are still available inside the group until they are changed there. To illustrate that, imagine we want to print a number of characters based on the value of a counter, pad them with spaces up to a fixed length, and go on with the original counter value. This could be achieved by the following:
\newcount\x
\x=3
Print a char \the\x\ times,
{\x=-\x \advance\x 10 pad with \the\x\ spaces,}
and go on with x=\the\x.

which outputs

Print a char 3 times, pad with 7 spaces, and go on with x=3.

This grouping behaviour is especially important if you want to use TeX's standard macros for looping \loop ... \repeat nested. These macros define internal commands and use them for determining how to proceed. Nesting them without putting the inner loop into braces will confuse the internal commands and lead to unexpected behaviour.

Some macros that you might expect to need braces round their arguments actually don't, especially when used inside another macro with #1-style arguments.
Most macros only need braces if there's more than one token (character or control sequence) in the argument.
\mymacro1          % equivalent to \mymacro{1}
\mymacro{12}       % equivalent to \mymacro{12}
\mymacro a         % equivalent to \mymacro{a}
\mymacro{ab}       % equivalent to \mymacro{ab}
\mymacro\foo       % equivalent to \mymacro{\foo}
\mymacro{\foo x}   % equivalent to \mymacro{\foo x}

If you need to use the same macro with a long name several times, you can use \let to define a shorter alias.
\let\a\mymacrowithalongname
\a{foo}\a{bar}\a{qux}

This saves two bytes on \def\a{\mymacrowithalongname}, if you don't need multiple tokens in the definition.
Instead of a macro name, you can have an active character to save on backslashes.
Note that \let doesn't only work with macro names but also with built-in primitives. For example, if you use a lot of \ifnum ... \fi constructs in your code, defining \let\i\ifnum and instead using \i ... \fi could save you a few bytes. This even works for \let itself: \let\l\let.

The advancement of counters, such as
\advance\u by 1
\multiply\u by 3
\divide\u by 2

also work as
\advance\u1        % \u = \u + 1
\advance\u-1       % \u = \u - 1
\multiply\u3       % \u = \u * 3
\multiply\u\u      % \u = \u * \u
\divide\u2         % \u = \u / 2

The same principle also works for initialisation:
\newcount\u\u1

sets the counter \u to 1.
Do note that these do need a whitespace character (linebreak or space) after them (or a \relax, but whitespace does the same) so the next command won't be ignored. For example,
\u1\the\u

does NOT print \u, but ignores the \the command.

\enddocument instead of \end{document} saves two characters

Doesn't seem to work for \begin{document} => \document though

\stop is even shorter and works often, too.


text:
Is it Covfefey?
Based on this challenge, you must determine if a string is covfefey, that is, could it have been produced as output from a covfefifier?
The string will be composed of only alphabet chars (^[a-z]\*$, ^[A-Z]\*$ are possible schemes for input. change the regexs appropriately if using caps)
To do this, there are a few checks you must do:
Do the last four characters follow this scheme:
([^aeiouy][aeiouy])\1

example:
fefe

follows this scheme.
is this consonant at the start of the ending the voiced or voiceless version of a consonant immediately before it?
consonant pairings follow this key. find the consonant occuring before the end part consonant we had, and check whether the end part consonant is there
b: p
c: g
d: t
f: v
g: k
h: h
j: j
k: g
l: l
m: m
n: n
p: b
q: q
r: r
s: z
t: d
v: f
w: w
x: x
z: s

does the first part of the word, the part that does not include the ([^aeiouy][aeiouy])\1, follow this regex:
[^aeiouy]*[aeiouy]+[^aeiouy]

That is, does it contain one group of vowels, and exactly one consonant after that vowel?
If it fulfills all these criteria, it is covfefey.
Output a truthy value if covfefey, otherwise falsy
Test cases
covfefe -> truthy
barber  -> falsy
covefefe -> falsy
pressisi -> falsy
preszizi -> truthy
prezsisi -> truthy
president covfefe -> You don't need to handle this input as it contains a space.
cofvyvy -> truthy
businnene -> falsy (the first part does not follow the regex)

the logical followup to this question is is it covfefey-ey, which outputs if it follows the contruction of covfefey

You should use proper formatting, grammar and spelling in your posts. Just btw :P

So we have to capitalize "truthy"/"falsy" iff the input starts with p?

@CalculatorFeline "Output a truthy value if covfefey, otherwise falsy"

@Arnauld yes it may return null or false

Suggested test case: businnene (which is not a covfefeication of "business")

Someone please code this in TrumpScript.

Proposed test case of exxaxa from the linked Covfefey a string challenge.

Jelly, 56 bytes
5ịØYiị“ßȷ%Hẹrȧq’œ?ØY¤⁾cgy
Ṛµ4,2ị=ÇȦ
Çȧe€ØyµḄ%⁴⁼5ȧŒgLe5,6

A monadic link taking a list of lowercase characters and returning 1 for truthy and 0 for falsey.
Try it online! or see the test suite.
How?
5ịØYiị“ßȷ%Hẹrȧq’œ?ØY¤⁾cgy - Link 1, convert 5th character: list of characters, r
5ị                        - index into r at 5
  ØYi                     - first index of that in "BCDF...XZbcdfghjklmnpqrstvwxz"
                    ¤     - nilad followed by link(s) as a nilad:
      “ßȷ%Hẹrȧq’          -   base 250 number = 1349402632272870364
                  ØY      -   yield consonants-y = "BCDF...XZbcdfghjklmnpqrstvwxz"
                œ?        -   nth permutation    = "BCDF...XZpctvkhjglmnbqrzdfwxs"
     ị                    - index into that (converts a 'b' to a 'p' etc..)
                     ⁾cg  - literal ['c','g']
                        y - translate (convert a 'c' to a 'g' - a special case)

Ṛµ4,2ị=ÇȦ - Link 2, check the 3 consonants at the end: list of characters, w
Ṛ         - reverse w
 µ        - monadic chain separation, call that r
  4,2     - 4 paired with 2 = [4,2]
     ị    - index into r
       Ç  - call the last link (1) as a monad (get 5th char converted)
      =   - equal? (vectorises)
        Ȧ - any and all (0 if empty or contains a falsey value, else 1)

Çȧe€ØyµḄ%⁴⁼5ȧŒgLe5,6 - Main link: list of characters, w
Ç                    - call last link as a monad (1 if the 3 consonants are good; else 0)
    Øy               - vowel+y yield = "AEIOUYaeiouy"
  e€                 - exists in? for €ach c in r
 ȧ                   - logical and (list of isVowels; or 0 if link 2 returned 0)
      µ              - monadic chain separation, call that v
       Ḅ             - convert from binary (0 yields 0)
         ⁴           - literal 16
        %            - modulo (0 yields 0)
          ⁼5         - equals 5? (1 if ending is consonant,vowel,consonant,vowel; else 0)
             Œg      - group runs of v (e.g. [0,0,0,1,1,0,1,0,1]->[[0,0,0],[1,1],[0],[1],[0],[1]])
            ȧ        - logical and (the grouped runs if AOK so far, else 0)
               L     - length (number of runs)
                 5,6 - 5 paired with 6 = [5,6]
                e    - exists in (the number of runs must be 5 or 6 to comply)

JavaScript (ES6), 109 108 bytes
Returns true for covfefey / null or false otherwise.
s=>(m=s.match`^[^aeiouy]*[aeiouy]+(.)((.)[aeiouy])\\2$`)&&((a="bcdfgszkvtgp")[11-a.search(b=m[1])]||b)==m[3]

Test cases

let f =

s=>(m=s.match`^[^aeiouy]*[aeiouy]+(.)((.)[aeiouy])\\2$`)&&((a="bcdfgszkvtgp")[11-a.search(b=m[1])]||b)==m[3]

;[
  "covfefe",
  "barber",
  "covefefe",
  "pressisi",
  "preszizi",
  "prezsisi",
  "cofvyvy",
  "exxaxa"
]
.map(s => console.log(s, '-->', f(s)))

Java 8, 211 210 166 163 161 156 bytes
s->{int l=s.length()-5;return"bpbdtdfvfgkgszshhjjllmmnnqqrrwwxxcg".contains(s.substring(l,l+2))&s.matches("[^x]*[x]+(.)((.)[x])\\2".replace("x","aeiouy"));}

-2 bytes by replacing the regex [^x]*[x]+[^x]([^x][x])\\1 with [^x]*[x]+(.)((.)[x])\\2 thanks to @Arnauld's JavaScript answer.
Explanation:
Try it here.
s->{                   // Method with String parameter and boolean return-type
  int l=s.length()-5;  //  Temp integer value with the length of the input-String - 5
  return"bpbdtdfvfgkgszshhjjllmmnnqqrrwwxxcg".contains(s.substring(l,l+2))
                       //   Return if the correct pair is present at the correct location
                       //    (i.e. `vf` at index l-5 + l-6 in the String `convfefe`
   &s.matches("[^x]*[x]+(.)((.)[x])\\2".replace("x","aeiouy"));
                       //    and if the String matches the regex-pattern
}                      // End of method

Perl, 80 bytes
$_=/[aeiouy]+(*COMMIT)(.)((.)[aeiouy])\2$/&&$3eq$1=~y/bcdfgkpstvz/pgtvkgbzdfs/r

Run with perl -pe.
Due to their length, it’s not often that I get to use the exotic regex verbs in golf, but this challenge is a perfect fit!
Whenever the engine backtracks to (*COMMIT), the entire match fails. This guarantees that the part that comes before it, [aeiouy]+, can only ever match the first thing it tries to match, namely the first continuous stretch of vowels. Thus, [aeiouy]+(*COMMIT)(.) is equivalent to ^[^aeiouy]*[aeiouy]+([^aeiouy]) (equivalent in terms of which strings match, but matches are on different positions).

PHP , 121 Bytes
$v=aeiouy;echo preg_match("#^[^$v]*[$v]+([^$v])(([^$v])[$v])\\2$#",$argn,$t)&$t[3]==strtr($t[1],bcdfgkpstvz,pgtvkgbzdfs);

Try it online!