text:
Design a commutative injective function between any (restricted) infinite set and unordered pairs thereof
Related, but this only requires positive integers and does not have to be commutative
The Cantor Pairing Function is described in this Wikipedia article. Essentially, it is an operation such that when it is applied to two values X and Y, one can obtain the original values X and Y given the result.
Your task is to design two functions: one which performs X, Y -> Z and the other which performs Z -> X, Y. Here's the catch: X, Y -> Z must be commutative. This means that Z -> X, Y won't be able to determine if the input was X, Y or Y, X.
The formal definition of this challenge would be:
Choose an countable infinite set S of numbers.
Design two functions that perform the following tasks:

Given an unordered pair of values in S, return a value in S
Given a return value from the initial function, return the unordered pair of values which evaluates to the input integer when passed through the first function. I don't care about the behaviour of this inverse function if the input isn't a return value from the first function.

Requirements

The result should be identical between runs.
{a, a} is an unordered pair

Note: your answer is more likely to get an upvote from me if you provide a proof, but I will test answers when I get to it and upvote it once I'm fairly sure it works.

Doesn't this fit better for https://puzzling.stackexchange.com/?

@Jakube Not necessarily, as you are required to write code.

I'm assuming pairs are unique, but the numbers used in those pairs are not? So when 1,2 is one of the pairs, 1,3 can also be a potential pair (both use 1)?

@KevinCruijssen I'm not sure what you mean

@Giuseppe The inverse does not need to be able to return the correct order; it's just that for function f and its inverse g, sorted((x, y)) should be the same as sorted(g(f(x, y)))

@HyperNeutrino gotcha. That makes sense now.

Can we return a delimited string containing X & Y for the second function?

All answers so far appear to have assumed that {a, a} is an unordered pair, yet some definitions don't allow the members to be equal. Could you clarify?

Can the two functions share code?

@xnor I'm going to say that the two programs must be independent; that is, they can run on their own. Shared code would then have to be counted twice

does the function have to be a bijection? the title says so, but I don't see this requirement in the question, just injective.

@proudhaskeller I should remove bijection since commutative bijection is a contradiction. Yes, just injective. Thanks.

@Shaggy If that's approved by meta as a way of outputting a pair/tuple of numbers, then sure. If it's obvious what the two numbers are, that's fine.

@Dennis Um yes I should have specified; {a, a} is an unordered pair

If the pair-to-value function isn't required to be surjective, maybe "Given a value in S" could say "Given a return value from the first function"?  And maybe clarify whether it's okay for the value-to-pair function to output anything including pairs of elements of S, crash, etc. if its input is not a possible output of the pair-to-value function?

@aschepler Sure, I'll add something and if you want more clarified I'll add more. Thanks!

Haskell, 65 + 30 = 95 bytes
a#b=length.fst$span(<(max a b,min a b))[(a,b)|a<-[1..],b<-[1..a]]

Try it online!
([(a,b)|a<-[1..],b<-[1..a]]!!)

Try it online!

Note: When the two functions may share code, this is only 75 bytes:
(l!!)
a#b=length.fst$span(<(max a b,min a b))l
l=[(a,b)|a<-[1..],b<-[1..a]]

Try it online! The domain is the positive integers. The function (#) performs the pairing, the function (l!!) its inverse. Usage example: Both (#) 5 3 and (#) 3 5 yield 12, and (l!!) 12 yields (5,3).
This works by explicitly listing all sorted pairs in an infinite list l:
l = [(1,1),(2,1),(2,2),(3,1),(3,2),(3,3),(4,1),(4,2),(4,3),(4,4),(5,1),(5,2),(5,3),(5,4),(5,5),(6,1), ...`

The encoding is then just the index in this list.

by the OP, shared code must be counted twice

Pyth, 8 + 6 = 14 bytes
ij\aSQ16

    SQ   # Sort the input
 j\a     # join with "a"
i     16 # convert from base 16 to base 10

Try it online!
c.HQ\a

 .HQ     # convert from base 10 to 16
c   \a   # split on "a"

Try it online!
Domain: Positive integers.

nice approach! +1

Doesn't work for a lot of numbers like 2 and 10 for example (which are in the domain)

Sure. Example1, Example2

The 2nd function is supposed to work for any value in S, not just one that was generated with the first function (I made the same mistake).

Jelly, 8 + 11 = 19 bytes
Rolled back since Rod's algorithm didn't work.
This works on the domain of the positive integers.
Takes x and y as 2 arguments, doesn't matter in which order, returns z.
»’RSð+ð«

Try it online!
Takes z and returns [min(x, y), max(x, y)]
R€Ẏ,Rx`$ị@€

Try it online!

Why the downvotes? This isn't Rod's algorithm.

C (gcc), 36 + 39 = 75 bytes
Thanks to @tsh for saving two bytes.
The domain is non-negative integers.
p(x,y){return y>x?p(y,x):-~x*x/2+y;}

Takes x and y, returns z.
u(int*r){for(*r=0;r[1]>*r;r[1]-=++*r);}

Takes a two-element int array. The second element must be set to z before the call. After the call r contains x and y.
Try it online!

(x+1) -> -~x

JavaScript (ES7), 44 bytes
(x,y)=>x>y?x*x+y:y*y+x
z=>[x=z**.5|0,y=z-x*x]

Maps from non-negative integers to a subset thereof.

Jelly, 13 11 bytes
pair of positive integers to positive integer, 5 bytes
Ṁc2+Ṃ

Try it online!
positive integer to pair of positive integers, 6 bytes
ŒċṀÞị@

Try it online!
Algorithm
If we sort the set of all unordered pairs of positive integers by their maximum and then by their sum, we get the following sequence.
{1,1}, {1,2}, {2,2}, {1,3}, {2,3}, {3,3}, {1,4}, {2,4}, {3,4}, {4,4}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}, …
The first function takes a pair {x,y} and finds its index in this sequence.
The second function takes a positive integer z and returns the zth item of the sequence.
Note that this mapping is the same as in @EriktheOutgolfer's Jelly answer.
How it works
Ṁc2+Ṃ   Main link. Argument: [x, y]
        Let m = max(x, y) and n = min(x, y).

Ṁ       Maximum; yield m.
 c2     2-combinations; yield mC2 = m(m-1)/2.
        Note that there's one pair with maximum 1 ({1,1}), two pairs with maximum 2
        ({1,2}, {2,2}), etc., so there are 1 + 2 + … + (m-1) = m(m-1)/2 pairs with
        maximum less than m.
    Ṃ   Minimum; yield n.
        Note that {x,y} is the n-th pair with maximum m.
   +    Add; yield mC2 + n.
        This finds {x,y}'s index in the sequence.

ŒċṀÞị@  Main link. Argument: z

Œċ      2-combinations w/replacement; yield all pairs [x, y] such that x ≤ y ≤ z.
  ṀÞ    Sort by maximum.
    ị@  Retrieve the pair at index z (1-based).

Explanation please. I'm not confident this is valid...

I've added the algorithm.

Something doesn't stick well to me...although I'm not sure if this is invalid either. Basically it kind of doesn't stick well that you use both c and Œċ...although I may be wrong. BTW that was my answer that you outgolfed >_>

The difference is minimal for pairs. If C computes combinations without replacement and Ƈ computes combinations with, nƇ2 = nC2 + n.

Mathematica (35+53)=78 Bytes
((x=Min[#])+(y=Max[#]))(x+y+1)/2+y&

(i=Floor[(-1+Sqrt[1+8#])/2];{#-i(1+i)/2,i(3+i)/2-#})&

This is the one good known quadratic pairing function for Z<-->ZxZ combined with Min and Max to make it orderless.

Java 8, 153 146 141 137 + 268 224 216 205 bytes
Pair function
a->{String f="";for(int i=(f+a[0]).length(),c=0,j;i>0;i-=c,f+=c,c=0)for(j=1;j<10;c+=i-j++<0?0:1);return new Integer(a[0]+""+a[1]+"0"+f);}

Try it online!
Depair function
r->{String a=r+"",t=a.substring(a.lastIndexOf('0')+1);int l=0,i=l,o=t.length();for(;i<o;l+=r.decode(t.charAt(i++)+""));return new int[]{r.decode(a.substring(0,l)),r.decode(a.substring(l,a.length()-o-1))};}

Try it online!

You can golf a few parts. In the pair function: int i=(""+a[0]).length() can be int i=(f+a[0]).length(); the space between c=0,j;i>0; can be removed; a[0].parseInt can be new Integer. In the depair function: all three r.parseInt can be r.decode; and you could make an int variable for t.length(), since you use it twice.

Ruby, 66 bytes
f=->x,y{2**~-x|2**~-y}
g=->n{x,y=(1..n).select{|i|n[i-1]>0};[x,y||x]}

I'm trying to find a way to cunningly select an infinite set to make this easier, this is the best I've got so far.
We define f(x,y) = 2x-1 bitwise-or 2y-1. The domain consists of the set defined recursively as containing 1,2, and all numbers that can be produced by calling f on numbers in the set (note that f(1,1) = 1 and f(2,2) = 2, so 1 and 2 have inverses). The resulting numbers all have either one or two 1s in their binary expansion, with the indices of the 1s corresponding to numbers in the set. We can get the original unordered pair out by taking the indices. If there's only one 1, that means the elements of the pair are equal.
For example, f(3,5) is 20, because 20 is 10100 in base 2, which has 1s in the 3rd and 5th least significant places.

S=this set (OEIS link)

Thanks, S is actually a subset of that OEIS sequence though because it only includes numbers whose 1s have indexes in S.

ah yes, of course. Well, no other sequence matches the first few terms (up to 32).

Add 0 to S and you can save a few decrements.

05AB1E, 6 + 11 = 17 bytes
Port of my Jelly answer.
Domain: positive integers.
Takes a list [x, y] as input, returns z.
{`<LO+

Try it online!
Takes a positive integer z as input, returns [min(x, y), max(x, y)].
L2ã€{RÙR¹<è

Try it online!
-5 thanks to Emigna.

Your second program can save 5 bytes with L2ã€{RÙRI<è

@Emigna Nice trick with 2ã€{RÙR!

JavaScript, 72 bytes
f=a=>eval('0x'+a.sort().join`a`)
g=n=>n.toString(16).split`a`.map(x=>+x)

Works for positive integers (in theory). Quite simple idea: sort two number in some (magic) order, connect them as string by a letter "a", parse it as hex integer.

f=a=>eval('0x'+a.sort().join`a`)
g=n=>n.toString(16).split`a`.map(x=>+x)

     X = <input id="x" type="number" min="0" />
     Y = <input id="y" type="number" min="0" />
 f(X,Y)= <output id="p"></output>

     U = <input id="u" type="number" />
   g(U)= <output id="q"></output>

MATL, 6+8=14 bytes
Encoding function, takes two inputs n, m. Outputs product of nth prime and mth prime.
,iYq]*

Steps:

,  - Do twice
i  - Push input
Yq - Pop input, push input'th prime
]* - End do twice, pop both primes and push product

Decoding function, takes one input m. Outputs the number of primes below each of the prime factors of n.
iYf"@Zqn

Steps:

i - Push input
Yf - Pop input, push array of prime factors
" - For n in array
@Zq - Push array of primes below n
n - Pop array, push length of array

This is commutative because multiplication is commutative, and injective because prime factorizations are unique. Not that this is not onto the integers.

Husk, 5+3=8 bytes
I really hope I got the challenge right, I see some deleted answers that seem valid to me...
Couples of positive integers to a single positive integer:
¤*!İp

Try it online!
It works by taking the numbers at the given indices (1-indexed) from the list of prime numbers, and multiplying them.
Result of the first function to couples of positive integers:
mṗp

Try it online!
We factorize the input number and return the index in the list of primes of all (both) of its factors.
Worked example
Given (4,1) as a starting couple, we take the fourth and first prime numbers (7,2) and multiply them → 14. This multiplication is what makes the function indipendent on the order of the two elements.
Starting from 14, we factorize it (2,7) and return the indices of 2 and 7 in the list of prime numbers → (1,4).

Actually, looking at the deleted answer from Arnauld, its algorithm is even better, and porting it to Husk would result in 6 bytes... Could someone confirm whether its solution (and mine too) is valid or not?

Doesn't work for primes (which are in the domain of positive integers)

@Emigna the second function doesn't, but primes are never returned by the first one...

Your domain is positive integers, so both methods need to work for positive integers. EDIT: or at least that used to be a requirement. The current rules seem to allow a subset of the domain.

C#, 80 bytes ( 38 + 42 )

Data
Encoder

Input Int32 l A number
Input Int32 r A number
Output Int64 Both ints fused together

Decoder

Input Int32 v The value
Output Int32[] An array with the two original ints.

Golfed
// Encoder
e=(l,r)=>{return(long)l<<32|(uint)r;};

// Decoder
d=v=>{return new[]{v>>32,v&0xFFFFFFFFL};};

Ungolfed
// Encoder
e = ( l, r ) => {
    return (long) l << 32 | (uint) r;
};

// Decoder
d = v => {
    return new[] {
        v >> 32,
        v & 0xFFFFFFFFL };
};

Ungolfed readable
// Encoder
// Takes a pair of ints
e = ( l, r ) => {

    // Returns the ints fused together in a long where the first 32 bits are the first int
    // and the last 32 bits the second int
    return (long) l << 32 | (uint) r;
};

// Decoder
// Takes a long
d = v => {

    // Returns an array with the ints decoded where...
    return new[] {

        // ... the first 32 bits are the first int...
        v >> 32,

        // ... and the last 32 bits the second int
        v & 0xFFFFFFFFL };
};

Full code
using System;
using System.Collections.Generic;

namespace TestBench {
    public class Program {
        // Methods
        static void Main( string[] args ) {
            Func<Int32, Int32, Int64> e = ( l, r ) => {
                return(long) l << 32 | (uint) r;
            };
            Func<Int64, Int64[]> d = v => {
                return new[] { v >> 32, v & 0xFFFFFFFFL };
            };

            List<KeyValuePair<Int32, Int32>>
                testCases = new List<KeyValuePair<Int32, Int32>>() {
                    new KeyValuePair<Int32, Int32>( 13, 897 ),
                    new KeyValuePair<Int32, Int32>( 54234, 0 ),
                    new KeyValuePair<Int32, Int32>( 0, 0 ),
                    new KeyValuePair<Int32, Int32>( 1, 1 ),
                    new KeyValuePair<Int32, Int32>( 615234, 1223343 ),
                };

            foreach( KeyValuePair<Int32, Int32> testCase in testCases ) {
                Console.WriteLine( $" ENCODER: {testCase.Key}, {testCase.Value} = {e( testCase.Key, testCase.Value )}" );
                Console.Write( $"DECODING: {e( testCase.Key, testCase.Value )} = " );
                PrintArray( d( e( testCase.Key, testCase.Value ) ) );

                Console.WriteLine();
            }

            Console.ReadLine();
        }

        public static void PrintArray<TSource>( TSource[] array ) {
            PrintArray( array, o => o.ToString() );
        }
        public static void PrintArray<TSource>( TSource[] array, Func<TSource, String> valueFetcher ) {
            List<String>
                output = new List<String>();

            for( Int32 index = 0; index < array.Length; index++ ) {
                output.Add( valueFetcher( array[ index ] ) );
            }

            Console.WriteLine( $"[ {String.Join( ", ", output )} ]" );
        }
    }
}

Releases

v1.0 - 80 bytes - Initial solution.

Notes

None

Python: 41+45=86
encoder: 41
e=lambda*x:int('1'*max(x)+'0'+'1'*min(x))

e(4, 3), e(3,4)

(11110111, 11110111)

decoder: 45
d=lambda z:[len(i)for i in str(z).split('0')]

d(11110111)

[4, 3]

Older attempt:
Python: 114: 30 + 84
encoder: 30
accepts 2 integers, returns a string
e=lambda*x:2**max(x)*3**min(x)

e(3, 4), e(4, 3)

(432, 432)

decoder: 86
def d(z):
 x=y=0
 while 1-z%2:
  x+=1
  z/=2
 while 1-z%3:
  y+=1
  z/=3
 return x,y

d(432)

4, 3

decoder2: 120
another attempt with generator comprehensions and sum
def d(z):
 x=sum(1 for i in range(z)if not z%(2**i))-1
 z/=2**x
 return x,sum(1 for i in range(int(z))if not z%(3**i))-1

based on second attempt: e=lambda*x:10**sum(x)-10**min(x);d=lambda z:map(z.count,'09'); TIO

@tsh very nice. I will adapt it later, or you can submit your own answer

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


text:
Draw Translucent Boxes
note: the string art might look horrible here because of SE font weirdness :P :(
Given a list of four-tuples representing the corners of rectangles, draw translucent rectangles over each other in that order.
For this challenge, you are required to have the smallest coordinate in the top-left corner and the x-axis increasing to the right and the y-axis increasing downwards.
A four-tuple (x0, y0, x1, y1) or (x0, x1, y0, y1) represents the (x, y) coordinate pairs of the top-left and bottom-right corners of a rectangle (you may choose either of the two formats for rectangles but it must be consistent)
What do I mean by "translucent rectangle"? Well, for this challenge, you will be using the space character and most of the box-drawing characters; specifically, all of the ones used to draw rectangles, including "bold" characters. When a translucent rectangle is drawn, first all thin lines in the space being occupied disappear and all bold lines become thin, and then the rectangle itself is drawn over in bold lines.
For example, if you draw a rectangle in the top-left and then in the bottom-right, it might look something like this:
┏━━━━┓
┃    ┃
┃    ┃
┃ ┏━━╇━━┓
┃ ┃  │  ┃
┗━╉──┘  ┃
  ┃     ┃
  ┃     ┃
  ┗━━━━━┛

To be clear, lines are lightened (bold -> thin -> none) for all lines strictly within the rectangle (for example, downwards facing lines are affected for the top edge but not the bottom edge).
Test Cases
Some number of lines of input will be given, followed by unicode-art, for each test case.
0 0 5 5
5 5 10 10
3 3 7 7
2 2 8 8

┏━━━━┓
┃    ┃
┃ ┏━━╇━━┓
┃ ┃┌─┴─┐┃
┃ ┃│   │┃
┗━╉┤   ├╊━┓
  ┃│   │┃ ┃
  ┃└─┬─┘┃ ┃
  ┗━━╈━━┛ ┃
     ┃    ┃
     ┗━━━━┛

14 5 15 9
13 2 15 16
6 4 15 11

             ┏━┓
             ┃ ┃
      ┏━━━━━━╇━┫
      ┃      │ ┃
      ┃      │ ┃
      ┃      │ ┃
      ┃      │ ┃
      ┃      │ ┃
      ┃      │ ┃
      ┗━━━━━━╈━┫
             ┃ ┃
             ┃ ┃
             ┃ ┃
             ┃ ┃
             ┗━┛

6 8 10 11
15 12 16 16
14 10 16 16
9 1 15 15

         ┏━━━━━┓
         ┃     ┃
         ┃     ┃
         ┃     ┃
         ┃     ┃
         ┃     ┃
         ┃     ┃
      ┏━━╉┐    ┃
      ┃  ┃│    ┃
      ┃  ┃│   ┌╊┓
      ┗━━╉┘   │┃┃
         ┃    │┠┨
         ┃    │┃┃
         ┃    │┃┃
         ┗━━━━╈┩┃
              ┗┷┛

Generate more test cases!
Rules

Input can be in any reasonable format for a list of four-tuples. Input can be one-indexed or zero-indexed along either axis (i.e. the top-left corner can be any of (0, 0), (0, 1), (1, 0), (1, 1).
Output must be as unicode-art as described. Output may not have leading newlines and can have at most one trailing newline (after the last line). Trailing whitespace will be ignored for the purposes of this challenge.

Code-points
The bold and light horizontal and vertical pipes are in the range [U+2500, U+2503]. The various corner pipes are in the range [U+250C, U+251C). The three-armed pipes are in the range [U+251C, U+253C). The four-armed pipes are in the range [U+253C, U+254C). The remaining pipes that can be found in my program are never actually used.

Is this really ascii art? Aside from spaces, it doesn't use any ascii characters.

@cairdcoinheringaahing From the [tag:ascii-art] info, Typically this uses only 95 printable (from a total of 128) characters defined by the ASCII Standard from 1963.

@cairdcoinheringaahing https://codegolf.meta.stackexchange.com/questions/10218/text-art-or-ascii-art-which-tag-should-we-have

can we use the character b/w 220 - 223 from here ? for the bold lines
http://dochome.programbl.com/dochome/sites/default/files/image169.png

OR the double lined characters, as it will make it quite easier to find and implement the right characters ,as it is not the intended primary motive of this question I think we should get a little slack there.

@MukulKumar No, you must use those exact characters. You are allowed to take any unduplicated substring of any permutation of the entire set of characters as input so you don't have to waste bytes/chars hardcoding the characters in.

Python 3, 289 286 bytes
l,u=eval(input())
*_,w,h=map(max,zip(*l))
r=[*map(list,[' '*-~w]*-~h)]
R=range
for x,y,X,Y in l:
 for i in R(x,X+1):
  for j in R(y,Y+1):Q=i<X,y<j,x<i,j<Y;r[j][i]=u[sum(3**o*max(Q[o]*[j in(y,Y),i in(x,X)][o%2]*2,u.index(r[j][i])//3**o%3-Q[o])for o in R(4))]
for l in r:print(''.join(l))

Try it online!
Takes input as a list of 4-tuples: (x0, y0, x1, y1), along with the pipedrawing characters as follows: " ╶╺╵└┕╹┖┗╴─╼┘┴┶┚┸┺╸╾━┙┵┷┛┹┻╷┌┍│├┝╿┞┡┐┬┮┤┼┾┦╀╄┑┭┯┥┽┿┩╃╇╻┎┏╽┟┢┃┠┣┒┰┲┧╁╆┨╂╊┓┱┳┪╅╈┫╉╋"
Supports boxes of zero width or height (uses all box drawing chars).
Based on my answer to this question, but modified to alter existing boxes when drawing.
'Ungolfed':
u=" ╶╺╵└┕╹┖┗╴─╼┘┴┶┚┸┺╸╾━┙┵┷┛┹┻╷┌┍│├┝╿┞┡┐┬┮┤┼┾┦╀╄┑┭┯┥┽┿┩╃╇╻┎┏╽┟┢┃┠┣┒┰┲┧╁╆┨╂╊┓┱┳┪╅╈┫╉╋"

#Create array of spaces:
l=eval(input())
w,h=list(map(max,zip(*l)))[2:]
r=[[' ']*w for _ in' '*h]

for x,y,X,Y in l:
 n,m=X-1,Y-1
 for i in range(x,X):
  for j in range(y,Y):
   A,B=j in(y,m),i in(x,n)
   P=(i<n*A,y<j*B,x<i*A,j<m*B)   # Pipe sides of the new box
   Q=(i<n,y<j,x<i,j<m)           # Pipe sides that are inside the new box, and should be thinned.
   # Get new pipe (sides of new box, on top of thinned pipes of existing boxes. (u.index... is existing pipe))
   l=sum(3**o*max(P[o]*2,(u.index(r[j][i])//3**o%3)-Q[o])for o in range(4))
   #Add to 'canvas'
   r[j][i]=u[l]

print('\n'.join(''.join(l)for l in r))

You can take u as input.

@HyperNeutrino thanks :)

You can save a byte by starring your unnecessary variable, replacing _,_,w,h= with *_,w,h=.

Also, your tuple assignment to Q does not need any parentheses, Q=(i<X,y<j,x<i,j<Y); can be replaced with Q=i<X,y<j,x<i,j<Y; for two saved bytes.

@JonathanFrech Thanks :)

JavaScript (ES6), 298 261 bytes
(a,u,m=n=>[...Array(1+Math.max(...a.map(t=>t[n])))])=>m(3).map((_,j)=>m(2).map((_,i)=>u[a.reduce((c,[x,y,v,w])=>i<x|j<y|i>v|j>w?c:(g=n=>c-=c/n%3|0&&n,h=n=>c+=n*(2-(c/n%3|0)),[i>x&&9,i<v].map(j>y&j<w?g:h),[j>y&&3,j<w&&27].map(i>x&i<v?g:h),c),0)]).join``).join`\n`

Where \n represents the literal newline character. Based on my answer to Unicode rectangles. Explanation: An array of strings of spaces is created to draw in. Each spaces is then processed by looping over all the boxes in the input. Characters that lie outside of the box are then ignored but those on the edge or inside are processed further. For each of the four line segments making up a character (each represented by a power of 3) there are then three possibilities; a) the segment lies just outside the box and should be ignored (achieved by passing a parameter of 0 instead of the power of 3) b) the segment lies on the edge of the box and should be bold (achieved by calling the h function) c) the segment lies inside the box and should be lightened (achieved be calling the g function). The character is then indexed into the Unicode string. Once all the boxes have been processed the array is then joined on newlines.

f=
(a,u,m=n=>[...Array(1+Math.max(...a.map(t=>t[n])))])=>m(3).map((_,j)=>m(2).map((_,i)=>u[a.reduce((c,[x,y,v,w])=>i<x|j<y|i>v|j>w?c:(g=n=>c-=c/n%3|0&&n,h=n=>c+=n*(2-(c/n%3|0)),[i>x&&9,i<v].map(j>y&j<w?g:h),[j>y&&3,j<w&&27].map(i>x&i<v?g:h),c),0)]).join``).join`
`
;u=" ╶╺╵└┕╹┖┗╴─╼┘┴┶┚┸┺╸╾━┙┵┷┛┹┻╷┌┍│├┝╿┞┡┐┬┮┤┼┾┦╀╄┑┭┯┥┽┿┩╃╇╻┎┏╽┟┢┃┠┣┒┰┲┧╁╆┨╂╊┓┱┳┪╅╈┫╉╋";
[[
[0, 0, 5, 5],
[5, 5, 10, 10],
[3, 3, 7, 7],
[2, 2, 8, 8],
],[
[14, 5, 15, 9],
[13, 2, 15, 16],
[6, 4, 15, 11],
],[
[6, 8, 10, 11],
[15, 12, 16, 16],
[14, 10, 16, 16],
[9, 1, 15, 15],
]].map(a=>document.write(`<pre style="font-family:Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,sans-serif">${f(a,u)}</pre>`));

source: Stack Exchange

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

sort: votes


text:
How many Lynch-Bell numbers are there?
Challenge
Given an integer, n, as input where 36 >= n >= 2, output how many Lynch-Bell numbers there are in base n.
The output must be in base 10.
Lynch-Bell Numbers
A number is a Lynch-Bell numbers if:

All of its digits are unique (no repetition of digits)
The number is divisible by each of its digits
It doesn't contain zero as one of its digits

Since, all of the digits have to be unique, and you have a finite set of single digit numbers in each base, there is a finite number of Lynch-Bell numbers.
For example, in base 2 there is only one Lynch-Bell number, 1, since all other numbers either repeat digits or contain a 0.
Examples
Input > Output
2 > 1
3 > 2
4 > 6
5 > 10
6 > 10
7 > 75
8 > 144
9 > 487
10 > 548

Mathematica Online ran out of memory above base 10. You can use the following code to generate your own:
Do[Print[i," > ",Count[Join@@Permutations/@Rest@Subsets@Range[#-1],x_/;And@@(x\[Divides]FromDigits[x,#])]&[i]],{i,10,36,1}]

Winning
Shortest code in bytes wins.

@MagicOctopusUrn Why do we need a dictionary? We don't need to output in that base.

@BetaDecay That will turns the problem into a kolmogorov-complexity one.

@user202729 Yep, I've edited it now

@MagicOctopusUrn Sorry I didn't read the problem specification carefully. Output ... in base n.

could you add an example >10?

The output does not actually need to be in base n, right? ("...output how many Lynch-Bell numbers there are in base n" appears to have caused some confusion.)

@JonathanAllan I see, I've cleared that up now

If only [2-36] need be supported we may as well list them all.

Related, also related

That I've said, No, up to 36 should be fine will turns the problem into a kolmogorov-complexity one.

http://oeis.org/A034838 may be helpful.

Turns out that no one has managed to calculate f(36). Make a fastest-code challenge based on this would be probably interesting.

Jelly, 13 bytes
Q⁼g
*`Ṗ©bç"®S

Try it online!
Another O(nn) solution.
Explanation
Q⁼g  Helper link. Input: digits (LHS), integer (RHS)
Q    Unique (digits)
 ⁼   Match
  g  GCD between each digit and the integer

*`Ṗ©bç"®S  Main link. Input: integer n
*`         Compute n^n
  Ṗ        Pop, forms the range [1, n^n-1]
   ©       Store previous result in register
    b      Convert each integer to base n
     ç"    Call the helper link, vectorized, with
       ®   The register's value
        S  Sum

16 bytes ṖŒPḊŒ!€Ẏ⁼g¥"ḅ¥³S and faster

Jelly, 15 bytes
*ḃ€’Q€Qḍḅ¥€⁸Ạ€S

Try it online!
Complexity O(nn).

Only in code-golf is an O(N^N) solution not only acceptable, but good.

@DJMcMayhem Meh, I think we can pump those numbers up and get O(N↑↑N)

Should it be O(N^(N+1)) because check the validity of each generated number takes O(N)? (although I don't understand Jelly)

@user202729 N+1 is just N in big-O notation.

@mbrig Of course I understand big-O notation, that (N+1 is in O(N)) does not implies N^(N+1) is in O(N^N).

Java, 222 212 190 bytes
-10 bytes thanks to Herman
-22 bytes thanks to Kevin
import java.util.*;a->{int c=0,i=1;A:for(;i<Math.pow(a,a);i++){Set g=new HashSet();for(char b:a.toString(i).toCharArray())if(!g.add(b)|b<49||i%a.parseInt(b+"",a)>0)continue A;c++;}return c;}

Ungolfed:
a -> {
    int count = 0;
    OUTER:
    for (int i = 1; i < Math.pow(a, a); i++) {
        Set<Character> found = new HashSet<>();
        for (char b : Integer.toString(i, a).toCharArray()) {
            if (!found.add(b) || b == 48 || i % Integer.parseInt(b + "", a) != 0) {
                continue OUTER;
            }
        }
        count++;
    }
    return count;
}

Try it online!
Gets very slow for large numbers.

-10 bytes: a->{int c=0,i=1;A:for(;i<Math.pow(a,a);i++){java.util.Set<Character>g=new java.util.HashSet<>();for(char b:Long.toString(i,a).toCharArray())if(!g.add(b)|b<49||i%Long.parseLong(b+"",a)>0)continue A;c++;}return c;}

One of the first times I've seen a label used in a codegolf answer

A: and continue A; are 13 bytes while {--c;break;} is 12. Would that instroduce some bug I don't see?

This might be worth a separate answer, but you can loop through the digits in base n by each digit being i%a and i/=a at each loop. You can avoid the set by using an int[] and checking that x[b]++<2

java.util.Set<Character>g=new java.util.HashSet<>(); can be import java.util.*; + Set g=new HashSet();; Long.toString can be a.toString; and Long.parseLong can be a.parseInt.

@KevinCruijssen Thanks a lot!

Perl 6, 86 84 77 bytes
-2 bytes thanks to Ramillies
->\n{n-1+grep {.Set==$_&&.reduce(* *n+*)%%.all},map {|[X] (1..^n)xx$_},2..^n}

Try it online!
Works for n=8 on TIO.

I think you can save 2 bytes by doing .all instead of all $_.

Mathematica, 82 79 76 bytes
Count[Join@@Permutations/@Subsets@Range[#-1],x_/;x==x~FromDigits~#~GCD~x]-1&

How do you pass a number into this? (sorry, Mathematica is new to me)

Paste the function (e.g., to Wolfram sandbox), and then put [<parameter>] after that. With parameter being a number.

Can you add a TIO, or equivalent?

@Shaggy https://www.wolframcloud.com/objects/025b270d-d293-4459-a8f4-2cfb7e769f21

Are f(5) and f(6) both really 10? That's odd...

@BetaDecay The link will likely to expire soon.

@user202729 Hm that's a shame

@BetaDecay It works for 2 and 10.

@Mr.Xcoder Never mind, I was mistaken

Actually, 24 bytes
;╗DR⌠╜DR╨i⌡M⌠;╜@¿♀%ΣY⌡MΣ

Try it online!
Explanation
This program consists of two main parts: the permutation generation, and the Lynch-Bell test. So, this explanation will look at each part separately, for greater clarity.
Generating Permutations
Input: n (an integer in [2, 36])
Output: all partial and total permutations of [1, n-1] (sequences containing values from [1, n-1] without repetition whose length is in [1, n-1])
;╗DR⌠╜DR╨i⌡M
;╗            store a copy of n in register 0
  DR          range(1, n)
    ⌠╜DR╨i⌡M  do the following for each element k in range:
     ╜DR        range(1, n)
        ╨       k-permutations of [1, n-1]
         i      flatten

Lynch-Bell Test
Input: a list of base-n integers, represented as lists of base-n digits
Output: the number of Lynch-Bell numbers in base n
⌠;╜@¿♀%ΣY⌡MΣ
⌠;╜@¿♀%ΣY⌡M   for each base-n digit list a:
 ;╜             duplicate a, push n
   @¿           convert a from base-n to decimal
     ♀%         modulo a with each of its base-n digits
       Σ        sum
        Y       boolean negation (1 if all modulo results are 0, else 0)
           Σ  sum (count the 1s in the resultant list)

05AB1E, 22 bytes
mLIBε0KÙ}ÙvyIöySIö%O_O

Try it online!
O_O was also my face when this finally worked.
<ÝIBJ0Kæ¦Ù€œ˜ is faster than the way I use to generate the numbers in the actual answer but randomly stops working for anything bigger than 7 (for no apparent reason?)
Explanation
mLIBε0KÙ}ÙvyIöySIö%O_O # (input = i)
m                      # Push i^i
 L                     # ...and get a range from one to this value
  IB                   # Map every element to their base i representation
    ε   }              # Map every element to ...
     0K                 # Itself without 0s
       Ù                # ...and only unique digits
         Ù             # Uniquify the resulting list
          v            # For each element...
           yIö          # Push it converted to base 10
              ySIö      # Push every digit of it converted to base 10 in a list
                  %     # Calculate the modulo for each digit
                   O    # Sum all results together
                    _   # Negate: Returns 0 for every positive number and 1 for 0
                     O  # Sum with the rest of the stack (Basically counting all Lynch-Bell-Numbers)
                       # Implicit print

I'm pretty sure a different approach can save more bytes, but in your current solution ε0KÙ} can be 0м€Ù to save a byte.

Perl 5, 80 76 bytes (75 + -p)
$\+=!grep$_?$;%$_|$|{0,$_}++:1,@@until($@[$}++]+=1)%=$_ and++$;,$}=$}==$_}{

Abusing $; for fun and profit. Times out on inputs > 8.
EDIT: -4 bytes by merging the two loops.

Ruby, 80 65 bytes
->n{(1..n**n).count{|i|(d=i.digits n)-[0]==d|d&&d.sum{|j|i%j}<1}}

Try it online!
Thanks to G B for -15 bytes.

This won't work for n>10 (because of "j.to_i")

Good catch, too bad it times out well before that :)

Anyway: you could call "digits" passing the base as argument and save a lot:  ->n{(1..n**n).count{|i|(d=i.digits n)-[0]==d|d&&d.sum?{|j|i%j}<0}}

Indeed I absolutely missed that digits has this parameter. But I see you had posted this as a separate answer and then deleted. I'd say, go ahead, you beat me to it :)

I think my answer is too similar, it's the same approach with a couple of shortcuts, mostly stolen code.

OK, then thanks for your help.

Japt -x, 25 19 bytes
-6 bytes thanks to Shaggy
pU õìU ËeDâ f myDìU

Try it online!

20 bytes?

Or 19 bytes with the -x flag.

wow O_o i'm clearly terrible at golfing japt

You're doing well so far :) It takes time to get to grips with a new language, figure out all its features, tricks & quirks.

@Shaggy but when you use a new language as often as I do it should be expected that I'd be closer to optimal than like 25% XD

Python 3, 204 174 bytes
lambda x,r=range,i=chain:sum(0**any(int(''.join(map(str,y)),x)%z for z in y)for y in i(*map(permutations,i(*[combinations(r(1,x),e)for e in r(x)]))))-1
from itertools import*

Try it online!
For each permutation of each element of powerset of range(1,n) (no zeros, unique), convert to numerical string to base n. Sum all that are divisible by each digit, subtract 1 due to powerset generating the empty set.
-30 bytes thanks to @ovs!

184 bytes

174 bytes

Haskell, 117 bytes
f n=sum[1|x<-id=<<[mapM(\_->[1..n-1])[0..m]|m<-[0..n]],all(\y->[mod(sum(zipWith((*).(n^))[0..]x))y|c<-x,c==y]==[0])x]

Try it online! Works on TIO up to n=7 before timing out.

Perl 5, 108 + 1 (-p) = 109 bytes
while(@a<$_){$r=%k=@a=();for($t=++$i;$t;$t=int$t/$_){push@a,$t%$_}$r||=!$_||$i%$_||$k{$_}++for@a;$r||$\++}}{

Try it online!
It's a pig.  Not sure if it will do more than base 8 on TIO without timing out.

C# (Visual C# Interactive Compiler), 144 bytes
n=>{int j,i,p;for(j=i=0;i++<~0UL;){p=i;var a=new List<int>();for(;p>0;p/=n)a.Add(p%n);j+=a.All(c=>c>0&&i%c<1&a.Count(x=>x==c)<2)?1:0;}return j;}

Goes through all the numbers from 0 to ulong.MaxValue, and selects those that are Lynch-Bell numbers in the specified base. Takes forever to run, even for 2, though if you set the ~0UL part in the for loop to something smaller, you can get output for input up to 7 within a minute on TIO.
Try it online!

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


text:
Date within range?
Given a MM/DD date (12/24) and a start/end date range (11/01 - 06/24), figure out if the date is within the listed date span.
Date ranges can be sequential (05/01 - 11/01) or wrap around to the next year (11/01 - 05/01).
Examples:

12/24 is in 11/01 - 06/24 = True
06/24 is in 11/01 - 06/24 = True
06/24 is in 06/24 - 06/24 = True
06/24 is in 11/01 - 06/23 = False
07/24 is in 11/01 - 06/24 = False
07/24 is in 05/01 - 11/01 = True
07/24 is in 07/23 - 07/20 = True

Years do not mater. The date and/or date range is assumed to apply for any year past or future.
The end date will always be after the start date. If the end date is numerically less than the start date, we assume we are wrapping around to the next year.
The three input variables can be via any method (args, HTTP, stdin, etc..) and in any format (string, JSON, array, etc..)
Response can be boolean or any form of a yes/no/correct/etc.. string. Shortest code wins.
You cannot simply pass args to a built-in function.

Can we take the result as an array of strings instead? I.e ['MM', 'DD']?

Test case suggestion: 11/01 - 06/24 includes 06/24?

@Mr.Xcoder are you picturing something like ['06', '24'] if right else [] or what do you mean?

What is the input format? String, or array of numbers, or array of strings, or array of arrays, or what? Or can we choose among them?

For your second test case, suppose we're talking this year 2017 and next year 2018. How are we supposed to determine that 06/24 means 2018 and thus should be True rather than 2017 and thus False because it's before 11/01?

Any special rules for 29 February?

@Notatree Unhandled Exception. Without years I am unable to figure out how one would deal with this. I don't think it's a problem. However, this brings up the question of invalid dates like (12/65)

I'm still not sure your edit about years not mattering answers my question. How are we supposed to know that 06/24 isn't meant to be "before" 11/01 and thus false?

@AdmBorkBork the end date is always after the start date. Year does not mater since spans can cross years and all we care about is date > start & date < end. The problem is that the numerical values of start and end can be high,low or low,high (fall-to-spring or spring-to-fall). See @Arnauld's answer.

just how flexible is the input format?  eg, could the format be "the number of days since the beginning of the year, so that 1/1 is 1, 1/2 is 2, etc?  if not, what about an array whose first element is the month, 2nd element is day?

"date > start & date < end" - Then some of your test cases are wrong. I think what you mean is start<=date<=end.

I think this would be a more interesting challenge if the format was DD/MM instead, because using MM/DD is just comparing plain strings.

You are correct @Shaggy, start <= date <= end

Python, 31 bytes
lambda a,d,e:(e<d)>=(a<d)+(e<a)

Try it online!
Takes inputs as  MM/DD in order target, start, end.

Haskell, 28 bytes
(a%d)e=((e<a)/=(a<d))==(e<d)

Try it online!
Thanks to Leo for the trick of xor'ing the Booleans with /=.

Haskell, 33 bytes
(a%d)e=show[e>=d,d>a,a>e]!!16>'a'

Try it online!

Your show trick is cool, but you can XOR the three elements in a more direct way with foldl1: https://tio.run/##hZA9D4IwEIZ3f8WFaNImNVDwY7GMbm5uhJiLPaKxfoTi5n9HEAStRqcnd0/e3vV2aA9kTFkyHGlOKjsbbSTzFU8oVlroGAXGlJaZYiM@OOL@BAqOeFnBJd@fChhCwnKRAYIG4nBjKLQgkfPFuCBbbLZoyaYw6IsqnzBPhn448YQnpR/IisHsUa/zK3HBnuU/7bDT87Y9bdLtKx@6YtQyeNGRH0zrdksn3a30XX/bvBqyRGPfhjs/672Trw8V/fINO@8e9s2n5R0

@Leo Nice idea, it's even shorter expanded out.

JavaScript (ES6), 26 20 bytes
(a,b,c)=>b>c^b>a^a>c

Output is 0 if a lies within the range b...c, 1 if not. Edit: Saved 6 bytes thanks to @nwellnhof.

What about (a,b,c)=>b>c^b>a^a>c?

@nwellnhof I can't believe I missed that - my very first attempt was b>a^a>c, but I then overlooked the simple fix...

You should update the byte count.

@nwellnhof Sorry, I was still reeling from the shock!

JavaScript (ES6), 31 bytes
Takes input as 3 strings in MM/DD format: date, range_from, range_to. Returns a boolean.
(a,b,c)=>!(b<c?a<b|a>c:a<b&a>c)

Test cases

let f =

(a,b,c)=>!(b<c?a<b|a>c:a<b&a>c)

console.log(f('12/24','11/01','06/24')) // True
console.log(f('06/24','11/01','06/24')) // True
console.log(f('06/24','06/24','06/24')) // True
console.log(f('06/24','11/01','06/23')) // False
console.log(f('07/24','11/01','06/24')) // False
console.log(f('07/24','05/01','11/01')) // True
console.log(f('07/24','07/23','07/20')) // True

Thanks to MM/DD format you can just use string sorting. Good idea.

Haskell, 38 37 bytes
(b#e)d=(last$and:[or|b>e])[d>=b,d<=e]

Try it online!
Saved 1 byte thanks to Laikoni

You can use infix notation to save a byte: (d#b)e=.

Perl 6, 33 31 29 bytes
{.[0]>.[2]??![>] $_!![<=] $_}

Try it online!
Takes a list containing start, date, and end.
-2 bytes thanks to Ramillies.

And here, you can save 2 bytes by taking 1 list argument instead. Then @_[0] can be written as .[0] and [(whatever)] @_ as [(whatever)] $_. You just will need to call it like $f(($s,$d,$e)).

Perl 5, 60 bytes
59 bytes of code + 1 -a
$F[1]=~s/./2/if$F[1]le$F[0];say($F[2]le$F[1]&&$F[2]ge$F[0])

Try it online!
Input: start_date end_date target_date


text:
Reverse Maths Cycles
Inspired by this
In the linked challenge, we are asked to apply addition to the elements of the original and the reverse of the input array. In this challenge, we are going to make it slightly more difficult, by introducing the other basic math operations.
Given an array of integers, cycle through +, *, -, //, %, ^, where // is integer division and ^ is exponent, while applying it to the reverse of the array. Or, in other words, apply one of the above functions to each element of an array, with the second argument being the reverse of the array, with the function applied cycling through the above list. This may still be confusing, so lets work through an example.
Input:   [1, 2, 3, 4, 5, 6, 7, 8, 9]
Reverse: [9, 8, 7, 6, 5, 4, 3, 2, 1]

         [ 1,  2,  3,  4,  5,    6,  7,  8,  9]
Operand:   +   *   -   /   %     ^   +   *   -
         [ 9,  8,  7,  6,  5,    4,  3,  2,  1]

Result:  [10, 16, -4,  0,  0, 1296, 10, 16,  8]

so the output for [1, 2, 3, 4, 5, 6, 7, 8, 9] would be [10, 16, -4, 0, 0, 1296, 10, 16, 8]
To cover the corner cases, the input will never contain a 0, but may contain any other integer in the range from negative infinity to positive infinity. You may take input as a list of strings representing digits if you want.
Test cases
input => output

[1, 2, 3, 4, 5, 6, 7, 8, 9]     => [10, 16, -4, 0, 0, 1296, 10, 16, 8]
[5, 3, 6, 1, 1]                 => [6, 3, 0, 0, 1]
[2, 1, 8]                       => [10, 1, 6]
[11, 4, -17, 15, 2, 361, 5, 28] => [39, 20, -378, 7, 2, 3.32948887119979e-44, 9, 308]

This is a code-golf so shortest code (in bytes) wins!

Sandbox (2k+ only)

@AdmBorkBork He is addressing it, I pointed that out in chat.

@AdmBorkBork corrected. I missed that in my test case generator

Your third test case still contains 0 >.>

I was wrong, Ignore that

In the last example we have 361-17.  Are there any guidelines about the precision to which this should be calculated?

@DigitalTrauma your program has to handle standard precision rules. If you have to do extra to make it perfectly match, don't do the extra.

@cairdcoinheringaahing I'm using bc to do my arithmetic, which by default uses integer precision.  Are you OK with an answer of 0 for the 361-17 case, or should I "do the extra" to calculate to set bc to calculate exponents to 60 or so decimal places?

@DigitalTrauma for languages which default to integers, I think outputting 0 is acceptable for tiny numbers like that.

How flexible are you on not doing "the extra"? The exponentiation method in Japt can't (directly) take a negative number as an argument. I could work around that at a cost of 6 bytes (currently) or I could try using the exponentiation operator instead (but that would probably cost more bytes). Also, would Arnauld's original 60 byte solution (see his edit history) now be valid?

@Shaggy if the language's native number type can't handle floats without some extreme twisting of the arm (like bc), then you can not do the extra. Javascript, and by extension Japt, can handle floats quite easily, so no, it wouldn't be allowed. Sorry.

Though that might be the case; thanks for clarifying.

@cairdcoinheringaahing: bc does fixed-point decimal (default is zero places after the decimal, invoke as bc -l to set 20 places after the decimal and include math libraries), but it doesn't do scientific notation or floating point.  So with only 3 more bytes of bash script, you could get stuff like 361 ^ -2 to print as .00000767336039471765 instead of 0.  But then you'd have to mess with scale to get integer division instead of fixed-point... So yeah, I guess it's maybe justified to give bogus answers even for small negative exponents in bc, since it doesn't have float or types

Jelly, 10 bytes (fork)
+×_:%*6ƭ"Ṛ

I was just working on implementing a quick for this the other day, so it's quite surprising to see a use for it so soon. It still only exists as a fork, so you cannot try it online.
Sample output
$ ./jelly eun '+×_:%*6ƭ"Ṛ' '[1,2,3,4,5,6,7,8,9]'
[10, 16, -4, 0, 0, 1296, 10, 16, 8]
$ ./jelly eun '+×_:%*6ƭ"Ṛ' '[5,3,6,1,1]'
[6, 3, 0, 0, 1]
$ ./jelly eun '+×_:%*6ƭ"Ṛ' '[2,1,8]'
[10, 1, 6]
$ ./jelly eun '+×_:%*6ƭ"Ṛ' '[11,4,-17,15,2,361,5,28]'
[39, 20, -378, 7, 2, 3.32948887119979e-44, 9, 308]

Explanation
+×_:%*6ƭ"Ṛ  Input: array
      6ƭ    Tie 6 dyads
+             Addition
 ×            Multiplication
  _           Subtraction
   :          Integer division
    %         Modulo
     *        Power
        "   Vectorize with
         Ṛ  Reverse

whaaaaaaaat come on really :( but nice, this quick seems quite useful :D

This needs to be pulled to Jelly. +1 although you may want to extend ƭ to support nilads (replace value) and monads (apply on left argument) as well

@EriktheOutgolfer It already works with monads. See the examples I posted in Jelly chat. Nilads are a different case.

@miles I mean just like how nilads behave here.

@EriktheOutgolfer Ok it supports nilads now, but requires you to define their length, and use a space between each. Example 2 1”q3ƭ€ on [7,4,9,0] returns [2, 1, 'q', 2]

Husk, 16 bytes
This challenge favours languages that can create infinite lists of functions. Maybe not, eval FTW
zF¢+ë+*-÷e%^Ṡze↔

Try it online!
How?
  ¢+ë+*-÷e%^         The infinite list [+,*,-,÷,%,^,+,*,-,...
    ë+*-÷            The list [+,*,-,÷]
         e%^         The list [%,^]
   +                 Concatenated
  ¢                  Then repeated infinitely
               ↔     The input reversed e.g [9,8,7,6,5,4,3,2,1]
            Ṡze      Zipped with itself     [[9,1],[8,2],[7,3],[6,4],[5,5],[4,6],[3,7],[2,8],[1,9]]
zF                   Zipwith reduce, the list of functions and the list of lists.
                     [F+[9,1],F*[8,2],F-[7,3],F÷[6,4],F%[5,5],F^[4,6],F+[3,7],F*[2,8],F-[1,9]]
                     [10     ,16     ,-4     ,0      ,0      ,1296   ,10     ,16     ,8      ]

Alternative 17 byte solution:
ṠozIzI¢+ë+*-÷e%^↔

Out of curiosity, why can't you do ë+*-÷%^? Why do the e necessary?

@cairdcoinheringaahing ë takes 4 arguments, e takes 2. There isn't one for 6

Python 2, 67 bytes
-3 bytes thanks to ovs.
lambda l:[eval(j+'*+*-/%*'[-~i%6::6]+l[~i])for i,j in enumerate(l)]

Try it online!
Python 2, 95 bytes
lambda l:[[add,mul,sub,div,mod,pow][i%6](v,l[~i])for i,v in enumerate(l)]
from operator import*

Try it online!
eval is evil... but perhaps more golfy. :P

67 bytes

Haskell, 74 117 105 bytes
x#y=fromIntegral.floor$x/y
x%y=x-x#y
f u=[o a b|(o,a,b)<-zip3(cycle[(+),(*),(-),(#),(%),(**)])u(reverse u)]

Try it online!
Saved 12 bytes thanks to @nimi
There is certainly a better way to achieve this.
EDIT 1. Fixed exponent for integers; 2. There's definitely a better way, see comment below: 95 91 bytes
x#y=fromIntegral.floor$x/y
x%y=x-x#y
f=zipWith3($)(cycle[(+),(*),(-),(#),(%),(**)])<*>reverse

Try it online!

zipWith3($)(cycle[(+),(*),(-),div,mod,(^)])<*>reverse Is a shorter, now deleted version of yours.

@H.PWiz I was looking for something like that but didn't have the time to look further. Why did you delete it? I believe it's not forbidden to have two different solutions in the same language, especially when one is far better than the other...

@H.PWiz  Fixed exponent.

No need for the h in the call of o: o a b and without that you can inline h (TIO).

05AB1E, 18 bytes
Â"+*-÷%m"Ig×)øε`.V

Try it online!
Explanation
Â                    # push a reversed copy of the input
 "+*-÷%m"            # push the list of operators
         Ig×         # repeat it input times
            )ø       # zip together
              ε      # apply to each triplet
               `     # push separately to stack
                .V   # evaluate

Ig∍ if you wanted to use the "newish" command (haven't seen much ∍ here).

Jelly, 15 bytes
żṚj"“+×_:%*”ṁ$V

Try it online! or see the test-suite.
How?
żṚj"“+×_:%*”ṁ$V - Link: list of numbers, a       e.g. [5, 3, 6, 1, 1]
 Ṛ              - reverse a                           [1, 1, 6, 3, 5]
ż               - interleave                          [[5,1],[3,1],[6,6],[1,3],[1,5]]
             $  - last two links as a monad:
    “+×_:%*”    -   literal list of characters        ['+','×','_',':','%','*']
            ṁ   -   mould like a                      ['+','×','_',':','%']
   "            - zip with the dyad:
  j             -   join                              ["5+1","3×1","6_6","1:3","1%5"]
              V - evaluate as Jelly code (vectorises) [6, 3, 0, 0, 1]

Save a couple of bytes with ż“+×_:%*”;"ṚV

@EriktheOutgolfer that only works if the length of the input is exactly 6. I think you'd need to do ż“+×_:%*”ṁ$;"ṚV which is also 15 bytes.

ok what was I thinking of...I so miss "tie" :(

Bash + GNU utilities, 53
tac $1|paste -d, $1 -|tr ',
' '
;'|paste -sd+*-/%^|bc

This script takes a filename as a command-line parameter.
Try it online.
The nice thing here is that paste -d allows a list of separators to be given, which are used cyclically.  The rest it just getting the input into the right format to do this.

Fails for the last test case :( https://tio.run/##S0oszvifnFiiYKeQmVdQWqJXUlHCVZxaoqCrixD4X5KYrKBiWFOQWFySqqCbogPkKOjWlBQpqOtwqSuoc1mrw@SKU7S1dPVV42qSkv//NzTkMuHSNTTnMjTlMuIyNjPkAtIWXAA

@Shaggy OP seems to be OK with this result

JavaScript (ES7), 68 67 bytes
a=>[...a].map((v,i)=>(x=a.pop(),o='+*-/%'[i%6])?eval(v+o+x)|0:v**x)

let f =

a=>[...a].map((v,i)=>(x=a.pop(),o='+*-/%'[i%6])?eval(v+o+x)|0:v**x)

console.log(JSON.stringify(f([1, 2, 3, 4, 5, 6, 7, 8, 9]    ))) // [10, 16, -4, 0, 0, 1296, 10, 16, 8]
console.log(JSON.stringify(f([5, 3, 6, 1, 1]                ))) // [6, 3, 0, 0, 1]
console.log(JSON.stringify(f([2, 1, 8]                      ))) // [10, 1, 6]
console.log(JSON.stringify(f([11, 4, -17, 15, 2, 361, 5, 28]))) // [39, 20, -378, 7, 2, 3.32948887119979e-44, 9, 308]

Nice solution! Maybe you can move the assignment of o inside the parentheses of .pop() to save a few bytes.

@Luke The assignment to o is also used as the condition of the ternary operator. That would break that scheme.

@Shaggy. That was the exact same first Arnauld's answer.

@ThePirateBay: Ah. On SE mobile so can't see edit histories.

Perl 6, 67 66 bytes
Saved 1 byte thanks to @nwellnhof.
{map {EVAL ".[0] {<+ * - div % **>[$++%6]} .[1]"},zip $_,.reverse}

Try it online!
Very unimaginative (and probably bad) solution. Zips the argument with itself reversed. The resulting list is then mapped with the block that EVALs the string a (operator) b. The operator is chosen from the list of strings <+ * - div % **> using the free state (think static in C — the value persists across the calls of the block) variable $. This is created for each block separately and set to 0. You can do anything you like with it, but you may reference it only once (each occurence of $ refers to another variable, actually). So $++%6 is actually 0 during the first call, 1 during the second, ... 5 during the 6th, 0 during the 7th and so on.
I at first tried to do without an EVAL. The operators are in fact just subs (= functions), but their names are so extremely ungolfy (&infix:<+> and so on) that I had to forgo that approach.

map {EVAL ".[0] ... .[1]"},zip $_,.reverse is 1 byte shorter.

@nwellnhof, thanks!

Desmos, 107 104 bytes
k=l.length
L=mod([1...k],6)
R=l[k...1]
f(l)=\{L=1:l+R,L=2:lR,L=3:l-R,L=4:\floor(l/R),L=5:\mod(l,L),l^R\}

Very straightforward implementation of the challenge, can probably be golfed further.
Try It On Desmos!
Try It On Desmos! - Prettified

Factor + sequences.repeating, 69 bytes
[ dup reverse { + * - /i mod ^ } over length cycle [ execute ] 3map ]

Try it online!
How?
                    ! { 1 2 3 4 5 6 7 8 9 }
dup                 ! { 1 2 3 4 5 6 7 8 9 } { 1 2 3 4 5 6 7 8 9 }
reverse             ! { 1 2 3 4 5 6 7 8 9 } { 9 8 7 6 5 4 3 2 1 }
{ + * - /i mod ^ }  ! { 1 2 3 4 5 6 7 8 9 } { 9 8 7 6 5 4 3 2 1 } { + * - /i mod ^ }
over                ! { 1 2 3 4 5 6 7 8 9 } { 9 8 7 6 5 4 3 2 1 } { + * - /i mod ^ } { 9 8 7 6 5 4 3 2 1 }
length              ! { 1 2 3 4 5 6 7 8 9 } { 9 8 7 6 5 4 3 2 1 } { + * - /i mod ^ } 9
cycle               ! { 1 2 3 4 5 6 7 8 9 } { 9 8 7 6 5 4 3 2 1 } { + * - /i mod ^ + * - }
[ execute ] 3map    ! { 10 16 -4 0 0 1296 10 16 8 }

Python 2, 71 bytes
lambda l:[eval(y+'+*-/%*'[x%6]*-~(x%6>4)+l[~x])for x,y in enumerate(l)]

Try it online!
Saved 2 bytes thanks to ovs!

J, 44 42 bytes
Crossed out 44, yada yada...
-2 bytes thanks to @ConorO'Brien
_2+/`(*/)`(-/)`(<.@%/)`(|~/)`(^/)\[:,],.|.

Try it online!
So many parens and inserts... Surely there's a better way to do this (maybe using insert rather than infix?)
Explanation
_2(+/)`(*/)`(-/)`(<.@%/)`(|~/)`(^/)\[:,],.|.  Input: a
                                       ],.|.  Join a with reverse(a)
                                      ,       Ravel (zip a with reverse(a))
_2                                 \          To non-overlapping intervals of 2
  (+/)`(*/)`(-/)`(<.@%/)`(|~/)`(^/)           Apply the cyclic gerund
   +/                                           Insert addition
        */                                      Insert multiplication
             -/                                 Insert subtraction
                  <.@%/                         Insert integer division
                          |~/                   Insert mod
                                ^/              Insert exponentiation

Some notes:
J doesn't have integer division, so we compose %-division with >.-floor. J's mod (|) does the reverse order of what we'd expect, so we have to invert its order using ~-reflexive.
Even though we're moving over intervals of 2, we have to use /-insert to insert the verbs to have them be used dyadically since that's how \-infix works.

I'd also love to know how to avoid all the () and repeated / -- I wasn't able to figure it out....

@Jonah, best I can think of is something like / on a reversed array (since it operates backwards...) with verbs like (,+)\(,*)` but that doesn't help much... (also it doesn't work)

The gerund can be +/`(*/)`...

MATL, 27 23 bytes
-4 bytes thanks to @LuisMendo
tP+1M*1M-IM&\w1M^v"@X@)

Try it online!
Explanation:
tP         % duplicate and flip elements
+          % push array of sums (element-wise)
1M*        % push array of products (element-wise)
1M-        % push array of subtractions (element-wise)
IM&\w      % push array of divisions and modulo (element-wise)
1M^        % push array of power (element-wise)
v          % vertically concatenate all arrays
"@X@)    % push to stack values with the correct index based on operator
           % (implicit) convert to string and display

Ruby, 63 57 bytes
->a{t=0;a.map{|x|eval [x,a[t-=1]]*%w(** % / - * +)[t%6]}}

Nothing fancy, really. Just iterate on the array, use an index as reverse iterator, join into a string using the right operator, evaluate, rinse and repeat.
Try it online!

k, 40 bytes
{_((#x)#(+;*;-;%;{y!x};{*/y#x})).'x,'|x}

Try it online!
{                                      } /function(x)
                                     |x  /reverse x
                                  x,'    /zip concat with x
        ( ; ; ; ;     ;       )          /list of operations
         + * - %                         /add, mult, sub, div
                 {y!x}                   /mod (arguments need to be reversed)
                       {*/y#x}           /pow (repeat and fold multiply)
  ((#x)#                       )         /resize operations to length of x
                                .'       /zip apply
 _                                       /floor result

Perl 5, 68 + 1 (-p) = 69 bytes
print$",eval'int 'x($i%6==3).$_.qw|+ ** % / - *|[$i--%6].$F[$i]for@F

Try it online!
Takes input as space separated list of numbers.

Fails for the last test case :( https://tio.run/##K0gtyjH9/7@gKDOvREVJB0gqpJYl5qjE6xWW12graGkpqCroK@gqaNVEq2Tq6qqaxeqpuAGZsWn5RQ5u//8bGiqYKOgamisYmioYKRibGSoAaYt/@QUlmfl5xf91fU31DAwN/usmAgA

Not anymore. :)

R, 74 bytes
function(l)Map(Map,c(`+`, `*`, `-`, `%/%`, `%%`,`^`),l,rev(l))[1:sum(l|1)]

Try it online!
This is the final answer I came up with. It returns a list of length length(l) where each element is a list containing the corresponding element. Kinda crappy but they're all there. If that's unacceptable, either of the Map can be replaced with mapply for +3 bytes.
Since R operators are all functions (the infix notation just being syntactic sugar), I tried to select one from a list; for example, the 94 byte solution below.
To try and get rid of the loop, I tried sapply, but that only works with a single function and input list. Then I remembered the multivariate form, mapply, which takes an n-ary function FUN and n succeeding arguments, applying FUN to the first, second, ..., elements of each of the arguments, recycling if necessary. There is also a wrapper function to mapply, Map that "makes no attempt to simplify the result". Since it's three bytes shorter, it's a good golfing opportunity.
So I defined a trinary function (as in the 80 byte solution below) that takes a function as its first argument, and applies it to its second and third ones. However, I realized that Map is a function that takes a function as its first argument and applies it to successive ones. Neat!
Finally, we subset at the end to ensure we only return the first length(l) values.
R, 80 bytes
function(l)Map(function(x,y,z)x(y,z),c(`+`, `*`, `-`, `%/%`, `%%`,`^`),l,rev(l))

Try it online!
This one doesn't work, as it will return 6 values for lists with less than 6 elements.
R, 94 bytes
function(l){for(i in 1:sum(l|1))T[i]=switch(i%%6+1,`^`,`+`,`*`,`-`,`%/%`,`%%`)(l,rev(l))[i]
T}

Try it online!
Explanation (mildly ungolfed):
function(l){
 for(i in 1:length(l)){
  fun <- switch(i%%6+1,`^`,`+`,`*`,`-`,`%/%`,`%%`) # select a function
  res <- fun(l,rev(l))                             # apply to l and its reverse
  T[i] <- res[i]                                   # get the i'th thing in the result
 }
 T                                                 # return the values
}

Because each of the functions is vectorized, we can index at the end (res[i]). This is better than the eval approach below.
R, 100 bytes
function(l)eval(parse(t=paste("c(",paste(l,c("+","*","-","%/%","%%","^"),rev(l),collapse=","),")")))

Try it online!
This is the shortest eval approach I could find; because we have to collect the results into one vector, we need to paste a c( ) around all the expressions, which adds a ton of unnecessary bytes

Java 8, 336 332 bytes
import java.math.*;a->{int b[]=a.clone(),l=b.length,i=l/2,s,t;for(;i-->0;b[i]=b[l+~i],b[l+~i]=t)t=b[i];BigInteger r[]=new BigInteger[l],u,v;for(;++i<l;t=b[i],v=new BigInteger(t+""),r[i]=(s=i%6)<1?u.add(v):s<2?u.multiply(v):s<3?u.subtract(v):s<4?u.divide(v):s<5?u.remainder(v):t<0?u.ZERO:u.pow(t))u=new BigInteger(a[i]+"");return r;}

-4 bytes thanks to @ceilingcat.
Try it here.
Sigh..
Input as int[], output as java.math.BigInteger[].
Without the rule "To cover the corner cases, the input will never contain a 0, but may contain any other integer in the range from negative infinity to positive infinity.", using integers in the range -2147483648 to 2147483647, it would be 186 182 bytes instead (input as int[], and no output because it modifies this input-array instead to save bytes):
a->{int b[]=a.clone(),l=b.length,i=l/2,t,u,v;for(;i-->0;b[i]=b[l+~i],b[l+~i]=t)t=b[i];for(;++i<l;v=b[i],a[i]=(t=i%6)<1?u+v:t<2?u*v:t<3?u-v:t<4?u/v:t<5?u%v:(int)Math.pow(u,v))u=a[i];}

Try it here.
Explanation:
import java.math.*;            // Required import for BigInteger

a->{                           // Method with int[] parameter and BigInteger[] return-type
  int b[]=a.clone(),           //  Make a copy of the input-array
      l=b.length,              //  Length of the input
      i=l/2,                   //  Index-integer, starting at halve the length
      s,t;                     //  Temp integers
  for(;i-->0;b[i]=b[l+~i],b[l+~i]=t)t=b[i];
                               //  Reverse the input-array and store it in `b`
  BigInteger r[]=new BigInteger[l],
                               //  Result-array
             u,v;              //  Temp BigIntegers
  for(;++i<l;                  //  Loop over the array(s):
                               //    After every iteration:
      t=b[i],                  //     Set the current item of `b` in `t`
      v=new BigInteger(t+""),  //     And also set it in `v` as BigInteger
      r[i]=(s=i%6)<1?          //     If the index `i` modulo-6 is 0:
            u.add(v)           //      Add the items with each other
           :s<2?               //     Else-if index `i` modulo-6 is 1:
            u.multiply(v)      //      Multiply the items with each other
           :s<3?               //     Else-if index `i` modulo-6 is 2:
            u.subtract(v)      //      Subtract the items with each other
           :s<4?               //     Else-if index `i` modulo-6 is 3:
            u.divide(v)        //      Divide the items with each other
           :s<5?               //     Else-if index `i` modulo-6 is 4:
            u.remainder(v)     //      Use modulo for the items
           :                   //     Else (index `i` modulo-6 is 5):
            t<0?               //      If `t` is negative:
             u.ZERO            //       Simply use 0
            :                  //      Else:
             u.pow(t))         //       Use the power of the items
    u=new BigInteger(a[i]+""); //   Set the current item of `a` to `u` as BigInteger
  return r;}                   //  After the loop, return the result BigInteger-array

Casio-Basic, 108 bytes
{x+y,x*y,x-y,int(x/y),x-int(x/y)y,x^y}⇒o
dim(l)⇒e
Print seq(o[i-int(i/6)6+1]|{x=l[i+1],y=l[e-i]},i,0,e-1)

That was painful. Especially because mod(x,y) returns x when it really shouldn't, which meant I had to make my own mod function: hence the x-int(x/y)y.
Loops i from 0 to length(l)-1, taking successive elements in the o list and applying l[i] for x and l[-i] for y. (negative indices don't work though, so instead I subtract i from the length of the list and take that index.)
107 bytes for the function, +1 byte to add l in the parameters box.


text:
Solve this Alcazar for me
Recently I've been playing a game called Alcazar. It is a board puzzle game where your goal is to enter from one door, pass through all squares, and exit through another door. The only rules are:

Enter once, leave once;
Pass through all squares;
Do not pass through a square more than once

The image below shows an example of an Alcazar board and, at its right, the solved puzzle (of course this is an easy one):

You can find more puzzles at http://www.theincrediblecompany.com/try-alcazar and download the game at PlayStore (P.S.: Not an advertisement).
My problem is that I almost finished the game, except for one level. I simply cannot find a way to solve it. So the challenge I propose is: create an algorithm that solves any normal1 solvable2 Alcazar level.
Of course, I'm not asking for anyone to build an image interpreter to read the image and solve the puzzle (or am I?). So I redrew the above puzzle using box drawing characters. The puzzle and its solution would be like this:
╔═══════╗         ╔═══════╗
║▒ ▒ ▒ ▒║         ║┌─┐ ┌─┐║
║     ║ ║         ║│ │ │║│║
╣▒ ▒ ▒║▒╠         ╣│ └─┘║└╠
║ ══╦═╩═╣         ║│══╦═╩═╣
║▒ ▒║▒ ▒║         ║└─┐║┌─┐║
║   ║   ║   ==>   ║  │║│ │║
╣▒ ▒║▒ ▒║         ╣┐ │║│ │║
║ ║ ║   ║         ║│║│║│ │║
╣▒║▒ ▒ ▒║         ╣│║└─┘ │║
║ ║     ║         ║│║    │║
║▒ ▒ ▒ ▒║         ║└─────┘║
╚═══════╝         ╚═══════╝

In the board above, ▒ are the cells to be filled.
One can observe that there is a vertical and horizontal gab between the cells. This is because I had to insert a space between cells to add the walls. This means that the only important cells are the ones above, below, to the left, and to the right of each cell. The diagonals could be removed without information loss. For example, in the board below, both represent the same puzzle:
╔════╩╗         ═ ═ ╩
║▒ ▒ ▒║        ║▒ ▒ ▒║
║ ═══ ║           ═
║▒ ▒ ▒║   ==   ║▒ ▒ ▒║
║     ║
║▒ ▒ ▒║        ║▒ ▒ ▒║
╚╦════╝         ╦═ ══

This is also valid for the solutions. That is, it is not required to connect the cells:
╔════╩╗        ╔════╩╗        ╔════╩╗
║▒ ▒ ▒║        ║┌───┘║        ║┌ ─ ┘║
║ ═══ ║        ║│═══ ║        ║ ═══ ║
║▒ ▒ ▒║   ==   ║└───┐║   =>   ║└ ─ ┐║
║     ║        ║    │║        ║     ║
║▒ ▒ ▒║        ║┌───┘║        ║┌ ─ ┘║
╚╦════╝        ╚╦════╝        ╚╦════╝

In the example above, both solutions mean the same.
Yes, the test cases. Here they are:
Puzzle 1
╔════╩╗        ╔════╩╗
║▒ ▒ ▒║        ║┌ ─ ┘║
║ ═══ ║        ║ ═══ ║
║▒ ▒ ▒║   =>   ║└ ─ ┐║
║     ║        ║     ║
║▒ ▒ ▒║        ║┌ ─ ┘║
╚╦════╝        ╚╦════╝

Puzzle 2
╔═════╗        ╔═════╗
║▒ ▒ ▒║        ║┌ ─ ┐║
║   ║ ║        ║   ║ ║
╣▒ ▒║▒║        ╣└ ┐║│║
║ ║ ║ ║   =>   ║ ║ ║ ║
╣▒║▒ ▒╠        ╣┐║│ │╠
║ ║   ║        ║ ║   ║
║▒ ▒ ▒║        ║└ ┘ │║
╚════╦╝        ╚════╦╝

Puzzle 3
╔════╩══╗        ╔════╩══╗
║▒ ▒ ▒ ▒║        ║┌ ┐ └ ┐║
║ ║   ║ ║        ║ ║   ║ ║
╣▒║▒ ▒║▒╠        ╣┘║└ ┐║│╠
║ ╚══ ║ ║        ║ ╚══ ║ ║
║▒ ▒ ▒ ▒╠   =>   ║┌ ─ ┘ │╠
║   ═══ ║        ║   ═══ ║
║▒ ▒ ▒ ▒║        ║│ ┌ ┐ │║
║   ║   ║        ║   ║   ║
║▒ ▒║▒ ▒║        ║└ ┘║└ ┘║
╚═══╩═══╝        ╚═══╩═══╝

puzzle 4
╔═══════╗        ╔═══════╗
║▒ ▒ ▒ ▒║        ║┌ ┐ ┌ ┐║
║     ║ ║        ║     ║ ║
╣▒ ▒ ▒║▒╠        ╣│ └ ┘║└╠
║ ══╦═╩═╣        ║ ══╦═╩═╣
║▒ ▒║▒ ▒║        ║└ ┐║┌ ┐║
║   ║   ║   =>   ║   ║   ║
╣▒ ▒║▒ ▒║        ╣┐ │║│ │║
║ ║ ║   ║        ║ ║ ║   ║
╣▒║▒ ▒ ▒║        ╣│║└ ┘ │║
║ ║     ║        ║ ║     ║
║▒ ▒ ▒ ▒║        ║└ ─ ─ ┘║
╚═══════╝        ╚═══════╝

Puzzle 5
╔══╩══════╗        ╔══╩══════╗
║▒ ▒ ▒ ▒ ▒║        ║┌ ─ ┐ ┌ ┐║
║   ║     ║        ║   ║     ║
║▒ ▒║▒ ▒ ▒╠        ║└ ┐║└ ┘ │╠
║   ╠════ ║        ║   ╠════ ║
║▒ ▒║▒ ▒ ▒║   =>   ║┌ ┘║┌ ─ ┘║
║   ║     ║        ║   ║     ║
║▒ ▒║▒ ▒ ▒╠        ║└ ┐║└ ─ ─╠
║   ╠═════╣        ║   ╠═════╣
║▒ ▒║▒ ▒ ▒║        ║┌ ┘║┌ ─ ┐║
║   ║     ║        ║   ║     ║
║▒ ▒ ▒ ▒ ▒║        ║└ ─ ┘ ┌ ┘║
╚══╦═══╦══╝        ╚══╦═══╦══╝

Puzzle 6
╔═══════════╗        ╔═══════════╗
║▒ ▒ ▒ ▒ ▒ ▒║        ║┌ ┐ ┌ ┐ ┌ ┐║
║           ║        ║           ║
║▒ ▒ ▒ ▒ ▒ ▒║        ║│ └ ┘ └ ┘ │║
║       ═══ ║        ║       ═══ ║
║▒ ▒ ▒ ▒ ▒ ▒║        ║└ ┐ ┌ ─ ─ ┘║
║     ═══   ║        ║     ═══   ║
╣▒ ▒ ▒ ▒ ▒ ▒╠   =>   ╣┐ │ │ ┌ ┐ ┌╠
║           ║        ║           ║
║▒ ▒ ▒ ▒ ▒ ▒║        ║│ │ │ │ │ │║
║   ║   ║   ║        ║   ║   ║   ║
║▒ ▒║▒ ▒║▒ ▒║        ║│ │║│ │║│ │║
║   ║   ║   ║        ║   ║   ║   ║
║▒ ▒ ▒ ▒ ▒ ▒║        ║└ ┘ └ ┘ └ ┘║
╚═══════════╝        ╚═══════════╝

Puzzle 7
╔════╩════════╦╩╗        ╔════╩════════╦╩╗
║▒ ▒ ▒ ▒ ▒ ▒ ▒║▒║        ║┌ ─ ─ ─ ─ ─ ┐║│║
║ ║       ║   ║ ║        ║ ║       ║   ║ ║
║▒║▒ ▒ ▒ ▒║▒ ▒ ▒║        ║│║┌ ─ ─ ┐║┌ ┘ │║
║ ║ ║ ═══ ║     ║        ║ ║ ║ ═══ ║     ║
║▒ ▒║▒ ▒ ▒ ▒ ▒ ▒╠        ║│ │║┌ ─ ┘ └ ┐ │╠
║   ║           ║        ║   ║           ║
║▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒║        ║│ │ └ ┐ ┌ ┐ └ ┘║
║     ║ ║     ══╣        ║     ║ ║     ══╣
║▒ ▒ ▒║▒║▒ ▒ ▒ ▒║        ║│ └ ┐║│║│ └ ─ ┐║
║     ║ ║       ║        ║     ║ ║       ║
║▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒║        ║│ ┌ ┘ │ └ ┐ ┌ ┘║
║           ║ ══╣   =>   ║           ║ ══╣
║▒ ▒ ▒ ▒ ▒ ▒║▒ ▒║        ║└ ┘ ┌ ┘ ┌ ┘║└ ┐║
╠══       ║ ╚══ ║        ╠══       ║ ╚══ ║
║▒ ▒ ▒ ▒ ▒║▒ ▒ ▒║        ║┌ ┐ └ ┐ │║┌ ─ ┘║
║     ║ ║ ║     ║        ║     ║ ║ ║     ║
║▒ ▒ ▒║▒║▒ ▒ ▒ ▒║        ║│ └ ┐║│║│ └ ─ ┐║
║ ║   ║ ║ ╔══   ║        ║ ║   ║ ║ ╔══   ║
║▒║▒ ▒ ▒ ▒║▒ ▒ ▒║        ║│║┌ ┘ │ │║┌ ┐ │║
║ ║     ║ ║     ║        ║ ║     ║ ║     ║
║▒ ▒ ▒ ▒║▒ ▒ ▒ ▒║        ║│ └ ─ ┘║└ ┘ │ │║
║       ╚══     ║        ║       ╚══     ║
║▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒║        ║└ ─ ─ ─ ─ ─ ┘ │║
╚════╦═╦═╦═════╦╝        ╚════╦═╦═╦═════╦╝

Puzzle 8 (Sorry, I really don't have the solution to this one)
╔══╩╦══╩═══╩═╩═╩═══╩╗
║▒ ▒║▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒║
║   ║               ║
╣▒ ▒║▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒║
║   ╚══ ╔══     ╔═══╣
╣▒ ▒ ▒ ▒║▒ ▒ ▒ ▒║▒ ▒╠
║       ║   ╔══ ║   ║
╣▒ ▒ ▒ ▒ ▒ ▒║▒ ▒ ▒ ▒╠
║           ║       ║
║▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒╠
║           ║       ║
╣▒ ▒ ▒ ▒ ▒ ▒║▒ ▒ ▒ ▒╠
║   ╔═══╗   ╚══     ║
╣▒ ▒║▒ ▒║▒ ▒ ▒ ▒ ▒ ▒║
║   ║   ║           ║
╣▒ ▒║▒ ▒║▒ ▒ ▒ ▒ ▒ ▒╠
║ ══╝   ║       ╔══ ║
║▒ ▒ ▒ ▒║▒ ▒ ▒ ▒║▒ ▒║
║   ══╗ ╚══ ╔══ ║   ║
╣▒ ▒ ▒║▒ ▒ ▒║▒ ▒ ▒ ▒╠
║     ║     ║   ║   ║
╣▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒║▒ ▒║
║   ═══   ══╗   ║   ║
╣▒ ▒ ▒ ▒ ▒ ▒║▒ ▒ ▒ ▒╠
╠══ ║       ║   ╔══ ║
║▒ ▒║▒ ▒ ▒ ▒ ▒ ▒║▒ ▒╠
║   ╚══ ║   ║   ║   ║
╣▒ ▒ ▒ ▒║▒ ▒║▒ ▒ ▒ ▒╠
║       ║   ║       ║
║▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒ ▒║
╚══╦═══╦═══╦═╦═╦═╦═╦╝

Input
The input of your code can have any representation as long as it follow these rules:

It must be a graphical input. So it is not possible to read a coordinate list, for example.
Horizontal walls, vertical walls, and doors must be distinct, and they must be made of a visible character (no blank characters).
The ▒ can be replaced by blanks. I just used a different character to highlight them.

Output
The output can also have any representation as long as it follows these rules:

It must be a graphical output. That is, one can see the path by looking at it.
Rule number one implies that the path characters be different. That is, there are going to be at least 6 path characters; horizontal, vertical, and corners.
For the answer to be valid, the output must be the same board as the input (obviously) with all the cells (in my representation, the ▒) filled. Filling the gaps between the cells is optional.

Scoring
This is code-golf, so the shortest code in bytes wins.
1 There are some Alcazar levels that have optional cells and tunnels. These will not be considered.
2 There are some Alcazar boards that are impossible.

My program does not find a solution for puzzle 8. Are you sure it's solvable? Maybe some typo?

@edc65 same here - no solution for #8

Python 3, 809 728 723 714 693 688 684 663 657 641 639 627 610 571 569 bytes
Edit: Saved 55 bytes thanks to @Felipe Nardi Batista
Does not run the last test case in 60 seconds on TIO, but should work correctly nonetheless. Returns a list of coordinates for the path. Some
400 of the bytes are used to get the data lists from the I/O.
A=enumerate
I,J="═║"
B=range
L=len
K=-1
Z=1,0
X=0,1
C=K,0
V=0,K
E=lambda a,b,p:(((a,b)in d)*L(p)==H*h)*p or max([E(q+a,w+b,p+[(q+a,w+b)])for q,w in y[a][b]if~-((q+a,w+b)in p)*-h>w+b>K<q+a<H]+[[]])
x=input().split("\n")
h=L(x[0])//2
H=L(x)//2
y=[[{C,Z,V,X}for i in B(h)]for j in B(H)]
d=[]
exec('d+=[(%s,i)for i,a in A(x[%s][1::2])if I<a]\nfor i,u in A(x[%s:%s:2]):\n d+=[(i,0)]*(J<u[0])+[(i,h-1)]*(J<u[K])\n for j,w in A(u[%s:%s:2]):\n  if"%s"==w:y[i][j]-={%s};y[i+%s][j+%s]-={%s}\n'*2%(0,*X,"",2,K,J,X,*X,V,H-1,K,2,K,1,"",I,Z,*Z,C))
print(max(E(*D,[D])for D in d))

Try it online!

@HalvardHummel Well, sorry for the bad formulation of the challenge. So I propose the following. The Score shall be calculated by multiplying the byte count by the run time, so both run time and byte count shall be rewarded. What do you think?

@PhelypeOleinik I don't think that is a very good scoring system. Keeping it to coed golf is a better solution, but if you are really looking for a solution I'm sure that this can be modified to be more efficient.

@cairdcoinheringaahing I understand that the most elegant solution is to keep as it is. But an algorithm that takes "days or even months" to solve an 8x12 puzzle board is somehow inefficient, don't you think? The way I see it, an algorithm that solves the problem in less time should be rewarded, even if it is a little bit longer.

@PhelypeOleinik The "efficiency" of the code is irrelevant. You have challenged us to write short code, and that is the basis of your challenge. Adding the speed at which the program runs to the mix only complicates things unnecessarily and can also be exploited for ridiculous scores. Custom scoring systems don't tend to work out. If you want short code, make a code-golf question. If you want fast code, make a fastest-code question. Trying to mix them together is not a good idea.

In your exec(...) string there are five new lines, represented as \n, 5*2 = 10 bytes. Using a triple-quoted string would add 4 bytes (...''...''...) but then remove 5 bytes, as actual new line characters could be used. In total this could save one byte.

I think (((a,b)in d)*L(p)==H*h)*p or (28 bytes) is equivalent to p*(((a,b)in d)*L(p)==H*h)or (27 bytes).

Congratulations for winning the bounty for the shortest Python answer!

APL (Dyalog Classic), 319 bytes
i←N⍴j←⍳1+n←×/N←⌊2÷⍨⍴a←⎕⋄e←↑⊃,/{(,~'#='∊⍨a[(⍵⌽⍳2)∘+¨2×⍳N+⍵=⍳2])/,2,/[⍵]⊃,[⍵]/n i n}¨⍳2
r←{e g c←⍵⋄d←+/j∘.=∊g⋄e⌿⍨←(≠/c[e])∧2>⌈/d[e]⋄n≡≢g:g⍪j/⍨d=1⋄0≡≢e:0⋄2>⌊/d+D←+/j∘.=,e:0⋄u←,¯1↑e←e[⍒⌊/D[e];]⋄e↓⍨←¯1⋄0≢r←∇e(g⍪u)(c-(-/c[u])×c=c[⊃u]):r⋄∇e g c}e(0↑e)j
a[1+2×⍳N]←' ??┌?─┐┬?└│├┘┴┤┼'[2⊥(↑(⊂i),¨¨{⊖∘⍉⍣⍵⊢n⍪¯1↓⌽∘⍉⍣⍵⊢i}¨⍳4)∊↓r⍪⌽r]
a

Try it online!
Input uses =#F7LJ<>^v. instead of ═║╔╗╚╝╣╠╩╦▒ in order to fit in the classic charset.
All test cases except for the last one pass in a few seconds.
The last test takes 47 min on my computer and yields no solution.
When the resulting path uses a door near a corner it may be rendered incorrectly (it's as if the trail forks and passes through an extra imaginary door), but it's still discernable and unambiguous.

Very good!
If I may ask, what approach does your code use to solve? Exhaustive search or something more elegant?
Also, as I said, I didn't solve the last puzzle by hand. It doesn't have a clear step-by-step solution and requires, even when solving by hand, a guesswork to find some answers. This puzzle is included in the original game, but it may not have a solution, so probably should not be taken into account.

@PhelypeOleinik Yes, it's a rather unsophisticated exhastive search. The reason it finds existing solutions quickly is that it tries the more likely case first (with vs without a certain edge in the graph - my heuristic is the min of the degrees of the two vertices, lower is likelier). The reason it performs horribly in the last case is that it tests all possibilities anyway and prunes recursion only on obvious contradictions.
There don't seem to be known good Hamiltonian-path algorithms, even for the special case of bounded-degree (≤4 neighbours) graphs.

JavaScript (ES6), 274 bytes
Input as a multiline string, each line terminated with a newline character. The doors are marked with character '2'
Output as a multiline string with the path marked by character '1', very easily discernable.
This is a Depth First Search, trying all paths and backtraking when stuck. It's not efficient at all, but can solve puzzles 1 .. 6 in a less than 1 minute.
z=>(w=z.search`
`+1,t=(w-2)*(z.length/w-1)/4,z=[...z],R=(p,l,q)=>[1,-1,w,-w].some(d=>l<t?z[q=p+d]<1&z[q+d]<1&&(R(q+d,++z[q]+l)||--z[q]):z[p+d]>1&&--z[p+d],++z[p])||--z[p],z.some((c,i)=>-c&&(x=i%w,R(i<w?i+w:x?x>w-3?i-1:i-w:i+1,--z[i])||++z[i]*0))&&z.join``.replace(/0/g,' '))

Less golfed
z => (
  w = z.search`\n`+1, // board width and offset to next row
  t = (w-2)*(z.length/w-1)/4, // total size of board, number of cells that must be filled
  z = [...z], // convert string to array
  d = [1, -1, w, -w], // delta to next position in all directions
  // recursive search
  // given a current position, try to move in all directions
  // if the board is not full, look for an emoty cell
  // if the board is full, look for a door
  R = (p, // current position
       l, // fill level
       q  // parameter used as a local variable
      ) => (
        ++z[p], // mark current position
        // .some will terminate early if the called function returns true
        // in case of return true the recursive function returns all way up leaving the path marked
        // in case of return false we need to unmark path and backtrack
        d.some( d => // for each direction, offset in d
          l < t // check if board is full
          ? z[q=p+d] < 1 & z[q+d] < 1 // not full, try to advance
            && (++z[q], // mark intermediate cell
                R(q+d, 1+l) // recursive call incrementing fill level
                || --z[q] // if R return false, backtrack: unmark intermediate cell
               )
          : z[p+d] > 1 && --z[p+d]
        ) // full, ok only if I find a door nearby
        || --z[p], // if some returns false, unmark and backtrak
  // look for doors and for each door call R
  // when R returns true, stop and return the marked board
  // if R returns false for each door, no solution, return false
  z.some((c,i) =>
   -c && // if numeric and != 0
    (x = i%w,
     z[i]=1, // marking starting position (door)
     R(i<w ? i+w : x ? x > w-3 ? i-1 : i-w : i+1, 1)
     || (z[i] = 2, false) // if R returned false, unmark a return false
    )
  ) && z.join``.replace(/0/g,' ')
)

Inside the test snippet there is a solution using a DFS with some constraint that solves puzzle 7 in less than a minute (on my PC). Puzzle 8 has no solution.
Constraints:

All empty cells must be reachable from the current cell - the empty space must not be split in two parts
There must be a reachable door
A configuration of cells cannot be explored more than one time
Cannot skip a cell that has only one empty adjacent cell

Test
Beware, puzzle 7 is well beyond the timeout for javascript execution in any browser (using the Short and Slow solver)

var Short=
z=>(w=z.search`
`+1,t=(w-2)*(z.length/w-1)/4,z=[...z],R=(p,l,q)=>[1,-1,w,-w].some(d=>l<t?z[q=p+d]<1&z[q+d]<1&&(R(q+d,++z[q]+l)||--z[q]):z[p+d]>1&&--z[p+d],++z[p])||--z[p],z.some((c,i)=>-c&&(x=i%w,R(i<w?i+w:x?x>w-3?i-1:i-w:i+1,--z[i])||++z[i]*0))&&z.join``.replace(/0/g,' '))

var Fast=
b=>{
N=0
console.clear()
    F=(b,p,n) => D.reduce((n,d) => b[p+d] < 1 && b[p+d+d] < 1? F(b, p+d+d, n) : n, n+1, b[p]=1)
    A=(s, f, o, q, k)=>{
        D.map(d => b[s[1] + d] == 2 && (++o, q = s[1] + d));

        ++b[s[0]];
        if (++f < t)
        {
            if (o < m && !K[k=b.reduce((k,c,i)=>c>3?k+' '+i:k,s[1])] && F(b.slice(), s[K[k] = 1], f) >= t
                && R(D.reduce((n,d) =>(b[s[1] + d] == 0 && b[s[1] + d + d ] == 0 && n.push([s[1] + d, s[1] + d + d ]),n),[]),f,o,b[s[1]]=4))
                return 1;
        }
        else
        {
            b[s[1]] = 4;
            if (q) return b[q]++;
        }
        --b[s[0]]
        b[s[1]]=0
    }

    R=(s, f, o)=>{
        if (!s[1]) return A(s[0], f, o);
        var e, n, z=[];
        if (s.some(s =>(
                n = D.reduce( (n,d) => b[s[1]+d]>1 || (b[s[1]+d]<1 && b[s[1]+d+d]<1) ? n+1 : n, 0),
                n>2 ? !z.push(s)
                : n>1 ? !z.unshift(s)
                : n>0 && (e||(e=s,0))
        ))) return 0
        if (e) return A(e, f, o);
        return z.some(s => A(s, f, o))
    }

    w = b.search`\n` + 1;
    h = b.length / w;
    t = (w - 2) * (h - 1) / 4;
    D = [ 1, -1, w, -w ];
    b = [...b];
    K = {};
    s = [];
    b.forEach( (c,i) => -c ?
        m = s.push( [i,i < w ? i + w : (x = i % w) > w - 3 ? i - 1 : x ? i - w : i + 1]):0
    )
    R(s, 0, 0);
    return b.join``.replace(/\d/g, c => ' oXOo'[c])
}

Out=(e,s)=>e.textContent = s

function Test(num)
{
  var puzzle = document.getElementById('Z'+num).textContent;
  var solver = MF.checked ? Fast : Short
  Out(S,'...wait...')
  Out(T,'');

  var t0=performance.now()
  setTimeout(_=>(
    Out(S,solver(puzzle)),Out(T,((performance.now()-t0)/1000).toFixed(3)+' sec')
  ),10)
}
td { border: 1px solid #000; font-family: helvetica; font-size:12px; vertical-align: top; }
pre { line-height: 13px; }
Short and slow <input type='radio' value='S' name='M' id='MS'>
Long and faster <input type='radio' checked value='F'name ='M' id='MF'>

Solution
Puzzle 1<input type='radio' name='T' onclick="Test(1)">
Puzzle 2<input type='radio' name='T' onclick="Test(2)">
Puzzle 3<input type='radio' name='T' onclick="Test(3)">
Puzzle 4<input type='radio' name='T' onclick="Test(4)">
Puzzle 5<input type='radio' name='T' onclick="Test(5)">
Puzzle 6<input type='radio' name='T' onclick="Test(6)">
Puzzle 7<input type='radio' name='T' onclick="Test(7)">

╔════2╗
║     ║
║ ═══ ║
║     ║
║     ║
║     ║
╚2════╝

╔═════╗
║     ║
║   ║ ║
2   ║ ║
║ ║ ║ ║
2 ║   2
║ ║   ║
║     ║
╚════2╝

╔════2══╗
║       ║
║ ║   ║ ║
2 ║   ║ 2
║ ╚══ ║ ║
║       2
║   ═══ ║
║       ║
║   ║   ║
║   ║   ║
╚═══╩═══╝

╔═══════╗
║       ║
║     ║ ║
2     ║ 2
║ ══╦═╩═╣
║   ║   ║
║   ║   ║
2   ║   ║
║ ║ ║   ║
2 ║     ║
║ ║     ║
║       ║
╚═══════╝

╔══2══════╗
║         ║
║   ║     ║
║   ║     2
║   ╠════ ║
║   ║     ║
║   ║     ║
║   ║     2
║   ╠═════╣
║   ║     ║
║   ║     ║
║         ║
╚══2═══2══╝

╔═══════════╗
║           ║
║           ║
║           ║
║       ═══ ║
║           ║
║     ═══   ║
2           2
║           ║
║           ║
║   ║   ║   ║
║   ║   ║   ║
║   ║   ║   ║
║           ║
╚═══════════╝

╔════2════════╦2╗
║             ║ ║
║ ║       ║   ║ ║
║ ║       ║     ║
║ ║ ║ ═══ ║     ║
║   ║           2
║   ║           ║
║               ║
║     ║ ║     ══╣
║     ║ ║       ║
║     ║ ║       ║
║               ║
║           ║ ══╣
║           ║   ║
╠══       ║ ╚══ ║
║         ║     ║
║     ║ ║ ║     ║
║     ║ ║       ║
║ ║   ║ ║ ╔══   ║
║ ║       ║     ║
║ ║     ║ ║     ║
║       ║       ║
║       ╚══     ║
║               ║
╚════2═2═2═════2╝