text:
Find the longest uninterrupted arc in N dimensions
See similar question for 2D case: Find the longest uninterrupted arc
The challenge here is to find the longest uninterruped great circle arc around a unit hypersphere in N dimensions, with a random amount of hyperspheres distributed in random positions around it.
Here is a diagram in two dimensions to assist my explanation:

All hyperspheres around the edge have a radius of 0.5, although in this diagram, for illustration purposes only, they are smaller.
The distance of every hypersphere from the origin at the centre is 1.
The red line indicates the largest arc between any two hyperspheres that is not interrupted by any other hypersphere. The challenge is to find the two points on either end of the red line. The green line is simply the straight line distance.
A clarification about what interrupted means: When drawing an arc around the edge of the unit hypersphere of radius 1 (the red line), this arc should not be intersected by any other hypersphere.
Your function should take an array of double[][] and return the indices of the two hyperspheres with the largest uninterrupted arc.
int[] FindPair(double[][] points)
{
   return new[]{ 0, 1}; //Find the indices of the two points
}

The points array contains all of the positions of the hyperspheres in N dimensions, for example:
points[i] = {x, y} //2D
points[i] = {x, y, z} //3D
points[i] = {x, y, z, a} //4D
...

Extra clarification:

All points in the input define a circle, sphere or hypersphere with a diameter of 1 (radius 0.5)
The two points outputted define the start and end of an arc drawn around the edge of a hypersphere with origin 0,0 and radius 1. (Great circle arc).
If any other hypersphere than the two outputted hyperspheres intersects the arc then the solution is invalid.
You can assume that the distance from the origin of all given hyperspheres is 1.
If there is no valid solution (all arcs are intersected by other hyperspheres) then the function should output an empty array
Arcs between two points which are perfectly antipodal should be disregarded, since there exist infintely many great circle arcs between antipodal points
Do not worry about cases in less than two dimensions
For purposes of numerical error, you can assume that epsilon is 1e-16. This means that you can assume that the result is not changed if the input is changed not more than 1e-16.

The answer with the smallest Big O algorithm complexity wins. In case of a tie, shorter code wins.
Test case 1 (2D):
Points: {
  { -0.71997 , -0.69400 },
  { 0.88564 , 0.46437 },
  { 0.78145 , -0.62397 },
  { 0.98409 , -0.17765 },
  { 0.88220 , 0.47087 },
  { 0.69938 , 0.71475 },
  { -0.89036 , -0.45526 },
  { -0.70588 , -0.70833 },
  { 0.70507 , 0.70914 },
  { -0.34971 , 0.93686 }
}

There is only one valid arc here which is:
{2, 3}

Test case 2 (2D):
Points: {
  { -0.71038 , 0.70382 },
  { 0.04882 , 0.99881 },
  { -0.53250 , -0.84643 },
  { -0.86814 , -0.49632 },
  { 0.97588 , -0.21829 },
  { 0.73581 , -0.67719 },
  { 0.88413 , -0.46724 },
  { -0.28739 , -0.95781 },
  { -0.68325 , 0.73019 },
  { 0.91879 , 0.39475 },
  { 0.65335 , 0.75706 },
  { -0.21009 , -0.97768 },
  { -0.94542 , -0.32585 },
  { 0.83207 , -0.55467 },
  { 0.99482 , 0.10170 },
  { 0.86228 , 0.50643 },
  { 0.98017 , 0.19817 },
  { 0.67520 , 0.73763 },
  { -0.03982 , -0.99921 },
  { -0.57624 , -0.81728 }
}

Again only one valid arc which is:
{0, 8}

Test case 3:(3D)
Points = {
    { 0.01973 , -0.99317 , -0.11502 },
    { -0.71738 , -0.67848 , 0.15822 },
    { 0.84743 , -0.50733 , -0.15646 },
    { 0.87628 , 0.25076 , 0.41140 },
    { -0.48299 , 0.50965 , -0.71202 },
    { 0.69096 , 0.57799 , -0.43417 },
    { 0.51743 , 0.67876 , 0.52110 },
    { 0.78261 , -0.45122 , -0.42886 },
    { 0.40781 , -0.46859 , -0.78366 },
    { 0.65068 , -0.64966 , 0.39314 },
    { -0.09253 , 0.95421 , 0.28447 },
    { -0.01408 , 0.38357 , 0.92340 },
    { 0.57281 , 0.65041 , -0.49885 },
    { 0.19617 , -0.24506 , -0.94945 },
    { -0.51822 , 0.34419 , 0.78293 },
    { 0.46704 , -0.14902 , 0.87159 },
    { -0.71731 , 0.68775 , 0.11162 },
    { -0.37867 , -0.17063 , 0.90967 },
    { -0.75267 , 0.03982 , 0.65719 },
    { -0.56779 , 0.34520 , -0.74730 }
}

There are 19 valid arcs here, the largest of which is:
Answer: {1, 9}

Test case 4: (4D)
Points = {
    { -0.29024 , 0.35498 , -0.79921 , -0.79921 },
    { -0.62641 , 0.38217 , -0.54689 , -0.54689 },
    { -0.15500 , 0.97029 , -0.14852 , -0.14852 },
    { 0.39689 , 0.40861 , -0.68332 , -0.68332 },
    { 0.71300 , -0.29992 , -0.60949 , -0.60949 },
    { 0.49510 , 0.64115 , 0.30312 , 0.30312 },
    { -0.01944 , -0.94146 , 0.07992 , 0.07992 },
    { 0.50442 , -0.42007 , -0.44106 , -0.44106 },
    { 0.12829 , 0.34220 , -0.62093 , -0.62093 },
    { -0.60989 , -0.52113 , -0.58193 , -0.58193 },
    { 0.21290 , 0.50385 , 0.66164 , 0.66164 },
    { -0.63566 , 0.04453 , 0.18066 , 0.18066 },
    { -0.02630 , 0.86023 , 0.50700 , 0.50700 },
    { 0.90530 , 0.08179 , -0.41634 , -0.41634 },
    { 0.49062 , -0.51654 , 0.43727 , 0.43727 },
    { -0.56405 , 0.57448 , -0.32617 , -0.32617 },
    { 0.14677 , -0.14756 , 0.77293 , 0.77293 },
    { -0.16328 , -0.37123 , 0.49193 , 0.49193 },
    { -0.46471 , 0.07951 , 0.43186 , 0.43186 },
    { -0.54567 , 0.43537 , -0.49301 , -0.49301 }
}
There are 16 valid arcs here, the largest of which is:
Answer: {9, 17}

Can I have an explanation for the down vote?

Who knows... (side note: it's extremely unlikely that a point can lie exactly on a line segment (or an arc segment) (almost zero-probability) so just output the furthest pair is almost always correct.)

@user202729 His points are large, but I didn't read clear to know how it large

@user202729: I think you are assuming that the points have a radius of zero and have to lie on the arc exactly, but the points define a sphere of radius 0.5 and any part of that sphere can intersect the arc for the solution to be invalid.

"I think you are assuming that the points have a radius of zero". I don't think anyone would assume that, because points don't have a radius. They have a position and nothing else. This question is not well specified without a detailed treatment of numerical analysis issues.

@user202729 you're correct, I've updated the question. The distance of all points from the origin is 1, so the centre hypersphere has a radius of 1 and so should all arcs drawn.

@Peter Taylor: although I am calling them 'points' I have stated in the question that all points define a hypersphere of radius 0.5.

user202729: Yes the spheres are large. The background for this question is that I am interested in this problem's relation to the kissing number problem, so the spheres need to have the same size as in that problem.

Ah, I thought that that was a badly worded statement that all of the points lie on the same (hyper)sphere, and I hadn't noticed that it contradicted the fourth point on the radius of that (hyper)sphere. I think it would be better to replace the current points 1 and 3 with a single statement that an arc (segment) is interrupted if any point other than an endpoint is within r of it. But that still doesn't solve the ambiguity over numerical analysis issues: cases where two points are nearly antipodal, or where the distance between P and arc QR is within epsilon of r.

It also raises a new issue: what if there is no valid arc?

Arcs between antipodal points can be disregarded since there exist infinitely many of them.
If there is no valid arc then the function should output an empty array.
I've updated the question to make things clearer.

As defined, if any points have a chord length of less than 0.5 between them they can only be paired with each other or other points within both spheres. Otherwise the arc on the great circle will have to pass through. This invalidates the solutions you have for at least some of your 2d circles

If you consider the hyperspheres to be filled, any point with at least 2 points with a distance less than 0.5 units from it invalidates all points within that distance. This leaves only sets (3,4) and (1,7) for your first example.

I will re-run the test cases taking that into account and correct the solutions.

For the first example, the distance between point 2 and 3 is 0.49 which invalidates (3, 4).
The distance between 1 and 4 is 0.0074 which invalidates (1, 7)

I have changed the test cases to what is given by my answer below, which as far as I can tell should be correct but no guarantees.

The numbers I was giving are 1 indexed while you were referring to 0 indexed points. I also think I lost one of the points when running my test ({ -0.89036 , -0.45526 },).

The best solution I have found so far. Involves sampling points. Any suggestions for improvement would be appreciated. It is also the algorithm I have used to generate the test cases, so if it is incorrect, the test cases may be incorrect.
C#, O(N^3), lots of bytes
    private const double Epsilon = 1e-16;

    public static int[] Find(double[][] points)
    {
        var p1 = 0;
        var p2 = 0;
        var maxDist = 0d;
        //Compare each sphere with each other sphere
        for (var i = 0; i < points.Length - 1; i++)
        {
            for (var j = i + 1; j < points.Length; j++)
            {
                var d = FindMaxDist(points, i, j, 100);
                if (d > maxDist)
                {
                    p1 = i;
                    p2 = j;
                    maxDist = d;
                }
            }
        }

        if (maxDist > 0)
        {
            return new[] { p1, p2 };
        }
        return new int[] { };
    }

    private static double FindMaxDist(double[][] points, int p1, int p2, int sampleCount)
    {

        var originalDist = Dist(points[p1], points[p2]);

        //Disregard antipodal points
        if (originalDist > 2-Epsilon)
            return 0;

        var dimensions = points[0].Length;
        var vector = new double[dimensions];

        //Find the straight line vector between the two points
        for (var j = 0; j < dimensions; j++)
            vector[j] = (points[p1][j] - points[p2][j]);

        //Generate samples along the arc
        var pointSamples = new double[sampleCount][];
        for (var i = 0; i < sampleCount; i++)
        {
            pointSamples[i] = new double[dimensions];
            //Clone the vector before resizing to avoid numerical error due to multiple resizes
            var newV = ClonePoint(vector);
            //How far are we along the line between the two points depending on the current sample number?
            var newLength = (1 / ((double)sampleCount + 1)) * (i+1) * originalDist;
            ResizeVector(newV, newLength);

            //Set the position of the sample
            for (var j = 0; j < dimensions; j++)
                pointSamples[i][j] = points[p1][j] - newV[j];

            //The sample will lie on a straight line between the two points, not an arc
            //Scale it so that it lies a distance of 1 from the origin, in order to be on the arc
            ResizeVector(pointSamples[i]);
        }

        //Now simply check the samples for intersections
        for (var i = 0; i < sampleCount; i++)
        {
            for (var j = 0; j < points.Length; j++)
            {
                if (j == p1 || j == p2)
                    continue;

                var d = Dist(points[j], pointSamples[i]);
                if (d < 0.5)
                    return 0;
            }
        }
        return originalDist;
    }

    //The distance between two points
    public static double Dist(double[] d1, double[] d2)
    {
        double dist = 0;
        for (var i = 0; i < d1.Length; i++)
        {
            var diff = d1[i] - d2[i];
            dist += diff * diff;
        }
        return Math.Sqrt(dist);
    }

    public static double[] ClonePoint(double[] point)
    {
        var p = new double[point.Length];
        Array.Copy(point, p, point.Length);
        return p;
    }

    public static void ResizeVector(double[] pos, double targetLength = 1)
    {
        var currentLength = VectorLength(pos);
        var scale = targetLength / currentLength;
        for (var i = 0; i < pos.Length; i++)
            pos[i] *= scale;
    }

    public static double VectorLength(double[] vector)
    {
        double length = 0;
        for (var i = 0; i < vector.Length; i++)
            length += vector[i] * vector[i];
        return Math.Sqrt(length);
    }


text:
Function clipboard: copy
This challenge is related to some of the MATL language's features, as part of the May 2018 Language of the Month event. Associated challenge: Function clipboard: paste.

Introduction
MATL has several clipboards, where  you can store values (copy) to be retrieved later (paste). Some clipboards are automatic, which means that copying is automatically triggered by certain events. This challenge focuses on one of the automatic clipbards, called the function-input clipboard, or simply function clipboard.
This clipboard stores the inputs to the four most recent calls to normal, input-taking functions. Normal functions are the most common type of functions in MATL. Input-taking means that the function takes at least one input (functions that do not take any input are not considered by the function clipboard).
This is best explained with the following examples, which use two normal functions:

+, which pops two numbers from the stack and pushes their sum.
U, which pops one number and pushes its square.

Example 1:
3 2 + 6 + 12 4 U + +

produces the result 39. The code is interpreted as follows:

Number literals such as 3 or 12 get pushed to the stack
Functions such as + pop their inputs and push their outputs to the stack.

The function calls, in chronological order, are:

3 2 + gives 5
5 6 + gives 11
4 U gives 16
12 16 + 28
11 28 + gives 39.

The clipboard can be viewed as a list of four lists. Each inner list contains the inputs to a function call, with most recent calls first. Within each inner list, inputs are in their original order.
So after running the code the clipboard contents are (in Python notation):
[[11, 28], [12, 16], [4], [5, 6]]

Example 2:
10 20 U 30 +

leaves numbers 10 and 430 on the stack. The stack is displayed bottom to top at the end of the program.
The function calls are

20 U gives 400
400 30 + gives 430

Since there have been only two function calls, some of the inner lists defining the clipboard will be empty. Note also how 10 is not used as input to any function.
Thus, the clipboard contents after running the code are:
[[400, 30], [20], [], []]

Example 3 (invalid):
10 20 + +

is considered invalid, because an input to the second + is missing (in MATL this would implicitly trigger user input).
The challenge
Input: a string S with number literals, + and U, separated by spaces.
Output: the contents of the function clipboard after evaluating the string S.
Clarifications:

You may use any two consistent symbols to represent those functions, other than digits. Also, you can use any consistent symbol as separator, instead of space.
Only the two indicated functions will be considered.
The input string will contain at least one number literal and at least one function.
All numbers will be positive integers, possibly with more than one digit.
It is possible that some number literals are not used by any function, as in the example 2.
The input is guaranteed to be valid code, without requiring additional numbers. So a string as in example 3 will never occur.
Trailing empty inner lists in the output can be ommited. So the result in example 2 can be [[400, 30], [20]]
Any reasonable, unambiguous output format is acceptable. For example, a string with comma as inner separator and semicolon as outer separator: 400,30;20;;.

Additional rules:

Input and output can be taken by any reasonable means.
Programs or functions are allowed, in any programming language. Standard loopholes are forbidden.
Shortest code in bytes wins.

Test cases
Input
Output

3 2 + 6 + 12 4 U + +
[[11, 28], [12, 16], [4], [5, 6]]

15 3 4 + 2 U 8 + U +
[[7, 144], [12], [4, 8], [2]]

3 6 9 12 + + 10 8 U 6
[[8], [6, 21], [9, 12], []]

8 41 12 25 4 5 33 7 9 10 + + + + + + + +
[[41, 105], [12, 93], [25, 68], [4, 64]]

10 1 1 + U U U U U
[[65536], [256], [16], [4]]

Is [[28, 11], [16, 12], [4], [6, 5]] valid output for the first example?

@ovs No, inputs within each inner list must be in the original order, that is, as in the function call

Hm, are we discouraged from, eh, just solving this in MATL? :P

@EriktheOutgolfer Not discouraged at all :-) But bear in mind that MATL doesn't have an eval function

@LuisMendo Oh man, you destroyed my joke!

Is this clipboard M?

@Giussepe Exactly! I haven’t mentioned that name here because we are not using function M. I will do it in the “paste” challenge

Can I output in reverse order?

@Cowsquack Nope, sorry

Just to clarify, given input 3 2 + 6 + 12 4 U + +, which of these would be valid [[11, 28], [12, 16], [4], [5, 6]], [[5, 6],[4],[12, 6],[11, 28]], [[6, 5],[4],[6, 12],[28, 11]], [[28, 11], [16, 12], [4], [6, 5]]?

@Cowsquack Only the first. Calls are in reverse chronological order, inputs within each call are in their original order

Thanks, my answer should now be fixed

@Cowsquack Yes, it works perfectly!

05AB1E, 20 bytes
A"D¸ˆn‚DˆO"4ô‡.V¯R4£

Try it online!
-4 thanks to Emigna (as well as -8 thanks to him updating me about rules).

U: a
+ : b

:( ...Why so seRïõS?

@LuisMendo This score is so seRïõSly £arge. :(

Let us continue this discussion in chat.

Bash, 43 bytes
sed s/+/rdnFPrp+/g\;s/U/p2^/g|dc|tac|sed 4q

Try it online!
This prints the clipboard in the following format, note the usage of \x0F as the separator.
item_1\x0Fitem_2
item_3
.
.
item_m\x0Fitem_n

The key idea is to pass this into dc, a stack-based language, such that the required stack items will be printed.
The input is piped to sed where every + is replaced with rdnFPrp+, which in dc prints the second number on the stack followed by \x0F and then the top number before performing addition. sed also replaces every U with p2^, print the top stack element and square it.

The first substitution command s replaces all, as is denoted by the global flag g, +s with rdnFPrp+. In dc, r swaps the top two stack items, d duplicates the top item, n prints it without a newline, F pushes 15 onto the stack and P prints it as a character (which is the delimiter), r swaps again, p prints the top stack item and then + performs addition on the top two stack items.
We have another command, and in sed, commands are separated by either semicolons or newlines, of which the first option is chosen. Simply having ; will make bash interpret that as the end of the sed command, so it is escaped with a \.
In the last substitution command, U is replaced globally with p2^. In dc, p prints, and 2^ raises it to the second power.

The result of sed is eval'ed as dc code, printing the entire clipboard.

The pipe to dc makes dc interpret that as dc code. Now, the most recent calls are at the bottom and the older ones at the top.

Since the lines are in reverse order, tac (reverse cat) is used to fix that.
And finally, sed picks the first 4 lines from tac.

This is a shorter way of doing head -4. sed performs the commands to every line of the input one at a time. If there are no commands, nothing is done to the input, and it is returned as it is. 4q tells sed to perform the command q on line 4. When sed is processing line 4 of the input, the first three inputs have already been printed. The command q quits the program, so it prints the fourth line and quits, thus performing the equivalent of head -4.

Python 2, 126 bytes
s=[0];b=[]
for c in input().split():k='U+'.find(c)+1;b=[s[k-1::-1]][:k]+b;s=[int([c,s[0]**2,sum(s[:2])][k])]+s[k:]
print b[:4]

Try it online!

Haskell, 113 109 bytes
take 4.([]#).words
x:y:s#"+":r=(x+y:s#r)++[[y,x]]
x:s#"U":r=(x*x:s#r)++[[x]]
s#n:r=read n:s#r
_#_=[]
infix 4#

The first line defines an anonymous function which takes a string, e.g. "3 2 + 6 + 12 4 U + +", and returns a list of lists of ints: [[11,28],[12,16],[4],[5,6]]. Try it online!

JavaScript (ES6), 107 bytes
Takes input as a list consisting of integers, '+' and 'U'. Returns another list consisting of integers, arrays of 2 integers and '_' for empty slots.
a=>a.map(x=>s.push(+x?x:(c=[x>[a=s.pop(),r=a*a]?a:[r=s.pop(),(r+=a,a)],...c],r)),s=[c='___'])&&c.slice(0,4)

Try it online!
Commented
a =>                          // a[] = input array
  a.map(x =>                  // for each entry x in a[]:
    s.push(                   //   update the stack:
      +x ?                    //     if x is a positive integer:
        x                     //       push x onto the stack
      :                       //     else:
        ( c = [               //       update the clipboard:
            x > [             //         compare x with '['
              a = s.pop(),    //         a = first operand
              r = a * a       //         use a² as the default result
            ] ?               //         if x is 'U' (greater than '['):
              a               //           save the 1st operand in the clipboard
            :                 //         else:
              [ r = s.pop(),  //           r = 2nd operand
                (r += a, a)   //           add the 1st operand
              ],              //           save both operands in the clipboard
            ...c              //         append the previous clipboard entries
          ],                  //       end of clipboard update
          r                   //       push r onto the stack
        )                     //
    ),                        //     end of stack update
    s = [c = '___']           //   initialize the stack; start with c = '___'
  ) &&                        // end of map()
  c.slice(0, 4)               // return the last 4 entries of the clipboard

Clean, 140 bytes
import StdEnv,Text
k[a,b:n]["+":s]=k[a+b:n]s++[[b,a]]
k[a:n]["U":s]=k[a^2:n]s++[[a]]
k n[v:s]=k[toInt v:n]s
k _[]=[]
$s=k[](split" "s)%(0,3)

Try it online!
In classical Clean style, it's the Haskell solution except about 50% longer.

Go, 305 303 295 bytes
Dropped 8 bytes thanks to @ovs
func e(s string){b,v,w,x,r:=[][]int{{},{},{},{}},[]int{},0,0,0;for _,d:=range Split(s," "){if d=="+"{w,x,v=v[0],v[1],v[2:];r=w+x;b=append([][]int{[]int{x,w}},b...)}else if d=="U"{w,v=v[0],v[1:];r=w*w;b=append([][]int{[]int{w}},b...)}else{n,_:=Atoi(d);r=n};v=append([]int{r},v...)};Print(b[0:4])}

Try it online!

Octave, 206 bytes
s=strsplit(input(''));m=t=[];for z=s
if(q=str2num(p=z{1}))t=[t q];else
if(p-43)m{end+1}=(k=t(end));t(end)=k^2;else
m{end+1}=(k=t(end-1:end));t(end-1:end)=[];t(end+1)=sum(k);end
end
end
m(1:end-4)=[];flip(m)

Try it online!
If only Octave had a pop syntax. m is the memory clipboard, t the stack.

could you construct m and t in reverse, adding elements to the front rather than the end?

178 bytes using the strategy outlined above

@Guiseppe Clever. I always have this feeling that appending is generally shorter than prepending but in this case the large number of "end"s should have made me reconsider

Python 3, 218 204 bytes
-14 bytes thanks to ovs
from collections import*
def f(s):
	a=deque(maxlen=4);z=a.appendleft;b=[];x=b.pop
	for i in s.split():
		if'+'==i:c=x(),x();z(c);r=sum(c)
		elif'U'==i:c=x();z(c);r=c*c
		else:r=int(i)
		b+=r,
	print([*a])

Try it online!

Red, 335 330 bytes
func[s][b: copy[]foreach c split s" "[append b either c >"+"and(c <"U")[do c][c]]r: copy[]until[t: 0 until[not parse
b[to copy c[2 integer!"+"](insert/only r reduce[c/1 c/2]replace b c c/1 + c/2 t: 1)to end]]until[not parse b[to copy
c[integer!"U"](insert/only r to-block c/1 replace b c c/1 ** 2 t: 1)to end]]t = 0]take/part r 4]

Try it online!
More readable:
f: func[s] [
    s: split s " "
    b: copy []
    foreach c s [
        append b either (c > "+") and (c < "U")[do c] [c]
    ]
    r: copy []
    until [
        t: 0
        until [
            not parse b [to copy c[2 integer! "+"]
            (insert/only r reduce[c/1 c/2]
            replace b c c/1 + c/2
            t: 1)
            to end]
        ]
        until [
            not parse b [to copy c[integer! "U"]
            (insert/only r to-block c/1
            replace b c c/1 ** 2
            t: 1)
            to end]
        ]
        t = 0
    ]
    take/part r 4
]

C (gcc), 264 249 bytes

-15 bytes from @ceilingcat

I used recursion so that I could use the function stack as the data stack: the input list is walked through and the operations are performed: the results are displayed in reverse order, with stack pushes not displayed.
The stack is implemented as a linked list. Here's how it works:

The current node is set up with [pointer to value,pointer to previous node]
To push a value, it is stored and the function is called again with the current node.
To pop a value or modify the value on the top of the stack, a previous node's value is modified and the function is called again with the previous node.

I originally used a structure for the nodes, but I switched to bare pointers to save space. An interesting feature of this linked list is that it cleans itself up when the recursion completes.
#define _ printf(
f(char**s,int**p){int v,*y[]={&v,p},**w=y,m,n,t,z=1;return*s?**s-85?**s-43?--z,t=14,v=atoi(*s):(t=6,w=p[1],m=**w,**w+=n=**p):(t=0,w=p,**w*=m=**p),_(v=f(s+1,w))<4?",[%d]\0,[%d,%d]"+t+!v:"",m,n),v+z:0;}g(int*s){_"[");f(s,0);_"]\n");}

Try it online!

R, 205 182 bytes
function(P){S=F
M=list()
for(K in el(strsplit(P," "))){if(is.na(x<-strtoi(K))){if(K>1){M=c(m<-S[1],M)
S[1]=m^2}else{M=c(list(m<-S[2:1]),M)
S=c(sum(m),S[-2:0])}}else S=c(x,S)}
M[1:4]}

Try it online!
M is the memory clipboard, P is the program, and S is the stack.
Technically S is initialized as a vector containing a single zero but since we never get an invalid input, it saves me a byte from S={}.

source: Stack Exchange

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

sort: votes


text:
TyPe LiKe ThIs AnD iRrItAtE yOuR fRiEnDs
Your goal is to alternate uppercase and lowercase letters, while ignoring non-alphaneumeric characters.
Input => Output
abc => aBc OR AbC
a c => A c OR a C
abc123abc => AbC123aBc OR aBc123AbC

Shortest answer wins.

JavaScript, 116
s=>{x=!0;return s.split("").map(e=>{if(e.match(/[a-zA-Z]/))x=!x;return x?e.toUpperCase():e.toLowerCase()}).join("")}

Saved two bytes thanks to NTCG

x=!0 can return true save 2 bytes and if you use join("") => join`` save 2 bytes

You can save some bytes with template tags like .join\`instead of.join()and also you can use the spread operator to spread a string into an array instead ofs.split``. [...s]. Not nearly as good as the answer on the other question but l=(s,x)=>[...s].map(e=>e.match(/[a-zA-Z]/)?e`to${(x=!x)?"Upp":"Low"}erCase`:e).join```

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


text:
Determine Season
Introduction:
In the northern hemisphere (i.e. Europe, North America, etc.), the seasons are divided like this:
- Spring: March, April, May
- Summer: June, July, August
- Autumn: September, October, November
- Winter: December, January, February
In the southern hemisphere however (i.e. Australia, South America, etc.), the seasons are divided like this:
- Spring: September, October, November
- Summer: December, January, February
- Autumn: March, April, May
- Winter: June, July, August
This difference is due to the position of the sun regarding the equator, where the northern and southern hemispheres have opposite seasons.
Input:
In this challenge, we'll take two inputs:

One for the month (1 <= m <= 12 or 0 <= m <= 11) (examples and test cases are all 1-indexed).
And one for the five 'position-groups' at the latitudes of Earth (-2 <= p <= 2), where -2 is the Antarctic, -1 is the southern hemisphere excluding the Antarctic, 0 are the Tropics in proximity of the equator, 1 is the northern hemisphere excluding the Arctic, and 2 is the Arctic.
Although the Arctic, Antarctic and Tropics of course still have seasons, for the sake of this challenge we'll say the Arctic and Antarctic are in a constant state of Winter, and the Tropics are in a constant state of Summer.

Here a visual representation of these five groups, where -2 is the Antarctic Circle; -1 between the Tropic of Capricorn and Antarctic Circle; 0 between the Tropic of Capricorn and Tropic of Cancer; 1 between the Arctic Circle and Tropic of Cancer; and -2 the Arctic Circle.

Source: COSMOS - The SAO Encyclopedia of Astronomy
Output:
One of Spring, Summer, Autumn, or Winter, following these rules:

Is the position input 2 or -2 (Arctic or Antarctic), always output Winter.
Is the position input 0 (Tropics), always output Summer.
Is the position input 1 (northern hemisphere), output one of the four seasons based on the month input: Spring (m = [3,5]); Summer (m = [6,8]); Autumn (m = [9,11]); Winter (m = 12 or m = [1,2]).
Is the position input -1 (southern hemisphere), output one of the four seasons based on the month input: Spring (m = [9,11]); Summer (m = 12 or m = [1,2]); Autumn (m = [3,5]); Winter (m = [6,8]).

Challenge rules:

Output any four distinct values of your choice indicating Spring, Summer, Autumn, or Winter (please state what you've used in your answer).
-15 bytes bonus if you output Spring, Summer, Autumn, or Winter as text (case-insensitive, so can be fully lowercase or fully uppercase as well, instead of the used title-case).
Month input can be in any reasonable format. Can be either a 0-indexed or 1-indexed integer, Date-object, Month-String, etc.
Position input will always be one of these possible five inputs -2, -1, 0, 1, 2.

General rules:

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

Test cases:
Position    1-indexed Month    Output

-2          8  (August)        Winter
-2          12 (December)      Winter
-1          3  (March)         Autumn
-1          5  (May)           Autumn
-1          8  (August)        Winter
-1          12 (December)      Summer
0           1  (January)       Summer
0           7  (July)          Summer
1           1  (January)       Winter
1           4  (April)         Spring
1           7  (July)          Summer
1           12 (December)      Winter
2           2  (February)      Winter
2           9  (September)     Winter

Why can't we just use four distinct values for the seasons?

I did read that rule, that's why I asked. Also, why are you afraid of "magic-integer calculations"?

I don't see anything bad with seeing only calculations, they'll be most likely used for indexing anyway. It's your challenge, but I'd say this is an unnecessary complication. EDIT: about copying, well, that's not really avoidable.

@EriktheOutgolfer I've changed it. Any four choices are fine. -15 bytes bonus points if you output the texts. Better that way?

I don't think any bonuses are necessary, the program still does work if it just doesn't convert the output to those strings.

I think that byte bonuses to offset the byte size of text is totally fine.  It's not one of those "Bonus X points if you also do this other task".  The challenge is centered around the seasons, so it makes sense to
incentivize actually printing the seasons.

The bonus feels silly, because the season names are 24 bytes of data, so most languages will not break even. For example, the 60-byte C answer which aims for the bonus could just be f(m,a){return a&1?++a+m/3&3:2*!!a;} for 35 bytes.

@Lynn Perhaps I should change it to -24 bonus then? Or maybe 33% bonus?

I think you should remove it :)

@Lynn Sorry, but I won't. I initially posted this challenge enforcing the output of the season-strings for everyone, but ErikTheOutgolfer wasn't happy with it, so I eventually allowed any four distinct outputs and added the bonus as compromise. As NathanMerrill mentioned, the challenge is focused about the seasons, so I wanted to somehow enforce actually outputting the seasons. A bonus seemed like a nice way to enforce it somewhat, although most non-golfing languages without built-in libraries/encoding will probably not benefit from it.

Ruby, 33 27 25 bytes
->m,l{[6,m,0,m+6][l]/3%4}

Try it online!
Return values are:
0 -> winter
1 -> spring
2 -> summer
3 -> autumn

Python 2, 29 bytes
lambda p,m:[0,m+6,6,m][p]/3%4

Try it online!
A port of G B's Ruby approach, which turned out to be a few bytes shorter than my own:
32 bytes
lambda p,m:(p%2*(p+m/3+5)or p)%4

Try it online!
An anonymous function that returns the seasons as the numbers 0 to 3, where they represent Summer, Autumn, Winter and Spring in that order.
As for printing the actual season names:
63 - 15 = 48 bytes
lambda p,m:"SAWSuuipmtnrmutiemenrnrg"[(p%2*(p+m/3+5)or p)%4::4]

Try it online!
There's the combined string if anyone wants it.

C (gcc), 78 75 (-15 bonus) = 60 bytes
Using 1-based months.
Edit: Rearranged mathematical operators and reduced.
f(m,a){puts("Summer\0Autumn\0Winter\0Spring"+7*(a*a&1?(++a+m/3)%4:2*!!a));}

Try it online!

You can save two bytes with (++a+m/3)%4 → ++a+m/3&3. Also, a*a is odd precisely when a is, so checking a&1 should be fine, no?

05AB1E, 26 - 15 = 11 bytes
Uses the approach found by G B
6¹¾¹6+)sè3÷4%“–„Ž¹Ž€È±“#sè

Try it online!
or as a Test suite


text:
Orthodiagonal steps
It's a common problem to navigate in a 2D matrix. We've seen it many times and will see again. So let's help future us and develop the shortest solutions to generate all eight possible steps in a 2D matrix.
Challenge
Your code must output the following 8 pairs of -1,0,1 in any order:
(0,1)
(0,-1)
(1,0)
(-1,0)
(1,1)
(1,-1)
(-1,1)
(-1,-1)

Rules

There is no input.
Output order is not relevant
Output is flexible. Pairs of numbers just need to be distinguishable
This is code-golf, so shortest answer in bytes wins

I'm 100% sure that this is a duplicate, but I'm having trouble coming up with the right search terms to find the old challenge...

@MartinEnder I was 99% sure about that too, but didn't find any either. So I've put it in sandbox for a few days, but noone commented about duplicate.

I also remember there being an old challenge that was either exactly this or this in large part.

Because of the flexible output, there turns out to be an interesting Kolmogorov complexity flavour to this one. Some languages will find it harder than to do better than just hard coding the output. Should this tag be added?

May we output a list of complex numbers, [0+i,0-i,1,-1,1+i…?

@Adám I believe, there would be interesting answers with complex numbers, and I want to allow it, but lots of people already answered with pairs of numbers, as stated in question, so I'd say, that it would be discouraging to them, so no.

@ngm Hardcoding answer is rather boring solution, but it is still a solution, no doubt. Though I don't want to add this tag to encourage such solutions.

@DeadPossum May we use J to separate the coordinates instead of , e.g. 0J1 instead of (0,1)?

@Adám Yes, use anything while pairs of numbers are distinguishable

@DeadPossum APL represents 0+1i as 0J1.

@Adám But what about (1 + 0i) ?

@DeadPossum Differs between APL systems. Maybe some do display an imaginary part on all members of a list if at least one member has an imaginary part. I'm not sure.

@Adám Well, if both parts are displayed explicitly, it'll borderline-ish pass as valid answer

@DeadPossum Wouldn't that be unfair to other languages which happen to have a different display format for complex numbers? (Read: allow returning a list of complex numbers!)

@Adám True. No complex numbers. No hesitations.

This is an exact duplicate of 8 adjacent squares, one of the first code golfs I ever did.

Whoops, I forgot I got a hammer two days ago... I voted (and accidentally hammered) close the other one as a dupe of this one. Feel free to undo it, but I think it's the best solution.

Can I use input command .i in Pxem, as it treats EOF as -1?

Octave, 24 bytes
dec2base([0:3,5:8],3)-49

Try it online!
I haven't seen this approach yet.
Creates a list of integers [0, 1, 2, 3, 5, 6, 7, 8], and converts it to ternary, returning a character array:
00
01
02
10
12
20
21
22

Subtracting 49 (ASCII-value for 1) from all characters gives a numeric array:
-1  -1
-1   0
-1   1
 0  -1
 0   1
 1  -1
 1   0
 1   1

Pure Bash (no external utilities), 36
a=({0,-1,1},{0,-1,1})
echo ${a[@]:1}

Try it online!

Bash with Sed, 35
printf %s\\n {-1..1},{-1..1}|sed 5d

Try it online!

Alternatively using cut for 36 bytes as well.

33 bytes for bash+sed (despite how boring it is), echo {-1..1},{-1..1}|sed s/0,0.//

printf %s\\n {-1..1},{-1..1}|grep 1 is also 35.

T-SQL, 80 78 bytes
SELECT-1n INTO t;INSERT t VALUES(0),(1)SELECT*FROM t,t z WHERE t.n<>0OR z.n<>0

Creates a (permanent) table t containing (-1,0,1), and performs a self-join with a WHERE clause that excludes the 0,0 row. The table t is not cleaned up by my code, you must drop it yourself.
Sadly nearly twice as long as the boring solution (44 bytes), since SQL allows returns in strings:
PRINT'0,1
0,-1
1,0
-1,0
1,1
1,-1
-1,1
-1,-1'

I don't know T-SQL so well: can you use just WHERE t.n OR z.n? (You can in some but not all SQL dialects.)

@msh210 Good idea, I tried it but it doesn't seem to work on MS SQL Server. I get the error: An expression of non-boolean type specified in a context where a condition is expected

You can remove the spaces around the *

R, 26 24 bytes
Credits to @JDoe for saving two more bytes with a direct approach:
paste(-1:1,-3:5%/%3)[-5]

Try it online!
The original asnwer:
outer(-1:1,-1:1,paste)[-5]

Try it online!
Or for 27 bytes
sapply(-1:1,paste,-1:1)[-5]

Try it online!
Or for 34 bytes with factors:
(gl(3,3,,-1:1):gl(3,1,9,-1:1))[-5]

Try it online!
This last solution might be the golfiest if the output could be from 1 to 3 rather than from -1 to 1.
See the other R answer for alternate solutions with expand.grid or with cbind.

huh, nice use of the flexible output format!

This one is better than mine because of how ultimately useless it is :)

@Giuseppe Originally I tried c which did not make sense inside a matrix so I switched to paste and the original output format...

24 bytes with paste

@J.Doe you rock!

Jelly, 8 7 6 bytes
3p_2ẸƇ

Try it online!
My first ever Jelly answer! Much thanks to Dennis for the final piece of the puzzle.
Now, let's see if I can explain it ... lol.
3p_2ẸƇ   Main program, takes no input.
3p       Product with Range 3, yields [[1,1], [1,2], [1,3], [2,1], [2,2], ...]
  _2     Decrement twice, vectorizes, yields [[-1,-1], [-1,0], [-1,1], [0,-1], ...]
    ẸƇ   Comb, removes those that contain only falsey values, the [0,0]
         Implicit output

-1 byte thanks to Erik; -1 byte thanks to Mr Xcoder and Dennis

Alterate answer based on this approach: 3p3_2ẸƇ

@Mr.Xcoder You can drop the second 3.

@Dennis Oh, indeed. In this case, Adm can update with the 6-byter :)

Python 2, 33 bytes
i=9;exec"print-i%3-1,i/5;i-=2;"*8

Try it online!
Dennis saved 3 5 bytes, wow. Thanks!

Haskell, 22 bytes
_:l=mapM(:[1,-1])[0,0]

Try it online!
Laikoni saved 1 byte.

_:l=mapM(:[1,-1])[0,0] saves a byte. (Taken from isaacg's answer to the earlier challenge).

@Laikoni So I had considered that and thought that would make it a snippet (as many answers to the old challenge were). But combining this meta post with the rule that functions can be defined indirectly, so this seems to be OK. Thanks for the suggestion.

Japt -Q, 15 13 bytes
I'm sure there's a shorter way, but I liked this approach.
##ü80ì3 mÉ ò
##ü80        // Take 14425280
     ì3      // and turn it into an array of base-3 numbers.
        mÉ   // Subtract one from each digit
           ò // and then split them pairwise.

Shaved off two bytes thanks to Shaggy.
Try it online!

Japt, 13 12 11 bytes
Saved a byte thanks to @Shaggy
9ó8_ìJõ é)Å

Try it online! Uses -R flag to put each item on its own line.
Explanation
9ó8_ìJõ é)Å
9ó8             Create the range [9, 9+8). [9, 10, ..., 16]
   _            Map each item in this range through this function:
     Jõ é)        Generate the range [-1...1] and rotate to get [1, -1, 0].
    ì             Convert the item to an array of base-3 digits,
                  mapping [0,1,2] to [1,-1,0]. [[-1, 1, 1], [-1, 1,-1], [-1, 1, 0],
                                                [-1,-1, 1], [-1,-1,-1], [-1,-1, 0],
                                                [-1, 0, 1], [-1, 0,-1]]
          Å       Remove the first item (gets rid of the leading -1).

Java 8, 83 42 bytes
v->"1,1 1,0 1,-1 0,1 0,-1 -1,1 -1,0 -1,-1"

-41 bytes thanks to @AdmBorkBork by hard-coding..
Try it online.

Non hard-coded version as reference (83 72 70 68 bytes):
v->{for(int i=9;i-->1;)System.out.println(~i%3+1+","+(~(i/3)%3+1));}

-11 bytes thanks to @OlivierGrégoire.
-2 bytes creating a port of @ETHproductions's JavaScript (ES6) answer.
Try it online.

Non-hardcoded answer in 72 bytes: v->{for(int i=9;i-->0;)if(i!=4)System.out.println((i/3-1)+","+(i%3-1));}.

@OlivierGrégoire Thanks, added (and golfed by 2 more bytes).

Perl 6, 23 bytes
{(1,-1,0 X 1,-1,0)[^8]}

Try it online!

05AB1E, 8 7 bytes
2Ý<ãʒĀZ

Try it online!
Explanation
2Ý<     # Range of 2 decremented, yields [-1, 0, 1]
   ã    # Cartesian product of the list with itself
    ʒ   # Filter by ...
     ĀZ # Maximum of the truthified values, yields 0 only if both values are 0.

-1 byte thanks to Emigna !

Dang, you beat me to it. Had the same start (2Ý<ã), but was figuring out how to remove the middle element of the list of pairs.. Hadn't thought about sort by absolute value and removing the first.. +1 from me.

Use ʒĀZ to save 1

@Emigna Thanks for making me understand the difference between the regular and the 05AB1IE version of the truthified command :-)

Husk, 7 6 bytes
There are a lot of different ways (the tricky/costly part is getting rid of [0,0]), 7 bytes is the shortest I could come up thanks to Leo for pointing out to use decimal conversion (d) as a filter:
fdπ2ṡ1

Try it online!
Explanation
fdπ2ṡ1  -- constant function (expects no arguments)
    ṡ1  -- symmetric range [-n..n]: [-1,0,1]
  π2    -- cartesian power of 2: [[-1,-1],[-1,0],[0,-1],[-1,1],[0,0],[1,-1],[0,1],[1,0],[1,1]]
f       -- filter only elements that are truthy when
 d      -- | decimal conversion (interpret as polynomial and evaluate at x=10)
        -- : [[-1,-1],[-1,0],[0,-1],[-1,1],[1,-1],[0,1],[1,0],[1,1]]

Alternative, 7 bytes
tπ2ṙ1ṡ1

Try it online!
Explanation
tπ2ṙ1ṡ1  -- constant function (expects no arguments)
     ṡ1  -- symmetric range [-n..n]: [-1,0,1]
   ṙ1    -- rotate by 1: [0,1,-1]
 π2      -- cartesian power of 2: [[0,0],[0,1],[1,0],[0,-1],[1,1],[-1,0],[1,-1],[-1,1],[-1,-1]]
t        -- tail: [[0,1],[1,0],[0,-1],[1,1],[-1,0],[1,-1],[-1,1],[-1,-1]]

Another 7 byte alternative tπ2↑3İZ.

You can save one byte by filtering the lists based on their decimal conversion Try it online!

MATL, 12 bytes
9:q4X-3YA49-

Try it online!
Because it's MATL month, here's a MATL port of @Stewie's Octave answer. The sequence [0 1 2 3 5 6 7 8] is generated as the set difference between [0 ... 8] and 4.

R, 27 bytes
expand.grid(-1:1,-1:1)[-5,]

Try it online!
30 and 35 bytes:
cbind(-1:1,rep(-1:1,e=3))[-5,]
expand.grid(rep(list(-1:1),2))[-5,]

Some funky looking output, I like it :D Good job

expand.grid(-1:1,-1:1)[-5,] is 27 bytes.

Haskell, 28 27 bytes
tail.mapM id$[0,1,-1]<$"ao"

Try it online!

JavaScript (ES6)
Two alternate methods, both longer than hardcoding.
49 bytes
_=>[...'11202200'].map((n,i,a)=>[~-n,~-a[i+3&7]])

Try it online!
51 bytes
f=(n=1679887e3)=>n?[n%4-1,~-(n/4%4)]+' '+f(n>>4):''

Try it online!

J, 18 16 bytes
echo}.,{;~0 1 _1

Try it online!

Why minus is displayed as underscore in TIO?

18 bytes alternative: echo }.>,{;~0 1 _1
TIO

@Dead Possum Negative numbers are displayed with an underscore in J

Yes, 17 :)  echo}.>,{;~0 1 _1

Is echo needed?

agree with @cole, it seems like snippets should be allowed on "output only" challenges in J, but not totally clear on the rules

PowerShell, 41 bytes
(1..-1|%{$i=$_;1..-1|%{"$i,$_"}})-ne'0,0'

Try it online!
Double-for loop over the range 1..-1, with a -notequals at the end to pull out the extraneous 0,0 entry. They're each individually left on the pipeline and implicit Write-output at program completion gives us newlines for free.

Sadly, just the barebones string output is two bytes shorter:
'1,1
1,0
1,-1
0,1
0,-1
-1,1
-1,0
-1,-1'

But that's boring.

Perl 5, 31 bytes
map/1/&&say,<{-1,0,1},{-1,0,1}>

Try it online!

Would -1..1 work in the glob?

@msh210 Unfortunately not... I did experiment with it, and it works in bash, but not in Perl :(

CJam, 13 bytes
3,:(2m*{2b},`

Try it online!
Explanation
3,    e# Range [0,3):       [0 1 2]
:(    e# Decrement each:    [-1 0 1]
2m*   e# Cartesian square:  [[-1 -1] [-1 0] [-1 1] [0 -1] [0 0] [0 1] [1 -1] [1 0] [1 1]]
{     e# Filter by
 2b   e#   conversion to binary:
},    e#                    [[-1 -1] [-1 0] [-1 1] [0 -1] [0 1] [1 -1] [1 0] [1 1]]
`     e# Stringify:         "[[-1 -1] [-1 0] [-1 1] [0 -1] [0 1] [1 -1] [1 0] [1 1]]"

Python 2, 39 bytes
n=6;exec'n+=~(n==2);print n/3,n%3-1;'*8

Try it online!

Haskell, 27 bytes
tail$(,)<$>t<*>t
t=[0,1,-1]

Try it online!
The output is [(0,1),(0,-1),(1,0),(1,1),(1,-1),(-1,0),(-1,1),(-1,-1)].

F# (Mono), 54 bytes
let f=Seq.where((<>)(0,0))(Seq.allPairs[-1..1][-1..1])

Try it online!
44 bytes - thanks to Laikoni:
let f=Seq.tail(Seq.allPairs[0;-1;1][0;-1;1])

44 bytes by having (0,0) be the first element and calling Seq.tail: Try it online!

Befunge-93, 24 bytes
11#v91090~9~19~<
9.._@#,

Try it online!
I feel like this challenge is missing answers from 2D languages, even if most don't move diagonally. This outputs space separated numbers, each pair separated by tabs.

Brachylog, 8 bytes
Ċ{ṡᵐ≜}ᶠb

Try it online!
Explanation
Ċ           Couple: take a list of two elements [A,B]
 {   }ᶠ     Find all…
    ≜         …possible values of…
  ṡᵐ          …signs of A and B
       b    Behead: remove the first one which is [0,0]

Bash, 30 bytes
echo "
"{-1..1},{-1..1}|grep 1

Try it online!
Prints a trailing space on each line but the last. (Thanks to @Neil - this originally printed a leading space, but a trailing space is better as per their comment)

I guess you could print a trailing space on all but the last line as an alternative.

MATL, 12 bytes
3:qq2Z^[]5Y(

Try it at MATL Online!
My first ever serious MATL answer! Thanks a lot to Luis Mendo, Sanchises and DJMcMayhem for the help.
How it works

3:qq2Z^[]5Y( – Full program. Outputs to STDOUT.
3:           – Range 3. Push [1 2 3] to the stack.
  qq         – Decrement by 2. Yields [-1 0 1].
    2Z^      – Cartesian power of 2.
         5Y( – Replace the row at index 5 with...
       []    – An empty vector.

Batch, 77 bytes
@for %%x in (-1 0 1)do @for %%y in (-1 0 1)do @if not %%x%%y==00 echo %%x %%y

63 bytes if a nonstandard separator is allowed:
@for %%x in (-1/-1 -1/0 -1/1 0/-1 0/1 1/-1 1/0 1/1)do @echo %%x

Jelly, 6 bytes
;Ø+p`Ḋ

Try it online!
-1 thanks to Dennis.

Pyth, 11 9 bytes
t^+U2_1 2

Try it here
Explanation
t^+U2_1 2
  +U2_1     [0, 1, -1]
 ^      2   Product with itself.
t           Exclude the first.

Equivalently, we could use t*J+U2_1J, but that's not any shorter.

JavaScript (ES6), 45 bytes
f=(n=8)=>n?[...f(n-1),[1+~n%3,1+~(n/3)%3]]:[]

Try it online!
Another alternative to hardcoding, still not as short though...

Japt, 14 13 bytes
[J1T]ê à2 s1J

Try it online!

Stax, 10 bytes
τÄêdD┘│çû╢

Run and debug it
Explanation (unpacked):
1:r2|^{|af|u Full program
1:r          Push [-1, 0, 1]
   2|^       Join with self
   c|*        Alternative: copy and join
      {  f   Filter:
       |a      Any truthy (not 0)?
          |u Representation

PHP, 79, 76, 73 Bytes
76 Bytes thanks to Dom Hastings
Try it online (79 Bytes) using base 16 (Original answer)
Try it online (77 Bytes) using base 36
Try it online (73 Bytes) using base 36
Tried to avoid any kind of loop
<?=strtr(chunk_split(base_convert("18qfremyq6",36,4),3,"
"),[2=>-1,',']);
//as the starting index is 2, next will be 3, no need for 3=>','

Output
1,0
-1,0
1,1
1,-1
-1,1
-1,-1
0,1
0,-1

Explanation
Basically "72c75eb6e34e" 18qfremyq6 is the base 16 36 representation of a base 4 number 130230131132231232031032, every 3 represents a "," and 2 a -1
Chunk split, adds a line break every 3 characters.
Shorter with an output without the comma, 79 Bytes
<?=strtr(chunk_split(base_convert("10fcb5c",16,3),2,"
"),[2=>-1]);

Output
10
-10
11
1-1
-11
-1-1
01
0-1

or this can be done with 37 bytes.

Yeah... I did think hard-coding would be smaller, but programatically is more interesting, right? :)

of couse, far more interesting :-D

Gaia, 8 bytes
3…(¦:×ỵ⁈

Try it online!
This generates the list in this order:
[[-1 -1] [-1 0] [-1 1] [0 -1] [0 1] [1 -1] [1 0] [1 1]]

Explanation
3…(¦:×ỵ⁈ – Full program. Outputs to STDOUT.
3…       – Push [0 1 2] to the stack.
  (¦     – Decrement each; yields [-1 0 1].
    :    – Duplicate.
     ×   – Cartesian product.
       ⁈ – Filter-reject those that:
      ỵ  – Have no truthy element.

An alternative to this would be 3…(¦2*ỵ⁈.

Japt, 9 7 bytes
4 Japt solutions to one challenge; that has to be a first :)
Jõ ï fd

Test it

Original, 9 bytes
4#ô²ìJõ)ò

Test it

Explanation
Using the number Nit found for his solution (14425280) as a starting point, I converted it to base-3, split it to an array of 2 character strings and then tested each permutation to see if any of them produced a perfect square or cube when rejoined to a string and converted back to base-10. That gave me the perfect squares 15366400, 18011536 & 18421264 and, of those, only 18011536 had a square root that would allow me to save a byte thanks to Japt's trick of using # to build numbers, that being 4244.
4#ô           :4244
   ²          :Square
     Jõ       :Array [-1,0,1]
    ì  )      :Convert to a digit array in that base
        ò     :Split on every second element

Ruby, 40 bytes
([*-1..1]*2).permutation(2).uniq-[[0,0]]

Try it online!

Could you add a TIO link? Also I've never used Ruby yet, but i think this also outputs (0, 0), which isn't a valid step.

Oh yeah I completely missed the [0, 0]. I adjusted and added a TiO link. Thanks for catching that!

brainfuck, 86 bytes
+[[<+>->->>---<<<]>]>---.>.<.>.<-.+.>.-.<-.>.+.<.>..<.+.>..<-.>.<+.>.<-.>.-.<.>.<+.>+.

Try it online!
Prints pairs of numbers separated by commas.

K (ngn/k), 15 bytes
{(+1-!x#3)^,&x}

Try it online!
 x:2 / for testing
 x#3 / that many 3s
3 3
 !x#3 / all vectors of 0 1 2 as the columns of a matrix
(0 0 0 1 1 1 2 2 2
 0 1 2 0 1 2 0 1 2)
 +!x#3 / transpose
(0 0
 0 1
 0 2
 1 0
 1 1
 1 2
 2 0
 2 1
 2 2)
 &x / that many 0s
0 0
 (+!x#3)^,&x / remove the all-zero vector
(0 1
 0 2
 1 0
 1 1
 1 2
 2 0
 2 1
 2 2)

Wolfram Language (Mathematica), 29 bytes
Print@Rest@Tuples[{0,1,-1},2]

Try it online!

JavaScript (Node.js), 42 bytes
_=>`1,1
1,0
1,-1
0,1
0,-1
-1,1
-1,0
-1,-1`

Try it online!
Explanation :
Does nothing basically no input and prints the string separated by new lines using string literal.

Retina, 24 bytes
K`_ _
_
_$"0
+0`_
1$%"-1

Try it online!

Ruby, 31 bytes
p (w=*-1..1).product(w)-[[0,0]]

Try it online!

GolfScript, 26 19 18 bytes
9,[4]-{.3/(\3%(n}/

Try it online!
My first GolfScript submission, any help is appreciated! Outputs one element per line, and removes the 0, 0 element.
For nicer printing, I found this 20 byte solution:
9,[4]-{[.3/(\3%(]p}%

which prints one array per line.

TI-Basic, 32 bytes
For(A,-1,1
For(B,-1,1
If A≠2B
Disp A,B,"
End
End

Prints pairs as two lines, separated by empty lines.
TI-Basic is a tokenized language, all tokens used here are one-byte.
Explanation:
For(A,-1,1 # First number from -1 to 1 (inclusive)
For(B,-1,1 # Second number from -1 to 1 (inclusive)
If A≠2B    # If the pair is not 0,0
Disp A,B," # Print the first number, then the second, then
           # an empty string (each on its own line)
End        # End second number loop
End        # End first number loop

Output
-1
-1

-1
0

-1
1

0
-1

0
1

1
-1

1
0

1
1

Yabasic, 49 bytes
An anonymous function that takes no input and outputs to the console.
For i=-1To 1
For j=-1To 1
If i Or j?i,j
Next
Next

Try it online!
Output
-1 -1
-1 0
-1 1
0 -1
0 1
1 -1
1 0
1 1

VBA, 66 bytes
An anonymous function that takes no input and outputs to the console.
For i=-1To 1:For j=-1To 1:?IIf(i Or j,i &" "&j &vbCr,"");:Next j,i

Output
-1 -1
-1 0
-1 1
0 -1
0 1
1 -1
1 0
1 1

Julia 0.6, 24 bytes
[(A=[0:3;5:8])%3 A÷3]-1

Try it online!
Generate [0,1,2,0,2,0,1,2] in the first column and [0,0,0,1,1,2,2,2] in the second (excluding 4%3 and 4÷3 to avoid 0 0), then subtract 1 from all the values.
Other methods I tried:
[(i,j)for i=-1:1,j=-1:1 if i|j!=0]
[[s...].-'1'for s=base.(3,[0:3;5:8],2)] (based on Stewie Griffin's Octave solution)
[(i,j)for i=-1:1,j=-1:1][(1:9).!=5]

JavaScript (Most browsers), 42 40 bytes
for(x=9;x;)--x-4&&alert([~(-x/3),x%3-1])

Only works in DevTools in browsers. As per New users' guides to golfing rules in specific languages this should be valid (Full browser JS program).
If the one above is anyway considered a snippet, then 47 45 bytes:
_=>{for(x=9;x;)--x-4&&alert([~(-x/3),x%3-1])}

MathGolf, 7 5 bytes
1╤╫■╞

-2 bytes by porting @ბიმო's second Husk answer, so make sure to upvote him!
Try it online.
Explanation:
1╤     # Push list [-1,0,1] (push 1; pop and push a list in the range [-n,n])
  ╫    # Rotate it once towards the left: [0,1,-1]
   ■   # Take the cartesian product with itself, creating all possible pairs
    ╞  # Discard the first item of this list (the [0,0] pair)
       # (after which the entire stack joined together is output implicitly)

05AB1E, 6 bytes
T®šã¨

Port of @ბიმო's second Husk answer, so make sure to upvote him!
Try it online.
Explanation:
T      # Push 10
 ®š    # Prepend -1 as list: [-1,1,0]
   ã   # Take the cartesian product of this list with itself, generating all pairs
    ¨  # Remove the last one, which is the [0,0]
       # (after which the result is output implicitly)

Whitespace, 219 bytes
[S S S T    T   N
_Push_3][S S T  T   N
_Push_-1][S S S N
_Push_0][S S S T    T   N
_Push_3][S S T  T   N
_Push_-1][S S S T   N
_Push_1][S S S T    T   N
_Push_3][S S S N
_Push_0][S S S T    T   N
_Push_3][S S T  T   N
_Push_-1][S S S T   N
_Push_1][S S S T    T   N
_Push_3][S S T  T   N
_Push_-1][S S S N
_Push_0][S S S T    T   N
_Push_3][S S S T    N
_Push_1][S S S T    T   N
_Push_3][S S S N
_Push_0][S S S T    T   N
_Push_3][S S S T    N
_Push_1][S S S T    S N
_Push_2][S S S N
_Push_0][S S S T    T   N
_Push_3][S S T  T   N
_Push_-1][S S S T   N
_Push_1][S S S T    S N
_Push_2][S S S N
_Push_0][S S S T    T   N
_Push_3][S S S T    N
_Push_1][S S S T    T   N
_Push_3][S S T  T   N
_Push_-1][S S S N
_Push_0][S S S T    S N
_Push_2][S S S T    N
_Push_1][S S S T    T   N
_Push_3][S S S N
_Push_0][S S S T    S N
_Push_2][N
S S N
_Create_Label_LOOP][S S S T S T T   T   S N
_Push_46][T S S S _Add_top_two][T   N
S S _Print_as_character][N
S N
N
_Jump_to_Label_LOOP]

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).
Prints with a . delimiter between each number, and / between each pair of numbers. Since the codepoints of both . and / are between - and 01, these are the shortest delimiters to use with this approach.
Uses this Whitespace tip of mine to print the output. The optimal constant 46 is generated by this Java program.
NOTE: Hard-coded with tab and newline delimiters (since their codepoints are pretty short, being 9 and 10 respectively) would be 332 bytes instead.

Deadfish~, 238 bytes
{iiiii}ddc{d}ddddddc{ii}dddcdddddciiiic{d}ddddddc{i}iiiciiiicdddddciiiiic{dd}iiic{i}iiiiiicddddciciiiic{dd}iiic{i}iiiiiicddddciiiiic{dd}iiic{ii}dddcdddddciiiiic{dd}iiic{i}iiiciiiicdddddciciiiic{dd}iiic{ii}dddcdddddciciiiic{dd}iiic{ii}dddc

Try it online!

Pxem, Filename: 39 bytes + Content: 0 bytes = 39 bytes.

Filename: 0 1;0 -1;1 0;-1 0;1 1;1 -1;-1 1;-1 -1.p
Content is empty.

How would you do that by control flowing although we don't have negative constants nor the way to obtain negative value without .i or ._!

Other attempt: -1 -1;.e.s.p-1 0;.e.s.p-1 1;.e.s.p, 34 bytes up to six pairs.

Vyxal, 10 7 bytes
1u0W2↔Ṫ

Try it Online!
Explained
1u0W2↔Ṫ
1u0W    # list of [1,-1,0]
    2↔  # combinations of length 2
      Ṫ # remove tail which is [0,0] which is not needed in the challenge

Tcl, 44 bytes
puts "-1 -1
0 -1
1 -1
-1 0
1 0
-1 1
0 1
1 1"

Try it online!

Tcl, 77 bytes
set j -1
time {set i -2
time {puts [expr [incr i]|$j?"$i $j":""]} 3
incr j} 3

Try it online!

Uiua, 10 bytes
↘1/⊂⊞⊂.∸~1

Try it!
↘1/⊂⊞⊂.∸~1
       ∸~1  # the list [0 ¯1 1]
      .     # duplicate
    ⊞⊂      # cartesian product
  /⊂        # decrement rank
↘1          # drop first row which is [0 0]


text:
M_ss_ng Lette_s
Given this list of all the words in english and a string with s_me missi_g lett__s, find one way to fill in the letters. Do note that some words on the list contain special characters (! & ' , - . /) and numbers
Input:
This list and a string with missing letters.
The input sentence can contain or be missing any of these characters: ! & ' , - . / 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z. An underscore is used to mark a missing character. All missing characters have a possible solution.
Output:
One possible solution with all the missing letters fixed. Words split at a space . Case sensitive, includes words with ! & ' , - . /
Test Cases
Input: a string with s_me missi_g lett__s
All possible outputs: a string with [same, seme, sime, some] missing letters
Output Example: a string with same missing letters
Input: A_ 6-po_nt A/_ ada__er
All possible outputs: [A., A1, A4, A5, AA, AB, AF, AG, AH, AI, AY, AJ, AK, AM, AO, AP, AQ, AS, AT, AU, AV, AW, Ax, AZ] 6-point [A/C, A/F, A/O, A/P, A/V]
Output Example: A. 6-point A/C adapter
Input: A_M AT&_ platform_s scyth_'s hee_hee_ he-_e! 2_4,5_t
All possible outputs: [A&M, AAM, ABM, ACM, ADM, AFM, AGM, AIM, ALM, APM, ARM, ASM, ATM, AUM, AVM] AT&T platform's scythe's hee-hee! he-he! 2,4,5.t
Output example: A&M AT&T platform's scythe's hee-hee! he-he! 2,4,5-t
SemicolonSeperatedValue for first possible output:
a string with s_me missi_g lett__s;a string with same missing letters
A_ 6-po_nt A/_ ada__er;A. 6-point A/C adapter
A_M AT&_ platform_s scyth_'s hee_hee_ he-_e! 2_4,5_t;A&M AT&T platform's scythe's hee-hee! he-he! 2,4,5-t

Scoring
As this is code-golf, shortest solution in bytes wins.

I tried to made this really clear and well defined unlike the other similar questions, what about it is unclear?

@pfg how flexible is the input / output? can we work with a list of the words?

For test case purposes, can we have the 'words' list be /usr/share/dict/words instead of something on the web? letters, for example, is not in the standard unix words file (although letter is). That way, on TIO you can use the local file.

@pfg i meant the 'Words split at a space' part, the input/output can be separated words? Or we need to split / join the space?

So for 6-___nt the only output is 6-point and not the likes of 6-saint etc?

...yet it states "Words split at a space" in the output section and - is not a space.

@JonathanAllan Sorry I didn't search the list. 6-point is the only option for that

@pfg: TIO code is running on a virtual unix instance; so in python (for example) I can use f=open('/usr/share/dict/words');W=f.read() to access that standard unix file.

Will any words ever be only underscores?

@Οurous No. Possible special characters are !&',-./

Is it guaranteed that words without underscore are also always in the given word list?

Jelly,  18 25 20  19 bytes
...noticed a bug during write-up, cost 7 to fix naively, then saved 5 with another approach to fix it.
LÞṗ⁹ḲL¤K€ḟ”_⁼œ&ʋ@ƇṪ

A dyadic Link accepting a list of lists of characters on the left (words) and a list of characters on the right (string) which returns a list of characters.
Try it online!
...using a hugely restricted word list due to incredible inefficiency (although it could be far worse!)
How?
LÞṗ⁹ḲL¤K€ḟ”_⁼œ&ʋ@ƇṪ - Link: words, W; string, S
 Þ                  - sort (W) by:
L                   -   length (this is so we get final results which will match
                                in length when we use Ṫ at the end of the Link)
      ¤             - nilad followed by link(s) as a nilad:
   ⁹                -   chain's right argument (S)
    Ḳ               -   split on spaces
     L              -   length
  ṗ                 - Cartesian power (all ways of making that number of words)
       K€           - join €ach with spaces
                 Ƈ  - filter keep those for which:
               ʋ@   -   last four links as a dyad with swapped arguments:
          ”_        -     literal '_' character
         ḟ          -     filter discard (remove all '_'s from S)
             œ&     -     (S) multi-set intersection (current value)
            ⁼       -     equal? (S without '_'s == multi-set intersection?)
                  Ṫ - head (last result)

Pinging this because I'm curious if theres a way to shorten the naive fix.

@Razetime Yes there was a way to do so, I've edited it in.

Python 2, 96 105 99 101 bytes
lambda p,W:' '.join([w for w in W if all(map(lambda c,d:c in['_',d]and d,s,w))][0]for s in p.split())

Try it online!
W is the list of words which is set up separately; I'm using the unix words file on TIO, which doesn't contain platform's or scythes's.
Added 2 bytes for Shaggy.

The spec requires you to take the provided dictionary as input. It looks like you're using a different dictionary and assuming it's assigned to a predefined variable.

C (gcc), 232 226 bytes

-23 bytes from @ceilingcat
+17 bytes for required header file

Like the other submissions, I used /usr/share/dict/words; change the first argument to select another wordlist and the second argument to specify the size (the function itself just needs an array of strings as the dictionary.) On a non-matched word with a _, the original word is returned.
#import<string.h>
*g(s,t,u,v,w)char*s,**t,*u,*v,*w;{for(w=index(s,95)?0:s;(v=*t)&&!w;w=*u+*v?0:*t,t++)for(u=s;*u==95|*v==*u&&*v++&&*u++;);s=w?:s;}h(s,t,c,u)int*s,*t,*c,*u;{for(u=s;c=strtok(u," ");u=0)printf(" %s"+!!u,g(c,t));}

Try it online!

Java 10, 127 bytes
L->s->{for(var x:s.split(" "))for(var w:L)if(w.matches(x.replace(".","\\.").replace("_","."))){System.out.print(w+" ");break;}}

Try it online (also uses the /usr/share/dict/words TIO word-library, which doesn't contain platform's or scyth's, but the lambda-function works with any kind of list String-List provided).
Explanation:
L->s->{                   // Method with String-List & String parameters and no return-type
  for(var x:s.split(" ")) //  Loop over the parts of the input-String, split by spaces
    for(var w:L)          //   Inner loop over the words
      if(w.matches(x.replace(".","\\.")
                          //    Escape all dots
                    .replace("_","."))){
                          //    Replace all underscores with regex-dots
                          //    And if the current word matches it:
        System.out.print(w+" ");
                          //     Print the word, plus a space
        break;}}          //     And stop the inner loop

Clean, 174 171 bytes
import StdEnv,Text
$l=join" "o map(hd o filter(\w=any((==)w)l)o@o split"_")o split" "
@[h:t]|t>[]=[h<+c<+v\\c<-['0'..'9']++['a'..'z']++['A'..'Z']++['!&\',-./'],v<- @t]=[h]

Try it online!
TIO link uses the dictionary in /usr/share/dict/words but it'll work with any list of words.

I'm pretty sure it's possible to turn the @ helper into a fold, so if anyone has any ideas about that it'd be wonderful.

05AB1E (legacy), 27 bytes
#εD'_åiUʒX‚ζεD'_åsË~}P}Ω]ðý

Can definitely be golfed a bit more, but this will do for now.
First input is the string, second a list of words. If multiple words are possible, it picks a random one.
Assumes the sentence always contains at least a single space. If this is not allowed, the # has to be replaced with ð¡.
Uses the legacy version because the zip-builtins work on strings, whereas these have to be character-lists in the new version of 05AB1E. In the new version, the ʒX‚ζεD'_åsË~}P} would have been 1 byte longer because of that: ʒSXS‚ζε'_åyË~}P}.
Try it online (with a small sample dictionary list).
Explanation:
#                   # Split the (implicit) first input-String on spaces
 ε                  # Map over each word:
  D                 #  Duplicate the current word
   '_åi            '#  If the word contains an underscore:
       U            #   Pop the copy and store it in variable `X`
        ʒ           #   Filter over the (implicit) second input-list of words:
         X‚         #    Pair `X` with the current word
           ζ        #    Zip/transpose, swapping rows/columns with spaces as default
                    #    filler if the strings are of unequal length
            ε       #    Map over each pair of characters
             D      #     Duplicate it
              '_å  '#     Check if the pair contains an underscore
             s      #     Swap to get the map-value again
              Ë     #     Check that both characters are the same
                 ~  #     Check that either of these were truthy
            }P      #    After the map: check if all pairs were truthy
        }Ω          #   After the filter: pop and push a random valid word
                    #  (implicit else: use the unmodified word from the duplicate)
 ]                  # Close both the if-statement and map
  ðý                # And join the list by spaces
                    # (after which the result is output implicitly)

Husk, 22 bytes
wm`₁⁰w²
ḟoΛ='_żμ?'_³=⁰

Try it online!
For each word in query text, goes through all words in the dictionary substituting matching characters for '_'.
If, after doing this, the word is only '_'s, then it matched at all non-'_' characters, so it's a valid replacement.
 ḟoΛ='_żμ?'_³=⁰     # helper function:
                    # finds word in arg2 that matches arg1
                    # except at '_' characters.
ḟ                   # get first element that satisfies
 oΛ='_              # all elements are equal to '_'
                    # of
       żμ           # zip togethter arg2 and arg1 with
         ?   =⁰     # if they're equal
            ³       # then arg 2
          '_        # otherwise '_'

wm`₁⁰w²             # main program:
w                   # join with spaces
 m   w²             # map arg2 split on spaces
  `₁⁰               # using helper function with arg1
```

Ruby, 53 bytes
->d,s{s.gsub(/\S+/){d.grep(/#{$&.tr ?_,?.}/)[0]||_1}}

Attempt This Online!


text:
Fridge magnet substitution
When writing a message with fridge magnets, you'll often find yourself substituting a 1 for an I. In this challenge, your goal is to find out if a message can be written using the letters of another message. The allowed substitutions are:
A = 4
B = 8
C = U
E = M = W = 3
G = 6 = 9
I = 1
L = 7
N = Z
O = 0
R = 2
S = 5

For example, the message CIRCA 333 can be rearranged to spell ICE CREAM, where the first two 3s are rotated 180 degrees to make two Es, and the last 3 is rotated 90 degrees counterclockwise to make an M. Whitespaces can be included in the messages, but they should not be accounted for in your solution, as they're made by placing the magnets on the fridge.
Input
Two strings (or character arrays). All messages will match ^[A-Z0-9 ]+$
Output
Truthy if the two input strings are valid rearrangements of each other, falsey otherwise.
Examples
["CIRCA 333", "ICE CREAM"] => true
["DCLV 00133", "I LOVE CODE"] => true
["WE ARE EMISSARIES", "33   423    3315542135"] => true
["WE WANT ICE CREAM", "MET CIRCA 334 MEN"] => true
["I HAVE ICE CREAM", "HAVE 2 ICE CREAMS"] => false

More thruthy examples
These are all the 15+ letter words that map to another word. Some are trivial substitutions, but I included all that I found.
["ANTHROPOMORPHISE","ANTHROPOMORPHISM"]
["ANTIPHILOSOPHIES","ANTIPHILOSOPHISM"]
["CIRCUMSTANTIALLY","ULTRAMASCULINITY"]
["DECENTRALIZATION","DENEUTRALIZATION"]
["DIMETHYLNITROSAMINE","THREEDIMENSIONALITY"]
["INSTITUTIONALISE","INSTITUTIONALISM"]
["INTERCRYSTALLINE","INTERCRYSTALLIZE"]
["INTERNATIONALISE","INTERNATIONALISM"]
["OVERCENTRALIZATION","OVERNEUTRALIZATION"]
["OVERCENTRALIZING","OVERNEUTRALIZING"]
["PREMILLENNIALISE","PREMILLENNIALISM"]
["TRANSCENDENTALIZE","TRANSCENDENTALIZM"]

As this is a code golf challenge, the shortest solution wins! I will accept the shortest solution in 7 days from posting. Happy golfing!
Sample solution, non-golfed
Related

My daughter's alphabet
Foam bath letters

EDIT: Made an error in the substitutions, had G = 6 and 6 = 9 as separate substitutions, merged them into one.

I think 48 hours is a bit short. What about people who only golf on weekends?

Good point, I'll give it a week.

I didn't know that, but I changed to accepting the shortest answer instead.

Related: Foam Bath Letters

I searched far and wide for related challenges without finding anything, but I guess there's nothing new under the sun.

I was a bit unsure about that tag, but I replaced it now.

Other substitutions that you might consider allowing are 7 for T, H for I (but not 1 for H), and 2 for N or Z

@JeffZeitlin We had a discussion about this in the challenge sandbox, and I chose to exclude all substitutions which are not reversible. Since T and L are not exchangeable, I can't add T = 7. The same goes for N = Z = 2, which would imply that N = Z = R = 2. However, the kind of substitutions you suggest would make for a more difficult version of this challenge, which I might post at a later time. I just wanted to see if these kinds of challenges would be well received first.

Does the second string have to use all of the letters from the original string? i.e. If I fed this program ["CIRCA 1333", "ICE CREAM"] should the result be true because "ICE CREAM" can be written with characters from "CIRCA 1333" by discarding the extra "1"? or should it be false because "ICE CREAM" can't be rearranged to make "CIRCA 1333"?

@3D1T0R yes, the substitution must go both ways. The check is if two strings are valid rearrangements of each other. Your example would return false.

You don't have to accept an answer. On most of the challenges we don't accept any answer to encourage competition (although if you want the +2, you can)

Japt, 38 36 33 30 bytes
Takes input as an array of 2 strings.
®d`z³m`i`oiglbg`í)Ôu)ñ xÃr¶

Try it or run all test cases
3 bytes saved thanks to ETHProductions
®d`z...m`i`o...g`í)Ôu)ñ xÃr¶
                                 :Implicit input of array U
®                                :Map each Z
 d                               :  For each pair of characters in the following string,
                                 :  replace all occurrences of the 1st character in Z with the 2nd
  `z...m`                        :    The compressed string "znewem"
         i                       :    Prepend
          `o...g`                :      The compressed string "oireasglbg"
                 í               :      Interleave 0-based indices
                  )              :    End prepend
                   Ô             :    Reverse
                    u            :    Convert to uppercase
                     )           :  End replace
                      ñ          :  Sort
                        x        :  Trim
                         Ã       :End map
                          r      :Reduce
                           ¶     :  By testing equality

Nice, currently beating Jelly! I think you can do r¶ at the end to save 3 bytes.

Oh, yeah, I was forgetting that. Thanks, @ETHproductions.

Python 2, 145 131 130 129 125 bytes
lambda*a:all(len({sum(map(w.count,x))for w in a})<2for x in'A4 B8 CU EMW3 G69 I1 L7 NZ O0 R2 S5'.split()+list('DFHJKPQTVXY'))

Try it online!
Alt:
Python 2, 125 bytes
lambda*a:len({(x,sum(map(w.count,x)))for x in'A4 B8 CU EMW3 G69 I1 L7 NZ O0 R2 S5'.split()+list('DFHJKPQTVXY')for w in a})<23

Try it online!

Ruby, 99 72 71 bytes
->a{!!a.map{|x|x.tr("0-9UZMW","OIREASGLBGCNE").chars.sort-[" "]}.uniq!}

Try it online!
Takes an array of strings, assumes input in uppercase as in all test cases.
-1 byte golfed by benj2240.

I like this approach! Sprinkle in some more ! to save a byte

Yep, that works, thanks.

JavaScript (ES6), 102 100 bytes
Takes input as two arrays of characters in currying syntax (a)(b). Returns a boolean.
a=>b=>(g=s=>s.map(c=>'648UD3F6H1JK73Z0PQ25TUV3'[parseInt(c,36)-9]||c).sort().join``.trim())(a)==g(b)

Try it online!
How?
Using the helper function g(), for each input s:

Digits 0 to 8 and letters X, Y and Z are left unchanged. Everything else is explicitly translated.
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
         ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
.........648UD3F6H1JK73Z0PQ25TUV3...

Code:
s.map(c => '648UD3F6H1JK73Z0PQ25TUV3'[parseInt(c, 36) - 9] || c)

We sort the characters (which brings all spaces at the beginning), join them and remove all leading whitespace.
Code:
.sort().join``.trim()

Finally, we compare both outputs.

Retina 0.8.2, 42 bytes
T` dUZMW`_\OIR\EASG\LBGCN\E
%O`.
^(.*)¶\1$

Try it online! Takes input on separate lines, but Link includes test cases and header. Explanation:
T` dUZMW`_\OIR\EASG\LBGCN\E

Map all the letters to a minimal set, deleting the spaces.
%O`.

Sort each string into order.
^(.*)¶\1$

Compare the two values.

APL (Dyalog Unicode), 49 bytesSBCS
-1 thanks to ngn.
Anonymous tacit prefix function.
(≡/(⍋⌷¨⊂)¨)(,¨⎕D,'UMWZ ')⎕R('OIREASGLBGCEEN',⊂⍬)

Try it online!
⎕R PCRE Replace:
 'UMWZ ' these five characters
 ⎕D, preceded by the digits
 ,¨ separately (make each into a string rather than being a single character)
 with:
 ⊂⍬ nothing
 'OIREASGLBGCEEN', preceded by these characters
(…) apply the following tacit function to that:
 (…)¨ apply the following tacit function to each:
  ⊂ enclose it (to treat it as a whole)
  ⍋⌷¨ use each of the indices that would sort it to index into the whole string (sorts)
 ≡/ are they identical? (lit. match reduction)

'' -> ⍬

@ngn Not sure why that works, but thanks anyway.

Python 2, 108 bytes
lambda a,b:g(a)==g(b)
g=lambda s:sorted('85930A4614012B3C4D5EF6378GH9AI2J3KL7'[int(c,36)]for c in s if'!'<c)

Try it online!
There are 23 equivalence classes of characters. Using the 36-character string '85930A4614012B3C4D5EF6378GH9AI2J3KL7', we map each character to its equivalence class (ignoring spaces), then sort the resulting array. Two strings are equivalent iff the resulting lists are equal.

Java 10, 262 260 258 216 208 174 bytes
a->b->n(a).equals(n(b));String n(String s){return s.chars().mapToObj(x->x<48?"":"OIREASGLBG.......ABCDEFGHIJKLENOPQRSTCVEXYN".split("")[x-48]).sorted().reduce("",(a,b)->a+b);}

-2 bytes thanks to @Arnauld.
-76 bytes thanks to @OlivierGrégoire.
Try it online.
Explanation:
a->b->                      // Method with two String parameters and boolean return-type
  n(a).equals(n(b))         //  Return if both Strings are equal in the end

String n(String s){         // Separated method with String as both parameter return-type
  return s.chars()          //  Loop over all characters as integers
          .mapToObj(x->x<48?//   If the current character is a space:
             ""             //    Replace it with an empty String to skip it
            :               //   Else:
             "OIREASGLBG.......ABCDEFGHIJKLENOPQRSTCVEXYN".split("")[x-48]
                            //    Convert multi-substitution characters to a single one
          .sorted()         //  Sort all of the converted characters
          .reduce("",(a,b)->a+b);}
                            //  And join all of them together as single String

"A4B8CUEMEWE3G6G9I1L7NZO0R2S5".split("(?<=\\G.{2})") seems to work ... although I'm not even sure exactly how. :p

@Arnauld Thanks, -2 bytes, and {2} can be . for another -2 bytes. I'm also not 100% sure how it works. I know (?<= ... ) is used to split but keep trailing delimiter per item. But I'm a bit confused why (?=\\G..) (keep leading delimiter) doesn't work in that regard. And also don't really know how the \\G.. vs .. acts in the split here. Will see if I can figure it out somewhere, because not I'm curious. ;p Thanks either way for the saved bytes. Need to remember \\G when splitting on even-sized blocks. :)

@Arnauld If you want some background about (?<=\\G..) inside a split, I've made a StackoverFlow question which shed some light. Basically it's undefined behavior working differently in almost every language. Although \G is zero-length, in Java with the positive look-behind inside the split, it kinda conflicts both rules causing the behavior we see here. It's still all a bit vague to me personally, but at least it saved 4 bytes in this answer. ;)

It's pretty cool to see it has lead to some nice answers. Thanks for sharing!

217 bytes. Can save more bytes, though.

@OlivierGrégoire Thanks! And was able to remove 7 more bytes by using x.charAt(#) instead of x.split("")[#] (and the space at int[]n(String s)).

174 bytes.

R, 123 bytes
function(x,y=chartr("48UMW36917Z025","ABCEEEGGILNORS",gsub(" ","",x)))all(g(y[1])==g(y[2]))
g=function(z)sort(utf8ToInt(z))

Try it online!
utf8ToInt converts a string into a vector of Unicode code points.
!sd(a-b) is one byte shorter than all(a==b) but that doesn't help here because I'm actually dealing with integers and not logicals.

Very nice! I think you need !any in place of !sd as the elements could be all equal, but to 1. Try: f(list("BCDEF","ABCDE"))

Python 3, 105 bytes
lambda a,b:X(a)==X(b)
X=lambda s:sorted(("ABCEEEGGILNORS"+c)["48UMW36917Z025".find(c)]for c in s if' '<c)

Try it online!

J, 56 bytes
-:&(-.&' '/:~@rplc'0123456789UMWZ';"0'OIREASGLBGCEEN'"1)

Try it online!
Explanation:
& for both left and right arguments
-.&' ' removes spaces from the input,
rplc replaces
'0123456789UMWZ';"0'OIREASGLBGCEEN'"1  the characters in the input by substitution of the chars in the left column with the ones in the right one: (here transposed for saving space)
      |:'0123456789UMWZ';"0'OIREASGLBGCEEN'
┌─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┬─┐
│0│1│2│3│4│5│6│7│8│9│U│M│W│Z│
├─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┼─┤
│O│I│R│E│A│S│G│L│B│G│C│E│E│N│
└─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┴─┘

/:~@ and sorts the resulting strings
-: are the sorted strings equal?
My initial solution:
J, 77 73 bytes
-:&(1#.(' '-.~])e."1[:(,a.,.@-.,)'EMW3','G69',9 2$'A4B8CUI1L7NZO0R2S5'"1)

Try it online!
Explanation:
(' '-.~]) removes spaces from both arguments and
e."1 tests each character for membership in the follwing table:
[:(,a.,.@-.,)'EMW3','G69',9 2$'A4B8CUI1L7NZO0R2S5'"1 the reference:
EMW3
G69
A4
B8
CU
I1
L7
NZ
O0
R2
S5
.
.
.
All other symbols one in a row

1#. adds up the comparison tables for each argument
-:& do they match?

Jelly, 39 34 bytes
ØB“¡Œ5a`@ẓRɼ9ẓ“%-/İ"aU5®’ṃyḟ⁶ṢɗⱮ⁸E

Try it online!

Perl 6, 55 bytes
{[eq] .map:{sort TR/0..9UZMW/OIREASGLBGCNEE/~~m:g/\S/}}

Try it online!
Works with an arbitrary number of strings.

Python 2, 111 bytes
lambda*t:2>len({`sorted(s.translate(dict(map(None,map(ord,'48UMW36917Z025 '),u'ABCEEEGGILNORS'))))`for s in t})

Try it online!
116 bytes
lambda a,b:g(a)==g(b)
g=lambda s,y='4A8BUCMEWE3E6G9G1I7LZN0O2R5S ':y and g(s.replace(y[0],y[1:2]),y[2:])or sorted(s)

Try it online!

05AB1E, 38 33 bytes
εðK.•2Θ`ĆĀÑεÉ•u6«•B/óÕ¦•…CN9«‡{}Ë

Try it online or verify all test cases.
Explanation:
ε                   # Map each value in the (implicit) input-list by:
 ðK                 #  Remove all spaces
   .•2Θ`ĆĀÑεÉ•      #  Push compressed string "abemwgilorsuz"
              u     #  To uppercase: "ABEMWGILORSUZ"
               6«   #  Append a 6: "ABEMWGILORSUZ6"
   •B/óÕ¦•          #  Push compressed integer 48333917025
          …CN9«     #  Append "CN9": "48333917025CN9"
   ‡                #  Transliterate; map all characters in "ABEMWGILORSUZ" in the
                    #  map-string to "48333917025CN9" at the same indices
    {               #  Then sort all characters
}                   # Close the map
 Ë                  # And check if both are equal (which is output implicitly)

See this 05AB1E tip of mine (sections How to compress strings not part of the dictionary? and How to compress large integers?) to understand why .•2Θ`ĆĀÑεÉ• is "abemwgilorsuz" and •B/óÕ¦• is 48333917025.


text:
Code golf the best permutation
Challenge
Given an integer n ≥ 4, output a permutation of the integers [0, n-1] with the property that no two consecutive integers are next to each other.  The value of a permutation pi is the sum of abs(pi[i] - i) for all indices i.
Examples

(1, 3, 0, 2) has value  6
(0, 2, 4, 1, 3)  has value 6
(0, 2, 4, 1, 3, 5) has value 6
(0, 2, 4, 1, 5, 3, 6) has value 8

Score of your answer
The score of your answer is the sum of the values of your permutations for n = 4 .. 14 plus the number of bytes your code takes.  The lower the score, the better.  Your code must give valid output for all those values of n.
You must be able to run your submission to completion on your machine.
In case of ties,  time of last edit that resulted in the relevant score will be the decider.
Isn't this the same question as this one?
Answers to the linked question will not be competitive for this question as they make no effort to optimize the value of a permutation. For example for n=10, the permutation [1, 3, 5, 7, 9, 0, 2, 4, 6, 8] given by most of the answers there gives a value of 30. You can do much better than that.
For the permutation part of the question, the optimal value overall is at most 120.  (Thank you to @Laikoni.)   Whereas Dennis's answer to the previous question scores 222. (Thank you to @user202729.)

Ehh, this still feels too close since every solution from the other question can be ported over without any changes...

@JoKing every answer can be ported without any changes, but would score terribly bad in this challenge. Posting that code in this challenge is equivalent to posting code from code-review to a code-golf challenge.

Mixing different quantities in the score can indeed be problematic. The answer with the best algorithm can usually be ported over to any language, in which case the scoring reduces to normal code golf.

@StewieGriffin I did check and so has user202729 that the solutions to the other challenge are not optimal for this challenge.

The optimal values are [6,6,6,8,10,12,12,12,14,16,18] for a score of 120. Interestingly this pattern can be found in A078706.

@Laikoni Wow (about the OEIS). That's very surprising. Are you able to compute more to check if it really is the same sequence?  How did you compute the optimal values out of interest?

Up to n=11 I brute forced all permutations. For higher n I'm pretty sure there is nothing better than starting with [0,2,4,1,3,5, ... so I fixed this as well and only brute-forced the remaining numbers.

Ok, it starts to differ from A078706 with n=17, which can have a score of 20.

I can understand the challenge clearly and unambiguously. If you disagree and vote to close, leave a comment here.

Jelly, 36 34 33 32 31 30 bytes, result: 120
Thanks to Dennis for -1 byte! (implicitly by fixing a Jelly bug, although the feature postdates the challenge)
ðRḟISị“Æ¤¿‘Ʋœ?$;@µ2x5~4¦ṁ_4$Ä’

New feature: accumulated sum (Ä).
Try it online!
Use 1-indexing.
Takes linear time, too.

This C++ program generates the lexicographically smallest permutation, assuming that |i - pi| ≤ width (where width is a hardcoded constant) for all 0 ≤ i < n, with time complexity about O(width2 × 22×width × n) (which is just O(n) for fixed width): Try it online!

How?

Write a C++ program attempting to solve the problem optimally.
Observe the pattern. We note that the sequence of all elements except 4 last ones is a prefix of
0 2 4 1 3 5 7 9 6 8 10 12 14 11 13 15 17 19 16 18 20 22 24 21 23 25 ...

Computes the sequence's incremental difference.
2 2 -3 2 2 2 2 -3 2 2 2 2 -3 2 2 2 2 -3 2 2 2 2 -3 2 2

Note the period 5.
The Jelly implementation:

n-4 first elements are taken from the sequence above. O(n).
For 4 last elements, just brute force all 24 possibilities. O(1).
(note: I no longer brute force all 24 possibilities from the 32-bytes version)

Ah, you went with a different prefix to me. Mine starts 0 2 4 1 3 5 8 6, and has a bigger branching factor but doesn't have such a simple pattern.

CJam (60 bytes + 120 = 180 score)
{_5/4*8e!961=7_)er<:A\,^e!{A\+}%{2ew::-:z1&!},{_$.-:z1b}$0=}

Online test suite with integrated scoring
Extension up to n=24
Dissection
{
  _5/4*        e# Work out how much of the hard-coded prefix to use
  8e!961=7_)er e# Prefix [0 2 4 1 3 5 8 6]
               e# I identified this by brute forcing up to n=10 and looking for patterns
               e# I then used the identified prefix [0 2 4 1] to brute-force further
  <:A          e# Take the desired prefix of the hard-coded array, and store a copy in A
  \,^e!        e# Generate all permutations of the values in [0 .. n-1] which aren't in A
  {A\+}%       e# Prepend A to each of them
  {            e# Filter...
    2ew::-     e#   Take each difference of two consecutive elements
    :z         e#   Find their absolute values
    1&         e#   Test whether 1 is among those absolute values
    !          e#   Reject if it is
  },
  {            e# Sort by...
    _$.-       e#   Take pairwise differences of permutation with the identity
    :z         e#   Absolute values
    1b         e#   Add them (by interpreting in base 1)
  }$
  0=           e# Take the first
}

Very impressive! I look forward  to discovering how you did it.

Is it optimal all the way up to 24?

@Anush According to my program, likely.

@Anush, I haven't proven it so, but I believe it likely.

I am even more intrigued by your algorithm!

Haskell, 146+89 score+bytes
f i|k<-mod i 4=scanl(+)1$take(i-2-k)(cycle[2,-3,2,3])++[[2],[2,2],[5,-3,2],[5,-3,2,2]]!!k

Repeats pattern [1,3,0,2], last mod i 4 elements are hand tuned.
Previous algorithm (132+116):
f i=last$filter(\a->all(`elem`a)[0..i-1]).(!!(i-1)).iterate((\l->map((:l).(+head l))[-3,2,-2,3])=<<)$pure<$>[i-3..i]

Bruteforces the correct number of jumps of length ±2 or ±3. Selects the last one that has the correct numbers in it, seems to work just fine and is a lot cheaper than implementing the score. Tio just runs out time before the last score, which is 18.
Try it online!

Japt, 120 + 20 = 140
(Copying one of my solutions from the other challenge would have scored me 227)
o á k_äa d¥1ÃñxÈaYÃg

Try it or use this version to check scores. Both versions may start crapping out on you around 9.

Explanation
o                        :Range [0,input)
  á                      :All permutations
    k_      Ã            :Remove sub-arrays that return true
      äa                 :  Get the consecutive absolute differnces
         d¥1             :  Do any equal 1?
               È  Ã      :Pass the integers in each remaining sub-array through a function
                aY       :  Get the absolute difference with the integer's index
              x          :Reduce by addition
             ñ           :Sort the main array by those values
                   ñ     :Return the first sub-array

"You must be able to run your submission to completion on your machine." Did you seriously manage to process 87E9 permutations of 14 elements in the two hours since the question was posted?

Besides, consider that Japt is based on Javascript, can it really handle 87E9 permutations? This question say that Javascript array can have length of at most ~4E9. Does Japt have generating function or something...\

Ruby, 120 score + 112 106 91 82 bytes
->n{(0...n).map{|a|a+(a+2)%5-([[],[],[0,4,3],[-1,4,4,4],[1,1,6,1]][n%5][a-n]||2)}}

Try it online!
The sequence is basically (a-2)+(a+2)%5.
If n mod 5 is not 0 or 1, the last 3 or 4 elements are different.
This is still half-hardcoded, always finds the best solution, maybe it could be golfed a little more, but I have run out of ideas.

JavaScript (Node.js), 148 score + 109 73 bytes
n=>[...Array(n)].map(_=>l=!m|l>n%5+2&&l>m+2?[+m,m=l+2][0]:l+2,m=n>4,l=~m)

Try it online! Explanation: l keeps track of the last number generated and m keeps track of the next number of the opposite parity to l; once l exceeds m+2 the variables are exchanged. An adjustment is made at the start of the sequence so that sequences whose lengths are not multiples of 5 do not miss out any numbers, and another adjustment is made for n=4.


text:
quine program in C using only macros
Asked on Stack Overflow, but they suggested to move it here
A while ago I was reading about quines. It made me wonder if it possible to write a macro in C which will print itself, without writing any function such as main. every piece of code should be only in macro. After a few attempts, I couldn't find the solution.
While searching the web for answer, I found the following code:
#define Q(x) #x;x
char *q=Q(main(){printf("#define Q(x) #x;x\nchar *q=Q(");printf(q);printf(")\n");})

Although part of the code isn't in the #define (isn't macro). Is it possible to implement a macro which will print the program ( quine type program )?
EDIT: if it isn't possible (because the macros are 'made' in the preprocessor step), is it possible to implement a quine which is mostly in macros?

@Picard This is on topic, and it's not a duplicate. It is similar in style to this question.

@mbomb007 This one ask "how to do X", not "how to do X while minimize criteria Y". There are no winning criteria.

You would need to define what exactly do you want. A "macro" can't "print". (before that I would vote to close as unclear)

There doesn't have to be a winning criteria. It's a tips question. Asking if something is possible (something that is a challenge to solve) should be on topic.

@mbomb007 From the [tips] tag info page: "For questions asking for tips on a specific piece of code, to make it a better answer to a programming challenge that is on-topic on this site." "on-topic on this site" implies have a winning criteria.

@mbomb007 How did you come to that conclusion? Of all the answers to Let's decide what kind of non-challenge questions we want once and for all, only Requests for lists of language-specific golfing advice and Questions about improving code golf / code challenge skills have a positive score.

It's basically a "let's solve this as a group" question. If seeing it solved would be a positive experience, then what's the problem? I don't think we need to be so legalistic

If this question were to fit into one of the meta categories in the linked question, the one it fits best into is Questions about improving code golf / code challenge skills.

Since no one else has yet said it, welcome to PPCG! You seem to have stirred up the hornet's nest with your first post (which isn't necessarily a bad thing!), so hopefully you'll stick around for the next one!

If this post also said "I want to do this in shortest code possible" would people say it was on topic? That would make it fit into the "questions about improving code golf / code challenge skills" category.

Just for clarity, since I don't really know C, is a macro basically a function? Someone could define a macro that returns a string representing itself, right? It doesn't have to output to stdout to be a quine?

@mbomb007 It's sort of a function that's computed at compile-time. So usually the RHS of a macro replaces the LHS wherever it appears in the rest of the program.

Right, but I'm asking if a macro that returns itself would count as a quine.

define "mostly in macros"

@dylnan Yes. (15 character limit)

@mbomb007 Ignoring whether it's on-topic, it's definitely unclear. Macros can't print. The question needs more clarification from the OP before it can be reopened.


text:
Are there mountain rings?
Challenge
Given a matrix of positive integers, determine if there are any "rings" of mountains. The formal definition for this challenge is: given a matrix of positive integers, is there any positive integer n for which there is a closed ring of cells in the matrix that are strictly greater than n such that all cells enclosed in the ring are less than or equal to n.
Let's take a truthy example:
3 4 5 3
3 1 2 3
4 2 1 3
4 3 6 5

If we set n to 2:
1 1 1 1
1 0 0 1
1 0 0 1
1 1 1 1

As we can clearly see, the 1s along the edge form a ring.
We define a ring as an ordered collection of cells where adjacent cells in the collection are also adjacent (edge or corner) on the grid. Additionally, the ring must contain at least 1 cell inside of it; that is, attempting to edge-only BFS-floodfill the entire matrix excluding the cells in the collection and never traversing a cell in the collection must miss at least one cell.
Truthy Test Cases
4 7 6 5 8 -> 1 1 1 1 1
6 2 3 1 5 -> 1 0 0 0 1 (n = 3)
6 3 2 1 5 -> 1 0 0 0 1
7 5 7 8 6 -> 1 1 1 1 1

1 3 2 3 2
1 6 5 7 2
1 7 3 7 4
1 6 8 4 6

1 3 1
3 1 3
1 3 1

7 5 8 7 5 7 8 -> if you have n = 4, you get an interesting ridge shape around the top and right of the grid
8 4 4 2 4 2 7
6 1 8 8 7 2 7
5 4 7 2 5 3 5
5 6 5 1 6 4 5
3 2 3 2 7 4 8
4 4 6 7 7 2 5
3 2 8 2 2 2 8
2 4 8 8 6 8 8

5 7 6 8 6 8 7 -> there is an island in the outer ring (n = 4), but the island is a ring
5 3 2 4 2 4 7
6 3 7 8 5 1 5
8 2 5 2 8 2 7
8 3 8 8 8 4 7
6 1 4 1 1 2 8
5 5 5 5 7 8 7

150 170 150
170 160 170
150 170 150

Falsy Test Cases
1 2 3 2 1 -> this is just a single mountain if you picture it graphcially
2 3 4 3 2
3 4 5 4 3
2 3 4 3 2
1 2 3 2 1

4 5 4 3 2 -> this is an off-centered mountain
5 6 5 4 3
4 5 4 3 2
3 4 3 2 1

1 1 1 1 1 -> this is four mountains, but they don't join together to form a ring
1 2 1 2 1
1 1 1 1 1
1 2 1 2 1
1 1 1 1 1

3 3 3 3 3 -> there is a ring formed by the `3`s, but the `4` in the middle is taller so it doesn't qualify as a mountain ring
3 1 1 1 3
3 1 4 1 3
3 1 1 1 3
3 3 3 3 3

3 4 4 4 3
4 4 3 4 4
3 3 3 3 4
4 4 3 4 4
3 4 4 4 3

1  2  3  4  5
6  7  8  9  10
11 12 13 14 15
16 17 18 19 20
22 23 24 25 26

Rules

Standard Loopholes Apply
This is code-golf, so the shortest answer in bytes in each language is declared the winner of its language. No answers will be accepted.
The input may be taken as any reasonable form for a matrix of positive integers
The output may be given as any two reasonable, consistent, distinct values indicating [true] or [false].

For what n is the third "truthy" test case actually truthy? [1,2]?

@EriktheOutgolfer The ring of 3s are adjacent by corner. So, yes.

Jelly, 38 bytes
Ẇ€Z$⁺Ẏµ,ZẈ>2ẠµƇµḊṖZƊ⁺FṀ<,Z.ịḊṖ$€Ɗ€ƊȦ)Ṁ

Try it online!
Outputs 1 if the matrix contains mountain ranges, 0 otherwise.
How it works (slightly outdated)
I may be able to shorten the code a bit, so this section will probably undergo heavy editing.
The helper link
,Z.ịḊṖ$€Ɗ€ – Helper link. Let S be the input matrix.
,Z         – Pair S with its transpose.
        Ɗ€ – For each matrix (S and Sᵀ), Apply the previous 3 links as a monad.
  .ị       – Element at index 0.5; In Jelly, the ị atom returns the elements at
             indices floor(x) and ceil(x) for non-integer x, and therefore this
             returns the 0th and 1st elements. As Jelly is 1-indexed, this is the
             same as retrieving the first and last elements in a list.
    ḊṖ$€   – And for each list, remove the first and last elements.

For example, given a matrix in the form:
A(1,1) A(1,2) A(1,3) ... A(1,n)
A(2,1) A(2,2) A(2,3) ... A(2,n)
A(3,1) A(3,2) A(3,3) ... A(3,n)
...
A(m,1) A(m,2) A(m,3) ... A(m,n)

This returns the arrays (the order doesn't matter):
A(1,2), A(1,3), ..., A(1,n-1)
A(m,2), A(m,3), ..., A(m,n-1)
A(2,1), A(3,1), ..., A(m-1,1)
A(2,n), A(3,n), ..., A(m-1,n)

Long story short, this generates the outermost rows and columns, with the corners removed.
The main link
Ẇ€Z$⁺Ẏµ,ZẈ>2ẠµƇµḊṖZƊ⁺FṀ<ÇȦ)Ṁ – Main link. Let M be the input matrix.
Ẇ€                           – For each row of M, get all its sublists.
  Z$                         – Transpose and group into a single link with the above.
    ⁺                        – Do twice. So far, we have all contiguous sub-matrices.
     Ẏ                       – Flatten by 1 level.
      µ      µƇ              – Filter-keep those that are at least 3 by 3:
       ,Z                      – Pair each sub-matrix S with Sᵀ.
         Ẉ                     – Get the length of each (no. rows, no. columns).
          >2                   – Element-wise, check if it's greater than 2.
            Ạ                  – All.
               µ          )  – Map over each sub-matrix S that's at least 3 by 3
                ḊṖ           – Remove the first and last elements.
                  ZƊ         – Zip and group the last 3 atoms as a single monad.
                    ⁺        – Do twice (generates the inner cells).
                     FṀ      – Flatten, and get the maximum.
                       <Ç    – Element-wise, check if the results of the helper
                               link are greater than those in this list.
                         Ȧ   – Any and all. 0 if it is empty, or contains a falsey
                               value when flattened, else 1.
                           Ṁ – Maximum.

Clean, 224 ... 161 bytes
import StdEnv,StdLib
p=prod
~ =map
^ =reverse o$
@ =transpose o~(^o^)
$l=:[h:t]|h>1=l=[1: $t]
$e=e
?m=p[p(~p(limit(iterate(@o@)(~(~(\a|a>b=2=0))m))))\\n<-m,b<-n]

Try it online!
Defines the function ? :: [[Int]] -> Int, returning 0 if there is an ring, and 1 otherwise.
Works by turning the matrix into 2s for mountains and 0s for valleys, then floods in with 1s until the result stops changing. If any 0s still exist for any mountain height, the product will be 0.

JavaScript (Node.js), 302 bytes
a=>a.some((b,i)=>b.some((n,j)=>(Q=(W=(i,j,f)=>[a.map((b,I)=>b.map((t,J)=>I==i&J==j)),...a+0].reduce(A=>A.map((b,I)=>b.map((t,J)=>f(I)(J)&&(A[I-1]||b)[J]|(A[I+1]||b)[J]|b[J-1]|b[J+1]|t))))(i,j,I=>J=>a[I][J]<=n)).some((b,i)=>b.some((d,j)=>d&&!i|!j|!Q[i+1]|b[j+1]==b.b))<!/0/.test(W(0,0,I=>J=>!Q[I][J]))))

Try it online!
Checks if flowing from a point can't reach the border, while border can walk to every point