text:
Highest cardinality grouping of contiguous integers with minimum-sum threshold
Challenge
Given an array of positive integers and a threshold, the algorithm should output a set of consecutive-element-groupings (subarrays) such that each group/subarray has a sum greater than the threshold.
Rules
The solution should honor two additional criteria:

be of highest cardinality of the groups (i.e. highest number of groups)
having the maximum group-sum be as lowest as possible.

Mathematical Description:

input array \$L = [l_1, l_2, ..., l_n]\$
threshold \$T\$

output groups/subarrays \$G = [g_1, g_2, ..., g_m]\$ where:

\$m \leq n\$
\$\bigcap\limits_{i=1}^m{g_i}=\varnothing\$
\$\bigcup\limits_{i=1}^m{g_i}=L\$
if we denote the sum of elements in a group as \$s_{g_i} = \sum\limits_{l \in g_i}l\$, then all groups have sum greater than threshold \$T\$. In other words: \$\underset{g \in G}{\operatorname{min}}{\{s_g\}} \ge T\$
if cardinality \$|g_i|=k\$, then \$g_i=[l_j, ..., l_{j+k-1}]\$ for an arbitrary \$j\$ (i.e. all elements are consecutive).
optimal solution has highest cardinality: \$|G_{opt}| \ge \max\left(|G| \right),\,\,\forall G\$
optimal solution \$G_{opt}\$ has lowest maximum group-sum: \$\underset{g \in G_{opt}}{\operatorname{max}}{\{s_g\}} \le \underset{g \in G}{\operatorname{max}}{\{s_g\}}, \,\,\, \forall G\$

Assumption
for simplicity, we assume such a solution exists by having: \$\sum\limits_{i=1}^n l_i \ge T\$
Example:
Example input:
L = [1, 4, 12, 6, 20, 10, 11, 3, 13, 12, 4, 4, 5]
T = 12

Example output:
G = {
  '1': [1, 4, 12, 6],
  '2': [20],
  '3': [10, 11],
  '4': [3, 13],
  '5': [12],
  '6': [4, 4, 5]
}

Winning Criteria:

Fastest algorithm wins (computational complexity in \$O\$ notation).
Additionally, there might be situations where an element \$l_i >\!\!> T\$ is really big, and thus it becomes its own group; causing the maximum subarray sum to be always a constant \$l_i\$ for many potential solutions \$G\$.
Therefore, if two potential solutions \$G_A\$ and \$G_B\$ exists, the winning algorithm is the one which results in output that has the smallest max-subarray-sum amongst the non-intersecting groups.
In other words: if we denote \$G_{A \cap B}=\{g_i: \,\, g_i \in G_A \cap
 G_B\}\$, then optimum grouping, \$G_{opt}\$, is the one that has:

$$\underset{g \in \mathbf{G_{opt}} - G_{A \cap B}}{\operatorname{max}}{\{s_g\}} = \min\left( \underset{g \in \mathbf{G_A} - G_{A \cap B}}{\operatorname{max}}{\{s_g\}}\, , \,\,\underset{g \in \mathbf{G_{B}} - G_{A \cap B}}{\operatorname{max}}{\{s_g\}} \right)$$

Thanks @Arnauld for letting me know the rules, I make the change now.

Shouldn't the example result be [[1, 4, 12, 6], [20], [10, 11], [3, 13], [12], [4, 4, 5]] ? This has six entries too, but the maximal sum is lower at 23 (rather than 26).

@JonathanAllan, corrected it. Thanks for pointing it out.

made the change @Arnauld

Java (JDK), 1248 bytes
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
class TestCG{
	public static void main(String [] args) {
		int [] input = new int[] {1,4,12,6,20,10,11,3,13,12,4,4,5};
		int threshold = 12;
		List<List<Integer>> groups = new ArrayList<>();

		int currentGroupSum = 0;
		int previousGroupSum = 0;

		int maxGroupSum = 0;
		int boundaryValue = 0;
		List<Integer> currentGroup =  new ArrayList<>();

		for(int i=0; i<input.length; i++) {
			currentGroup.add(input[i]);
			currentGroupSum+=input[i];

			if(currentGroupSum>=threshold) {
				if(i<input.length-1) {
					boundaryValue = input[i+1];
				}

				if(currentGroupSum>maxGroupSum) {
					maxGroupSum = currentGroupSum;
				}

                if(currentGroupSum > previousGroupSum && (currentGroupSum - boundaryValue)>=threshold) {

                	groups.get(groups.size()-1).add(boundaryValue);
                	currentGroup.remove(0);
                }

				previousGroupSum = currentGroupSum;

				currentGroupSum = 0;
				groups.add(currentGroup);
				currentGroup = new ArrayList<>();
			}
		}
		System.out.println(groups.size());

		for(List<Integer> group : groups) {
			System.out.println(group);
		}
	}

}

Try it online!
Complexity O(n)

Welcome to CG&CC! This doesn't seem to specify the language it's written in (I'm assuming Java, or some relative thereof?) or its complexity (which is relevant because the winning criterion for this challenge is lowest complexity). You should probably edit your answer to state both of those things, and while you're at it also provide a link to an online interpreter for your code, such as Try It Online!.

Apologies as it was my first submission, have included online link.

Prolog: \$ O(n^2) \$, 785 bytes
:- use_module(library(clpz)).
:- use_module(library(lists)).

sum(Ls, S) :-
    sum_(Ls, 0, S).

sum_([], S, S).
sum_([L|Ls], S0, S) :-
    S1 #= L + S0,
    sum_(Ls, S1, S).

solve([], _, _, []).
solve(Ls, T, M, Ms) :-
    T > 0,
    solve_(Ls, T, M, [], Ms1),
    reverse(Ms1, Ms).

solve_([], _, _, Ms, Ms).
solve_(Ls, T, M, Ms0, Ms) :-
    append(As, Bs, Ls),
    As = [_|_],
    sum(As, S),
    S #>= T,
    S #=< M,
    solve_(Bs, T, M, [As|Ms0], Ms).

solution(Ls, T, Ms, M) :-
    solution_(Ls, T, Ms, sup, M).

solution_(Ls, T, Ms, M0, M) :-
    M1 in 0..M0,
    solve(Ls, T, M1, _),
    !,
    clpz:fd_get(M1, from_to(n(M2), _), _),
    M3 #= M2 - 1,
    (   solution_(Ls, T, Ms, M3, M), !
    ;   end_(Ls, T, Ms, M2, M)
    ).
end_(Ls, T, Ms, M, M) :- solve(Ls, T, M, Ms).

To run it:
?- solution([1, 4, 12, 6, 20, 10, 11, 3, 13, 12, 4, 4, 5], 12, Ms, M).
   Ms = [[1,4,12,6],[20],[10,11],[3,13],[12],[4,4,5]], M = 23.
?-

What is the complexity of the algorithm?  It is necessary for scoring.

Yes, it is but I can't compute it yet.


text:
Cleaning the dishes
Cleaning the dishes
In this task, you will be given a bar of soap with a width of 1 or more units. You will also be given a plate, which you will have to clean, using the soap as few times as you can. The plate will be at least 1 character. You will have to output a plate with the 'clean' character representing the plate, and a third unique character to represent in what positions the bar of soap was placed.
How much the soap cleans:
(n-1)//2 on each side for odd n
(n-1)//2 on the left side of the soap bar for even n
n//2   on the right side of the soap bar for even n

Note: n//2 means floor(n/2).
Input
An integer greater than or equal to 1. A series of 2 unique characters to represent clean portions and dirty portions.
Here, '=' represents a dirty portion, and '-' represents a clean portion. '+' represents where the soap was placed. Before the colon is what is the input, and after the colon is what is outputted.
IN : OUT
3 ===- : -+--
32 ================================ : ---------------+----------------
1 ==== : ++++
5 ----- : -----
4 -====- : --+---
3 -====- : --+-+-
7 === : +--
6 - : -
6 -==-===- : ---+----
5 -==--==- : ---+--+-
3 -==--==- : --+--+--

Rules

There are multiple solutions. Any one of them are acceptable, as long as they use the soap the minimum amount of times possible.
This is a code-golf contest, so the shortest answer in bytes wins!
Input may be whatever you want, as long as the plate and soap are specified, and clean/dirty portions of the plate are different. For example, strings and arrays of integers are allowed.
Output is of your choosing. You just need to make sure clean and soap portions of the output plate are different, but consistent. The plate and where the soap was placed should be shown.
Standard loopholes are not allowed.

Sandbox: Sandbox for Proposed Challenges

Does n//2 mean floor(n/2)? If it does, we would have $0$ on both sides for $n=3$, which would invalidate the 1st test case. So I guess you probably mean something else.

Since it does not affect the core of the challenge I'd suggest (before too many answers appear) that (1) you allow an array/list of whatever two things we'd like to use as input and output and (2) to allow the input and output to use a total of two distinct values, so long as we specify what they are in each case (i.e. even {in:{clean:1; dirty:2}, out:{clean:2; soap:1}} makes sense as long as it's specified).

@Arnauld yes it does, fixed it.

@user1475369 It is not fixed yet. n//2-1 should be (n-1) // 2.

JavaScript (ES6),  92 90 86  85 bytes
Saved 1 byte thanks to @Grimy
Takes input as (n)(string). Uses 1 as the soap character.
n=>s=>s.replace(eval(`/=.{0,${n-1}}/g`),s=>(g=n=>'-'.repeat(s.length-n>>1))(1)+1+g``)

Try it online!
How?
To get the widths of the cleaning areas, the helper function \$g\$ uses the expression \$\lfloor(n-k)/2\rfloor\$, which gives the left width for \$k=1\$ and the right width for \$k=0\$:
$$\lfloor (n-1)/2\rfloor=\cases{
(n-1)/2,&\text{if $n$ is odd}\\
n/2-1,&\text{if $n$ is even}\\
}$$
$$\lfloor (n-0)/2\rfloor=\cases{
(n-1)/2,&\text{ if $n$
 is odd}\\
n/2,&\text{ if $n$ is even}\\
}$$
Commented
n =>                           // n = soap width
s =>                           // s = plate string
  s.replace(                   // find in s all patterns consisting of
    eval(`/=.{0,${n - 1}}/g`), //   '=' followed by 0 to n-1 characters (greedily)
    s =>                       //   for each pattern s:
      ( g = n =>               //     g is a function taking n = 0 or 1
          '-'.repeat(          //       and outputting a string of
            s.length - n >> 1  //       floor((s.length - n) / 2) hyphens
          )                    //
      )(1) +                   //     replace s with g(1) (left part)
      1 +                      //     followed by '1' (the soap)
      g``                      //     followed by g(0) (right part)
  )                            // end of replace()

(s.length-n)/2 to s.length-n>>1 for -1 byte.

@Grimy I guess I was thinking no need to round because repeat does it for me, totally ignoring the fact that it was saving a byte... Thanks!

Python 3, 86 bytes
def f(n,s):i=s.find('1');return~i and'0'*i+f'{2:0^{min(n,len(s)-i)}}'+f(n,s[n+i:])or s

Try it online!
Uses 0 for empty plate, 1 for dirt and 2 for soap. Takes an integer n and a string s as input.
The function searches for the first dirt character 1 in the string s. Starting at that point, it will format a string of emtpy plate characters 0 with a soap character 2 as the center character. Because of Python's string formatting rules, the soap character 2 will be in the center-left position when n is even. This piece of string will be of length n or the remaining number of characters in the input string s, whichever is shorter. The rest of the string s is evaluated recursively.

VBA, 157bytes
Sub a(s, p):z=Len(p):Q=s\2+s Mod 2-1
While instr(x+1,p,1)<>0
F=instr(x+1,p,1)
f=f+2/s
If f>Z then f=z
Mid(p,f)=2
X=f+q
Wend
P=replace(p,1,0)
Msgbox p
End sub

I think there are lots of bytes to save but couldn't get rid of the if Statement without causing some cases to fail
is Expecting the plate to be 0 clean and 1 dirty (2 is soap)

@TaylorScott code revised. - should have been = and a "s" was missing before mod. Thanks for catching that.

You can get this down further as Sub a(s,p):z=Len(p):q=(s-1.5)\2:While InStr(x+1,p,1):f=Instr(x+1,p,1)+2/s:f=IIf(f>z,z,f):Mid(p,f)=2:x=f+q:Wend:Debug.?Replace(p,1,0):End Sub for 140 bytes or as an Excel VBA Immediate Window function as p=[B1]:z=Len(p):q=[A1-1.5]\2:While InStr(x+1,p,1):f=InStr(x+1,p,1)+[2/A1]:f=IIf(f>z,z,f):Mid(p,f)=2:x=f+q:Wend:?Replace(p,1,0) for 126 bytes. Note that the immediate window function requires either a clean module, or that x be let back to the default value of 0

Jelly, 29 22 bytes
+þ_H}ḞFṬo³Ạ
JŒPçƇḢṬ+Ị{

Try it online!
A full program taking the dish as a string as its first argument and the size of the soap as an integer as its second argument. Prints a string representing the clean dish with the soap in place. For both, 0 is dirty, 1 is clean and 2 is soap.

Input and output may be a list of integers.

Perl 5 (-p), 86, 59 bytes
-27 bytes thanks to Grimy,
$m=$_-1;s`=.{0,$m}`$_=$&;y/=/-/;s/(-*)-\1/$1+$1/r`ge;s;.* ;

TIO

$m=$_-1; input coerced to integer -1 which will be used as maximum number of character to be matched after =
s{=.{0,$m}}{...}e : subsitution of longest match of = followed by at most m characters
$_=$&;y/=/-/;s/(-*)-\1/$1+$1/r : to replace all = by - and then; to find the largest sequence of repeated - followed by a - and followed by the backreference \1
s;.* ;; : to remove the number and space from input

Previous answer
/ /;$m=$`-1;$p="{0,$m}";$_=$';s`=.$p`$l=length$&;"-"x(-!($l%2)+$l/2)."+"."-"x($l/2)`ge

TIO
other solution doesn't pass all tests because doesn't match clean parts within dirty.
67 bytes
/ /;$n=$`;$_=$';s/(=*)=(=?)\1(??{length$&>$n&&"^"})/$1+$2$1/g;y;=;-

TIO

-15

Down to 59

Retina 0.8.2, 69 bytes
\d+
$*-
^(-*)-\1
$1#$1
+`((((-)|#)+)-*,.*)(?<-4>.)*(?(4)$)=
$1$2
.+,

Try it online! Link includes test cases. Uses # to represent soap. Explanation:
\d+
$*-

Convert n into a template string of clean plate.
^(-*)-\1
$1#$1

Change the middle character of the template to soap.
+`

Repeatedly clean the plate until it cannot be cleaned any more.
((((-)|#)+)-*,.*)(?<-4>.)*(?(4)$)=

Match as much template and soap as possible. Keep track of the amount of template matched for later. The match starts as early as possible, so it will never start after the soap (since it could have matched starting at the soap in that case). Then optionally consume some clean template plate (meaning that the match must contain the soap) and an arbitrary amount before some dirty plate of exactly the same length as the template previously matched.
$1$2

Replace the dirty plate with the clean template and soap.
.+,

Delete the clean template and soap.

source: Stack Exchange

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

sort: votes


text:
Rotated analog clock
Given:

a 12 hour time t in hours and minutes,
a rotation r in degrees,

return the time shown when an analog clock that is displaying the time t is rotated r degrees clockwise.
After rotation, the hour hand will not line up with the new position of the minute hand. To correct for this, the new hour can be derived from the new position of the hour hand.
This is code-golf. The shortest solution wins. Standard loopholes apply.
Inspired by unmarked analog clocks like this one:

The hour hand doesn't really line up if you rotate the whole thing. Should we be basing the hour on which hours it is between? Some test cases might be nice too

@JoKing I added a line to clarify

How can we represent the time? A pair of integers, numbers of minutes since 1200, a native time object, a string like "0130" or "1:30"?

Test cases should be provided.

This needs more clarification and some test cases. We have 360 degrees and 60 minutes, which means rotating by 6 degrees should move the minutes handle to the next minute. But what if we rotate by 3 degrees? Will it be same minute or the next minute?

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


text:
Inquiry answerer

Original: https://james-iry.blogspot.co.at/2009/05/brief-incomplete-and-mostly-wrong.html

Alain Colmerauer designed the logic programming language Prolog. His goal was to create a programming language that is as intelligent as a two-year-old child. In order to prove that he had succeeded in his goal, he presented a Prolog program that answers "No" resourcefully for all inquiries.
  Ask me anything!
  ?-

(Of course he didn't.) Your task is to create a program that is more intelligent than Alain Colmerauer's program. This does not have to be in Prolog.

Specifics

If input ends with ? and has at least one ,, return text from the last , until before the last ?.
Else, if input ends with ? return No.
Else, return Yes.

Rules

No standard loopholes.
Input/output will be taken via our standard input/output methods.
Your program has to take at least 1 inquiry.
You should output the processed inquiry.
The Yes and No's are case-sensitive in the examples.
You are guaranteed that if the input includes a ?, the input will only have one ? and it will always be the last character.
The input will always be a phrase/sentence. This phrase/sentence will never only contain the characters , and ?, e.g. ,, ?, and ,? are not valid inputs. (Although submissions might implement it anyway, since the phrase/sentence is an empty string in these cases.)
In addition, the input will never end with ,?.
If there is whitespace immediately after the last , or immediately before the ?, they should be included in the output.

Examples
Hmm. -> Yes
Alright, -> Yes
Ask me anything! -> Yes
Ask me a question, please! -> Yes
Are you okay? -> No
No? -> No
Hey,does this program work? -> does this program work

Quotes in the following test cases should not be outputted.
They are used as a delimiter here.

Okay, so this does work ? -> " so this does work "
Please, add, a, test, case, containing, multiple, commas? -> " commas"

Scoring
This is code-golf, so shortest answer in bytes wins.

Are we guaranteed that if the input includes a ?, there will only be one and it will always be the last character?

Please add a test case containing multiple commas.

Can the input be ?, ,, or ,?

Accepting an answer early may discourage other users from posting new answers, because it kind of looks like the challenge is done.

If there is a space immediately after the last , or immediately before the ?, should they be included in the output or trimmed off?

Test cases: Is this thing on? Testing, testing., Is this thing on? Testing, testing?, and Is this thing on? Testing testing? (If I've read the challenge correctly the oututs should be Yes, testing, and No respectively).

You are guaranteed that if the input includes a ?, the input will only have one ? and it will always be the last character. Therefore these test cases are unneccecary.

Is ends with ,? a valid input?

05AB1E, 20 19 bytes
'?åi',¡”€–”0ǝθ¨ë”…Ü

-1 byte thanks to @Grimy.
Try it online or verify all test cases.
Explanation:
'?åi          '# If the (implicit) input contains a "?":
    ',¡       '#  Split the (implicit) input on ","
       ”€–”    #  Push dictionary string "Not"
           0ǝ  #  Insert it at the first position (index 0) in the list
       θ       #  Then get the last item of the list
        ¨      #  And remove the last character
               #  (either the "?" of the original input; or the "t" in "Not")
      ë        # Else:
       ”…Ü     #  Push dictionary string "Yes"
               # (after which the top of the stack is output implicitly as result)

See this 05AB1E tip of mine (section How to use the dictionary?) to understand why ”€–” is "Not" and ”…Ü is "Yes".

20

@Grimy Oh, smart thinking. Thanks! :)

Python 3, 62 bytes
lambda s:['Yes',*s[:-1].split(','),'No'][~(','in s)*('?'in s)]

Try it online!
The expression ~(','in s)*('?'in s) evaluates to 0 (i.e. 'Yes') if the string does not contain a '?', else -1 (i.e. 'No') if the string does not contain a ',', and otherwise -2 (i.e. the last comma-separated section of the string excluding the last character).

JavaScript (ES6),  53  52 bytes
s=>(m=s.match(/(,?)([^,]*)\?/))?m[1]?m[2]:'No':'Yes'

Try it online!
Commented
s =>                  // s = input string
  ( m = s.match(      // m is the result of matching in s:
  //     +------------>    an optional comma
  //     |     +------>    followed by a string containing no comma
  //     |     |   +-->    followed by a question mark
  //   <--><-----><>
      /(,?)([^,]*)\?/
  )) ?                // if m is not null:
    m[1] ?            //   if the comma exists:
      m[2]            //     output the string following it
    :                 //   else:
      'No'            //     output 'No'
  :                   // else:
    'Yes'             //   output 'Yes'

Welp, was looking for a JS solution, ended up with something double this size.

Perl 5 + -plF/,|\?/, 25 bytes
$_=/\?$/?/,/?pop@F:No:Yes

Try it online!

Charcoal, 23 22 bytes
¿№θ?¿№θ,⁻⊟⪪θ,¦?¦No¦Yes

Try it online! Link is to verbose version of code. Edit: Saved 1 byte thanks to @KevinCruijssen. Explanation:
¿№θ?

Does the string contain any ?s?
¿№θ,

Does it contain any ,s?
⊟⪪θ,

Split the string on ,s and take the last.
⁻...?

Delete the ? and output the result.
No

If there are no ,s then output No.
Yes

If there are no ?s then output Yes.

-1 changing Print(Join(Split(Pop(Split(q, ",")), "?"), w) to Print(Minus(Pop(Split(q, ",")), "?");

@KevinCruijssen Thanks, I'd forgotten that Minus did that. Besides, I was feeling pleased with myself for saving two separators.

Zsh, 51 bytes
<<<${${${1#*\?}:+Yes}:-${${${${1##*,}%$1}:-No}%\?}}

Try it online!
A byte can be saved if ends with,? and similar are invalid.

Stax, 16 bytes
ëw‼◘╔╤▬n→ª▒¡Γ╟ï¿

Run and debug it

Pyth, 25 bytes
?qeQ\??}\,QPecQ\,"No""Yes

Try it online!
?q                          # if       ==
  eQ\?                      #    Q[-1]    "?":
      ?}                    #   if     in
        \,Q                 #      ","    Q:
             cQ\,           #     return split(Q, ",")
            e               #                         [-1] (last element)
           P                #                             [:-1] (remove the trailing ?)
                 "No"       #   else: return "No"
                     "Yes"  # else: return "Yes" (last " implicit)

Retina, 32 28 bytes
^'?K`Yes
.+,(.*)\?
$1
'?K`No

-4 bytes with tips from @Neil.
Try it online.
Explanation:
   K`       # Replace any (implicit) input, which does
^           # NOT
 '?        '# contain a "?"
     Yes    # with "Yes"

.+          # Match 1 or more characters
  ,         # followed by a comma
    .*      # followed by zero or more characters,
   (  )     # (captured in capture group 1)
       \?   # followed by a (trailing) "?"
$1          # And replace it with just the match of capture group 1,
            # (so everything between the last comma and trailing question mark)

  K`        # Replace any remaining string, which does
'?         '# contain a "?"
    No      # with "No"

            # (after which the result is output implicitly)

Did you know that Retina 1's K stage has a built-in conditional? I didn't. It could probably save you a few bytes.

@Neil I'm not sure how to chain the K and conditional & to be completely honest. I know how to use K with a regex to match like this, but how do I combine it with the conditional to mimic a ternary if-else for the Yes/No?

You don't need &, which is what surprised me, and you can just match on a string, or better still, a character, since you know that any ? must be at the end.

@Neil So, like this? Which is also 32 bytes apparently.

Not quite; you're still matching on a regex, but you're allowed a string or character instead.

@Neil Ah, I had no idea it was possible to use characters in Retina like that. I'm not sure if I have the intended solution now, but it's down -4 to 28.

I think I had 28. (I might have had the ^ in a different place, not that it matters.)

Python 3, 98 87 bytes
-9 bytes thanks to ElPedro
x=input();o="Yes"
if"?"==x[-1]:o=x[(x.rfind(",")+1):-1]if x.count(",")else"No"
print(o)

Try it online!
This has been solidly beaten by other answers, but I'm trying out golfing in Python a bit more. Advice is appreciated!

You can use one print to avoid the assignment, then use a lambda since it's now just one statement, then shorten the inline if statements to a list indexing instead and then shorten the conditions to use in, then throw it all out because it's too close to an existing answer

A couple of golfs without changing your original approach to get it down to 87 Try it online!

You can replace if x.count(",") with if~x.find(","), saving one byte. str.find evaluates to -1 if the string is not found. If you complement this with the unary operator, it results in 0 if and only if the substring is not present. Alternatively, you can replace it with if","in x  for 4 bytes fewer.

IBM/Lotus Notes Formula, 79 bytes
@If(@Ends(i;"?");@If(@Contains(i;",");@Left(@RightBack(i;",");"?");"No");"Yes")

No TIO for Formula so...

Python 2, 66 63 62 bytes
lambda i:("Yes",("No",i[i.rfind(",")+1:-1])[","in i])["?"in i]

Try it online!
-3 after spotting the updated clarification "the input will only have one ? and it will always be the last character."
-1 with thanks to @ChasBrown
Basically a port of my Lotus Notes answer. Curiously, the clarification noted above does not help the Notes answer because @Ends is 4 bytes  cheaper than @Contains. Now if only there was an @In function...

Save 1 byte by using rfind.

Japt, 23 bytes
ø'? ?Uq, hoinu¹Ìk'?:`Y

Try it

C++ (gcc), 120 118 bytes
Function-like macro:
#include<string>
#define f(s)({int i{},j{};for(;s[i];)j=s[++i]-44?j:i;s[--i]-63?"Yes":j?std::string(s-~j,i+~j):"No";})

Try it online!
-2 bytes thanks to @ceilingcat

C# (Visual C# Interactive Compiler), 72 bytes
x=>x.Last()!=63?"Yes":x.Contains(',')?x.Split(',').Last().Trim('?'):"No"

Saved 2 bytes thanks to @someone
Try it online!

SkipLast(1) -> Trim('?') for -??? bytes as far as I see (all my attempts to calculate the difference result in different numbers)

Gema, 34 characters
*,*\?=@subst{\*,=;$2}
*\?=No
*=Yes

Sample run:
bash-5.0$ echo -n 'Hey,does this program work?' | gema '*,*\?=@subst{\*,=;$2};*\?=No;*=Yes'
does this program work

Try it online! / Try all test cases online!

PHP, 58 bytes
<?=$argn[-1]=='?'?substr(strrchr($argn,','),1,-1)?:No:Yes;

Try it online!

Red, 78 bytes
func[s][r:"Yes"parse s[to","copy t to"?"(r: last split t",")| to"?"(r:"No")]r]

Try it online!

Perl 6, 40 bytes
{m/[\,(.*?)]*\?$/??$0.tail||"No"!!"Yes"}

Try it online!

Jelly, 20 bytes
Ṗṣ”,Ṫ⁾NoḊ?Ɗ“Yes”i?”?

Try it online!


text:
Decimal “XOR” operator
Many programming language provide operators for manipulating the binary (base-2) digits of integers.  Here is one way to generalize these operators to other bases:
Let x and y be single-digit numbers in base B.  Define the unary operator ~ and binary operators &, |, and ^ such that:

~x = (B - 1) - x
x & y = min(x, y)
x | y = max(x, y)
x ^ y = (x & ~y) | (y & ~x)

Note that if B=2, we get the familiar bitwise NOT, AND, OR, and XOR operators.
For B=10, we get the “decimal XOR” table:
^ │ 0 1 2 3 4 5 6 7 8 9
──┼────────────────────
0 │ 0 1 2 3 4 5 6 7 8 9
1 │ 1 1 2 3 4 5 6 7 8 8
2 │ 2 2 2 3 4 5 6 7 7 7
3 │ 3 3 3 3 4 5 6 6 6 6
4 │ 4 4 4 4 4 5 5 5 5 5
5 │ 5 5 5 5 5 4 4 4 4 4
6 │ 6 6 6 6 5 4 3 3 3 3
7 │ 7 7 7 6 5 4 3 2 2 2
8 │ 8 8 7 6 5 4 3 2 1 1
9 │ 9 8 7 6 5 4 3 2 1 0

For multi-digit numbers, apply the single-digit operator digit-by-digit.  For example, 12345 ^ 24680 = 24655, because:

1 ^ 2 = 2
2 ^ 4 = 4
3 ^ 6 = 6
4 ^ 8 = 5
5 ^ 0 = 5

If the operands are different lengths, then pad the shorter one with leading zeros.
The challenge
Write, in as few bytes as possible, a program or function that takes as input two integers (which may be assumed to be between 0 and 999 999 999, inclusive) and outputs the “decimal XOR” of the two numbers as defined above.
Test cases

12345, 24680 → 24655
12345, 6789 → 16654
2019, 5779 → 5770
0, 999999999 → 999999999
0, 0 → 0

May we take the input or output as strings or char arrays?

@EmbodimentofIgnorance: Yes.  You can represent the numbers either as text (string, char[], etc.) or as numbers (int, long, etc.).

How about a digit array? Is that acceptable?

Is 09 an acceptable result for an input of 90, 99?

The generalisation of XOR is typically addition.

@OrangeDog: Yes, generalizing XOR to carry-less addition works well for crypto and checksum algorithms.  But I've set up this challenge to use a "fuzzy logic" definition based on the Zadeh operators, with values scaled so that True = 0 and False = 9.  Because (a+b)%10 is boring.

I wish there was a generalisation that maintained A^B^B=A

@trichoplax, you can't have both a^b=b^a and a^b^b=a for bases with an odd prime divisor

Jelly, 14 bytes
DUz0«9_ṚƊṀƊ€UḌ

Try it online!
Grid of all single digit pairs
A monadic link taking a list of two integers as its argument and returning an integer.
Explanation
D               | Decimal digits
 U              | Reverse order of each set of digits
  z0            | Transpose with 0 as filler
          Ɗ€    | For each pair of digits, do the following as a monad:
    «   Ɗ       | - Minimum of the two digits and the following as a monad (vectorises):
     9_         |   - 9 minus the digits
       Ṛ        |   - Reverse the order
         Ṁ      | - Maximum
            U   | Reverse the order of the answer to restore the orignal order of digits
             Ḍ  | Convert back from decimal digits to integer

If a digit matrix is acceptable input/output:
Jelly, 12 bytes
Uz0«9_ṚƊṀƊ€U

Try it online!

Pyth, 31 bytes
LhS,hb-9ebjkmeS,ydy_d_.t_MjRTQ0

Try it online!
LhS,hb-9eb             # Helper function, computes the (x & ~y) part
L                      # y = lambda b:
  S                    #               sorted(                )
   ,                   #                       [    ,        ]
    hb                 #                        b[0]
      -9eb             #                              9-b[-1]
 h                     #                                       [0] # sorted(...)[0] = minimum

jkmeS,ydy_d_.t_MjRTQ0  # Main program (example input Q: [123, 45])
                jRTQ   # convert each input to a list of digits -> [[1,2,3],[4,5]]
              _M       # reverse each -> [[3,2,1],[5,4]]
            .t      0  # transpose, padding right with 0 -> [[3,5],[2,4],[1,0]]
           _           # reverse -> [[1,0],[2,4],[3,5]]
  m                    # map that over lambda d:
    S,                 #   sorted([    ,           ])
      yd               #           y(d)
        y_d            #                 y(d[::-1])         # reversed
   e                   #                             [-1]   # sorted(...)[-1] = maximum
jk                     # ''.join( ^^^ )

Python 2, 71 bytes
f=lambda n,m,T=10:n+m and max(min(n%T,~m%T),min(m%T,~n%T))+f(n/T,m/T)*T

Try it online!

C# (Visual C# Interactive Compiler), 75 bytes
a=>b=>a.Select((x,y)=>Math.Max(9-x<(y=y<b.Count?b[y]:0)?9-x:y,9-y<x?9-y:x))

Saved 6 bytes thanks to @someone
Try it online!

76 bytes. I think this question might be a unique opportunity to use Zip.

@someone Thanks! Regarding Zip, you can't use it as it automatically truncates the longer collection to the length of the shorter one

Forth (gforth), 111 bytes
: m 10 /mod rot ;
: t 9 swap - min ;
: f 2dup + 0> if m m recurse 10 * -rot 2dup swap t -rot t max + 1 then * ;

Try it online!
Code Explanation
: m          \ start a new word definition
  10 /mod    \ get quotient and remainder of dividing by 10
  rot        \ move item in 3rd stack position to top of stack
;            \ end word definition

\ word implementing "not" followed by "and"
: t          \ start a new word definition
  9 swap -   \ subtract top stack element from 9
  min        \ get the minimum of the top two stack elements
;            \ end word definition

: f          \ start a new word definition
  2dup +     \ duplicate top two stack elements and add them together
  0> if      \ if greater than 0
    m m      \ divide both by 10, move remainders behind quotients
    recurse  \ call self recursively
    10 *     \ multiply result by 10 (decimal left shift of 1)
    -rot     \ get remainders from original division
    2dup     \ duplicate both remainders
    swap t   \ swap order and call t (b & !a)
    -rot t   \ move result back and call t on other pair (a & !b)
    max + 1  \ get the max of the two results and add to total. put 1 on top of stack
  then       \ end if block
  *          \ multiply top two stack results (cheaper way of getting rid of extra 0)
;            \ end word definition

PHP, 111 109 bytes
for(;''<($a=$argv[1][-++$i]).$b=$argv[2][-$i];)$s=min($a<5?9-$a:$a,max($a<5?$a:9-$a,$a<5?$b:9-$b)).$s;echo$s;

Try it online!
Tests: Try it online!
If we call the digits we want to XOR, $a and $b, I found that:

When $a is less than 5, XOR = min(9-$a, max($a, $b))
When $a is equal to or more than 5, XOR = min($a, max(9-$a, 9-$b))

So I implemented this logic plus a hack to handle numbers with different lengths. I take each digit form the end of both input numbers (with negative indexes like input[-1], input[-2], ...) and compute the XOR and put the result in reversed order in a string to be printed at the end. Since I take digits from the end of numbers, XOR results should be put together in reversed order. When one of the inputs is longer than the other one, the negative index on shorter input results in an empty string which is equal to 0.

Retina, 85 59 bytes
^'0P`.+
N$`.
$.%`
¶

/../_(`^
$"
T`d`Rd`.¶.
%N`.
^N`..
L`^.

Try it online! Takes input as separate lines, but link is to test suite that reformats comma-separated input. Explanation:
^'0P`.+

Left-pad with zeros both lines to the same length.
N$`.
$.%`
¶

Sort each digit by its column index, then delete the newline. This has the effect of pairing the digits together in much the same way as a transpose would.
/../_(`

Apply separately to each pair of digits, joining the results together.
^
$"

Duplicate the pair.
T`d`Rd`.¶.

Reverse the second digit of the first pair and the first digit of the second, so we now have x ~y on one line and ~x y on the other.
%N`.

Sort the digits of each line in order, so that the first digit is now x & ~y or ~x & y as appropriate.
^N`..

Reverse sort the lines.
L`^.

And extract the first digit, which is the desired result.


text:
Escape the labyrinth!
You are trapped in this 5x5 labyrinth - each room is labelled from 1 to 25 and the exit is in room 1.

You are given as input the room you are currently in. Your task is to output the shortest sequence of moves (north, east, south, west) needed to reach room 1.
Moves can be output in any format you wish (list, string, array...) as long as you use the characters n,w,e,s.
Here are all the test cases:
1 => empty string/list
2 => w
3 => ww
4 => swwnw
5 => wswwnw
6 => seenwnw
7 => nw
8 => wnw
9 => wwnw
10 => swwnwnw
11 => eenwnw
12 => enwnw
13 => nwnw
14 => wnwnw
15 => wwnwnw
16 => enenwnw
17 => nenwnw
18 => wnenwnw
19 => nwnwnw
20 => wnwnwnw
21 => nenenwnw
22 => enwnenwnw
23 => nwnenwnw
24 => wnwnenwnw
25 => nwnwnwnw

Shortest answer in bytes wins!

Do we have to work with differents labyrinths ? If yes, how do we get the walls as input ?

How flexible is the room labeling / input? Can we 0-index instead of 1-index? Can we take the room number as a character (thinking, as in base 36)?

@Therandomguy no, you need to handle this specific labyrinth.

hence, the [tag:kolmogorov-complexity] tag

Since it is possible, I think all possible cases should be included in the test cases.

This is what I've come up with, but haven't rigorously verified

@UnrelatedString This question take 1 input, and output different path based on its input. I believe this requirement does not fit the [tag:kolmogorov-complexity] tag.

@JonathanFrech Shaggy done!

Could you address @ChasBrown's questions, please?

@Shaggy the room number has to be an integer and starts at 1 - no 0-indexing.

Someone needs to provide an answer in Labyrinth.

I can't see the image.

Python 2, 64 bytes
def f(n):d=0x1211252b5375>>2*n-4&3;print"nwes"[d];f(n+d*3+d%2-5)

Try it online!
A function that prints one direction per line, terminating with error.
The constant 0x1211252b5375 encodes in base 4 the direction d we travel from each room number as a number 0 through 3. The extraction digit >>2*n-4&3 is also designed to give a negative shift error when n=1, terminating the code. We update the room number n via an offset that's computed from the direction d as d*3+d%2-5, which maps:
d   d*3+d%2-5
0  -> -5
1  -> -1
2  ->  1
3  ->  5

I'm not sure if this is valid as-is, functions have to be reusable, and you need error trapping (try/except) to be able to continue execution after calling this function.

Python 2, 95 93 bytes
f=lambda n:n>1and Q[n]+f(n+[-5,5,1,-1]['nsew'.find(Q[n])])or''
Q='  wwswsnwwseenwwenwnwnenwn'

Try it online!
Could shave off 3 2 bytes if 0-indexed room labeling is allowed.

89 bytes

05AB1E, 30 29 bytes
-1 byte thanks to a miraculous coincidence with prime numbers
[Ð#•θzƶ‰`Ó•4вsè<DˆØ·5-+}'‹™¯è

Try it online!
[                      }    # infinite loop:
 Ð                          #  triplicate the room number (initially, the input)
  #                         #  break if room number == 1
   •θzƶ‰`Ó•4в               #  compressed list 202232302231102210202010
             sè             #  use the room number to index into that list
               <            #  decrement
                Dˆ          #  add a copy to the global array
                  Ø         #  nth prime (-1 => 0, 0 => 2, 1 => 3, 2 => 5)
                   ·        #  double
                    5-      #  subtract 5
                      +     #  add that to the room number
'‹™                         # dictionary string "western"
   ¯                        # push the global array
    è                       # index (wraps around, so -1 => n, 0 => w, 1 => e, 2 => s)

This outputs 1 for input 1, instead of an empty string (easy fix would be to add a leading õ?). Apart from that, nice answer!

@KevinCruijssen thanks for pointing out that mistake! I found a single-byte fix.

Ruby, 72 62 bytes
f=->n{n<2?'':' en  sw'[x=4*18139004[n]+6*4267088[n]-5]+f[n+x]}

Try it online!
How?
The trick here is to use 2 constants to build the next step for each cell, then recursively solve the problem.
The 2 constants 18139004 and 4267088 are binary strings giving the direction of the next move, by extracting a single bit from both for each cell, we can get:
"n" = 4*0+6*0-5 = -5
"w" = 4*1+6*0-5 = -1
"e" = 4*0+6*1-5 = +1
"s" = 4*1+6*1-5 = +5

Easier than shifting around and masking a single big binary number IMHO.
When we get the direction, we extract the corresponding letter from the string " en  sw":
  1   5
  |   |
" en  sw"
   |   |
  -5  -1

And proceed recursively on the cell [n+x]

JavaScript (ES7),  62  58 bytes
Port of xnor's answer.
f=n=>--n?"nwes"[d=79459389361621/4**n&3]+f(n+d*3+d%2-4):''

Try it online!

Perl 5 (-n), 94 bytes
-5 bytes thanks to Grimy
@A=map/./g,__wwswsnwwseenwwenwnwnenwn;%H=(n,-5,s=>5,e,1,w,-1);$_+=$H{$,=$A[$_]},say$,until$_<2

TIO

-8

-2

-5

thanks for all optimizations, the final answer is different enough from the first

Do you mean I should post it as a separate answer?

yes because it seems you did the most of the work, it was interesting to see how we can always save space

Perl 5, 79 bytes
say$,while$_+={n,-5,s=>5,e,1,w,-1}->{$,=substr _wwwswsnwwseenwwenwnwnenwn,$_,1}

Try it online!

JavaScript, 80 73 71 bytes
Adapted from Chas' Python solution so please +1 him, too.
f=n=>--n?(d=" wwswsnwwseenwwenwnwnenwn"[n])+f(n+~~{n:-4,s:6,e:2}[d]):``

Try it Online!
1 byte saved thanks to Arnauld.

Thanks, @Arnauld :) Had just spotted that myself, too.

PHP, 110 bytes
A solution which isn't a port of Chas Brown's great answer or xnor's great answer. I know this is longer but I wanted to have a different solution!
for($n=$argn;$n>1;$n=ord($s[$n*2+1])%30)echo($s='0000w<w sEw"s)n w%w&s-e*e+n&w+w,e/n*w/n,w1n.e5n0w5n2')[$n*2];

Try it online!
I have created a mapping string which has 2 characters for every cell in the board. First character for each cell is a move (n/e/s/w) or 0 and the second character's ASCII code mod 30 will return another cell number which we should follow its move in recursive mode until we get to exit cell (cell < 2).
For example for input of 8:

2 characters for cell 8 are: w%
It means print w and continue with moves for cell of %
ASCII code of % is 37 which mod 30 will be 7, so next cell to follow is 7.
2 characters for cell 7 are: n  (last character is space, ASCII code = 32)
It means print n and continue with moves for cell of 32 mod 30 which is 2.
2 characters for cell 2 are: w< (last character ASCII code = 60)
It means print w and continue with moves for cell of 60 mod 30 which is 0.
If cell number is less than 2, loop stops!
Final printed result: wnw

PHP, 75 bytes
This version is written by Grimy, it is 35 bytes shorter than my original answer because he/she is smarter! Grimy's comment: "4 * 25 < 256, so you only need 1 byte per cell, not 2"
for($n=$argn;$n=ord("0\0~f;6o4R:s%ql&rup*@^tIDbx"[$n%25]);)echo news[$n%4];

Try it online!

PHP, 71 bytes
This port of Arnauld's answer which is port of xnor's answer, but as a loop instead of recursive function, since it turns out to be shorter in PHP.
for($n=$argn;--$n;$n+=$d*3+$d%2-4)echo nwes[$d=79459389361621/4**$n&3];

Try it online!

4 * 25 < 256, so you only need 1 byte per cell, not 2: Try it online!

@Grimy, amazing, I think you have to post it as a separate answer, it is different enough.

I'm not gonna do that, so you choose whether to incorporate it in your answer or leave it as just a comment.

@Grimy, added your version with your name. Thanks anyways.

Charcoal, 43 40 bytes
ＮθＷ⊖θ«≔Ｉ§”)“⊞x⟧∧⎚⁵2”ιι§nwesι≧⁺⁻⁺﹪ι²×³ι⁵θ

Try it online! Link is to verbose version of code. Based on both @ChasBrown's and @xnor's answers. Explanation:
Ｎθ

Input the room.
Ｗ⊖θ«

Set the loop variable i to one less than the room number and repeat while it is non-zero.
«≔Ｉ§”)“⊞x⟧∧⎚⁵2”ιι

Extract the direction from the compressed string 0113130113220112010102010. (The leading 0 is just a filler digit.)
§nwesι

Print the direction.
≧⁺⁻⁺﹪ι²×³ι⁵θ

Use @xnor's formula to calculate the new room number.

Jelly, 30 29 bytes
“þ&ƊĿñ÷°e’b6Ḥ_5Ż⁸+ị¥ƬI‘ị“®ȯẹ»

Try it online!
A monadic link taking the starting cell and returning a string with the directions.
I love the fact that Jelly’s dictionary has a word like ‘Kennesaw’ (a city northwest of Atlanta, Georgia), used here because indexing into it with [5, 1, -5, -1] + 1 gives nesw!
Explanation
“þ...e’                    | Base-250 integer 1962789844189344852
       b6                  | Convert to base 6 (2, 2, 5, 2, 5, 0, 2, 2, 5, 3, 3, 0, 2, 2, 3, 0, 2, 0, 2, 0, 3, 0, 2, 0)
         Ḥ                 | Double
          _5               | Subtract 5
            Ż              | Prepend 0
             ⁸  ¥Ƭ         | Using this as the right argument and the original link argument as the left argument, loop the following as a dyad until there is no change, collecting up results
              +            | - Add the left argument to:
               ị           |   - The left argument indexed into the right argument
                  I        | Differences between consecutive numbers
                   ‘       | Increment by 1
                    ị“®ȯẹ» | Index into "Kennesaw"

C (clang), 81 bytes
v;f(p){p-1&&putchar(v="00wwswsnwwseenwwenwnwnenwn"[p])+f(p+=v%5?6-v%8:v%2?5:-5);}

Try it online!
Thanks to @Tommylee2k suggestion -8!
+ recursive call
C (clang), 90 bytes
v;f(p){for(char*l="00wwswsnwwseenwwenwnwnenwn";p-1;p+=v%5?6-v%8:v%2?5:-5)putchar(v=l[p]);}

Try it online!
Similar to all not compressed solutions.

can be shortened: v;f(p){for(;p-1;p+=v%5?6-v%8:v%2?5:-5)putchar(v="00wwswsnwwseenwwenwnwnenwn"[p]);}

05AB1E, 45 43 bytes
õ?[Ð#.•DUo¢ê`Ω÷‰₂¡)R€ûK•¦sè©?Ž₁9₂в6-'€Ã®kè+

Port of @ChasBrown's Python 2 answer.
Try it online or verify all test cases.
Explanation:
õ?               # Output an empty string
                 # (to overwrite the implicit output if the input is 1)
[                # Start an infinite loop:
 Ð               #  Triplicate the top of the stack
                 #  (which is the (implicit) input in the first iteration)
  #              #  If it's exactly 1: stop the infinite loop
  .•DUo¢ê`Ω÷‰₂¡)R€ûK•
                 #  Push compressed string "a  wwswsnwwseenwwenwnwnenwn"
   ¦             #  Remove the first character
    sè           #  Swap to get the number, and use it to index into the string
      ©          #  Store it in variable `®` (without popping)
       ?         #  Print it without trailing newline
  Ž₁9            #  Push compressed integer 22449
     ₂в          #  Convert to base-26 as list: [1,7,5,11]
       6-        #  Subtract 6 from each: [-5,1,-1,5]
         '€Ã    '#  Push dictionary string "news"
            ®k   #  Get the index in this string of character `®`
              è  #  And use that to index into the integer-list
               + #  And add it to the originally triplicated integer

See this 05AB1E tip of mine (all four sections) to understand why .•DUo¢ê`Ω÷‰₂¡)R€ûK• is "a  wwswsnwwseenwwenwnwnenwn"; Ž₁9 is 22449; Ž₁9₂в is [1,7,5,11]; and '€Ã is "news".

That convenient dictionary string must have been good news!

@Neil Definitely. :) Although apparently the dictionary string western is better. ;p

Bash, 120 bytes
S=__wwswsnwwseenwwenwnwnenwn
N=n-5w-1s05e01
for((i=$1;$i>1;i+=$j)){ d=${S:$i:1};j=${N:`expr index $N $d`:2};printf $d; }

Try it online!
I toyed for a while with trying to bit-pack the string as nibbles, but the decoding would require more characters than the number saved.
How it works:
S=__wwswsnwwseenwwenwnwnenwn

String $S holds a single character (n,w,s,e) for each room showing which direction to take to move one room towards the exit, skipping rooms 0 and 1.
N=n-5w-1s05e01

String $N has the delta to add to/subtract from the current room number for each direction change (n: -5, w: -1, s: +5, e: +1)
for((i=$1;$i>1;i+=$j)){ d=${S:$i:1};j=${N:`expr index $N $d`:2};printf $d; }

Start with $i equal to the room number given on the command line ($1). Assign the character at index $i in string $S to $d. Retrieve the delta value from $N for the direction to take to the next room, assigning it to $j.
Print the next direction to take in $d.
Add/subtract the delta in $j to/from $i.
Loop until we leave room #2 (while $i>1).

Stax, 31 bytes
α-J╒Θ▀╣ô¥$v╞||T←]┬yΣ╨z§£sU╕τR"┌

Run and debug it

Kotlin, 112 bytes
val d="  113130113220112010102010"
fun p(r:Int):String=if(r>1)"nwes"[d[r]-'0']+p("046:"[d[r]-'0']-'5'+r)
else ""

Try it online!


text:
Simulate a 1D Game-of-Life-ish Model
This question just trended over on code-review and I figured you might like it adapted as a codegolf challenge:
You are given a non-empty list of x houses represented as booleans. Each day, the houses compete with adjacent ones. 1 represents an "active" house and 0 represents an "inactive" house. If the neighbors on both sides of a given house are either both active or both inactive, then that house becomes inactive on the next day. Otherwise it becomes active.
def get_state_as_pos(thelist, pos):
    if thelist[pos-1] == thelist[pos+1]:
        return 0
    else:
        return 1

For example, if we had a group of neighbors [0, 1, 0] then the house at [1] would become 0 since both the house to its left and right are both inactive. The cells at both ends check the opposite side as well, so the neighbors at index 0 are at index length-1 and indexn1 and vice versa.
Even after updating the cell, you have to consider its prior state when updating the others so that the state information of each cell is updated simultaneously.
The function takes the array of states and a number of steps and should output the state of the houses after the given number of steps.
    input: states = [1, 0, 0, 0, 0, 1, 0, 0], steps = 1
   output should be [0, 1, 0, 0, 1, 0, 1, 1]

    input: states = [1, 1, 1, 0, 1, 1, 1, 1], steps = 2
intermediate state= [0, 0, 1, 0, 1, 0, 0, 0]
   output should be [0, 1, 0, 0, 0, 1, 0, 0]

    input: states = [1], steps=1
    output: states= [0]

Take the list and steps however you like and output the resulting list via default I/O. Standard loopholes are forbidden. This is codegolf, shortest answer in bytes wins!

+1 for Cellular Automata. Isn't this Rule 90, though?

Shouldn't the first test case result in [0, 1, 0, 0, 1, 0, 1, 1]?

@TwilightSparkle What's rule 90? I am rather new, sorry.

@TFeld you are indeed correct. Fixed it!

@jaaq I'm referring to the Elementary Cellular Automata Rule (of transformation between each step, or generations) #90. Type "Rule 90" in Wolfram|Alpha.

@TwilightSparkle yes it appears to be. I never got too far into Cellular Automata, this appears to be coincidence.

output the resulting list via STDOUT : it is highly recommended to just rely on our default I/O methods.

@jaaq Not so much coincidence as there's a Rule # for every standard 1D Cellular Automata.  This is because 3 bits has 8 possible states (left neighbor, self, right neighbor) and if you say for each of those states a given house will be on or off that's 8 true/false values which happens to map perfectly to a byte.  Thus Rule #0-255 can be used as shorthand to describe any of these rulesets by taking the binary expression to be the resulting house on/off state in each of the 8 situations based on position in the byte.
Some rules are considered to be notable such as 90, thus the recognition :)

@Arnauld didn't know about that. Added!

Can the number of steps be 0?

good question. What would be considered standard?

05AB1E, 14 13 10 9 6 bytes
Based on Shaggy's Japt solution
F©Á®À^

Try it online!
F                  # repeat n times:
 ©Á                #  the list, rotated right
   ®À              #  the list, rotated left
     ^             #  xor (vectorizes)

Unnecessarily clever 9-byte solution:
F¥DO.øü+É

Try it online!
F                  # repeat n times:
                   #  (examples given for the initial state [0, 1, 1, 0, 1])
 ¥                 #  deltas of the list ([1, 0, -1, 1])
  D                #  duplicate
   O               #  sum (1)
    .ø             #  surround ([1, 1, 0, -1, 1, 1])
      ü+           #  pairwise addition ([2, 1, -1, 0, 2])
        É          #  modulo 2 ([0, 1, 1, 0, 0])

Python 2, 72 bytes
f=lambda s,n:n and f([a^b for a,b in zip(s[-1:]+s,s[1:]+s[:1])],n-1)or s

Try it online!

Wolfram Language (Mathematica), 31 bytes
CellularAutomaton[90,#,{{#2}}]&

Try it online!
CellularAutomaton assumes the input list is cyclic.

JavaScript (ES6), 57 bytes
Takes input as (steps)(array).
s=>g=a=>s--?g(a.map(_=>a[~-i++%l]^a[i%l],i=l=a.length)):a

Try it online!

Japt -mh, 11 10 9 bytes
I/O of states as singleton 2D arrays.
VÇí^Zé2)é

Try it
VÇí^Zé2)é     :Implicit input of integer U=steps & array V=[states]
VÇ            :Modify the last element Z in V
  í           :Interleave with
    Zé2       :  Z rotated right twice and
   ^          :  Reduce each pair by XOR
       )      :End interleave
        é     :Rotate right once
              :Repeat U times and implicitly output V

Retina, 51 bytes
1A`
"$+"{`(.).*(.)
$2$&$1
(.)(?=.(\1|(.)))?
$#2*$#3

Try it online! Takes the number of steps on the first line and a string of 0s and 1s on the second line. Explanation:
1A`

Delete the number of steps from the input.
"$+"{

Repeat that number times.
`(.).*(.)
$2$&$1

Copy the end digits to the other ends to simulate wrapping.
(.)(?=.(\1|(.)))?
$#2*$#3

Perform the XOR operation.

APL (Dyalog Extended), 12 bytesSBCS
Full program. Prompts stdin for array of states and then for number of steps. Prints to stdout.
1(⌽≠⌽⍢⌽)⍣⎕⊢⎕

Try it online!
⎕ get evaluated input from console (array of states)
⊢ on that, apply…
1(…)⍣⎕ the following tacit function, input number of times, each time with 1 as left argument:
 ⌽⍢⌽ rotate the right argument 1 step left while reversed (i.e. rotate one step right)
 ⌽≠ XOR with the argument rotated 1 step left

Python 2, 71 bytes
f=lambda a,n:n and f([a[i-1]^(a+a)[i+1]for i in range(len(a))],n-1)or a

Try it online!

Jelly, 7 bytes
ṙØ+^/$¡

Try it online!
Full program. A singleton output is represented as x instead of [x].

Pyth, 24 bytes
AQVH=Gmxhded.:+eG+GhG3;G

Try it online!
AQ                        # G, H = Q[0], Q[1] # Q = input in the form [[states],steps]
  VH                      # for i in range(H):
    =G                    # G =
      m                   #     map(lambda d:                              )
       xhded              #                   d[0] ^ d[-1],
            .:       3    #         substrings(                 , length=3)
              +eG+GhG     #                     G[-1] + G + G[0]
                      ;   # (end for loop)
                       G  # print G

Ruby, 59 bytes
->r,n{n.times{r=r.rotate.zip(r.rotate -1).map{|a,b|a^b}};r}

Try it online!


text:
I reverse the source code, you negate the output!
Your task, if you wish to accept it, is to write a program that outputs a non-zero number(can be integer or float). The tricky part is that if I reverse your source code, the output must be the original integer negated.
Rules

You must build a full program. That is, your output has to be printed to STDOUT.
Both the numbers must be in base 10 (outputting them in any other base or with scientific notation is forbidden).
Outputting the numbers with trailing / leading spaces is allowed.
This is code-golf, so the shortest (original) code in each language wins!
Default Loopholes apply.

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

If we could reverse at the bit level rather than the byte level the one byte - (0x45 = 0b00101101) works in Jelly -  - yields -1 since it defines the literal -1, while Ṇ (0xB4 = 0b10110100) yields 1 since it performs a logical not of the implicit input of zero. (Of course Ṇ works just as well :p)

@TwilightSparkle Does "have an unused, empty input" mean we can rely on input functions immediately reaching EOF?

@Borka223 No, you may not.

05AB1E, 2 bytes
(1

Try it online!
!enilno ti yrT
(       # negate nothing
 1      # push 1 (and implictly output it)

1       # push 1
 (      # negate it (and implictly output it)

+1 for "!enilno ti yrT"..

PowerShell,  4  3 bytes
1-0

Try it online! or !enilno ti yrT
Golfed a byte by using arithmetic instead of the number-comment-number format.

This is apparently also the same as jshell (per Sam), and jq (per manatwork -- 1-0 and 0-1).

The same in jshell

The same in jq: 1-0 0-1.

JavaScript (V8), 19 bytes
print(1)//)1-(tnirp

Try it online!

almost identical to...
C# (Visual C# Interactive Compiler), 19 bytes
Print(1)//)1-(tnirP

Try it online!
(thanks to @someone for pointing it out)

still pretty much the same in...
Lua, 19 bytes
print(1)--)1-(tnirp

Try it online!

but shorter in...
Python 2, 15 bytes
print 1#1-tnirp

Try it online!

Even shorter in PHP, because it has this magic printing tool: <?= ...
PHP, 12 bytes
<?=1;#;1-=?<

Try it online!

Even shorterer in Ruby, because you can inspect rather than print
Ruby, 8 bytes
p 1#1- p

Try it online!

Also C# Interactive, Print(1)//)-1(tnirP. (Try it online!)

For C#, the shortest program is likely also the trivial one: class A{static void Main(){System.Console.Write(1);}}//}};)1-(etirW.elosnoC.metsyS{)(niaM diov citats{A ssalc

Not a programming language, but you can do 1<!--!<1- (9 bytes) with HTML, which will be -1<!--!<1 when reversed. It does exactly the same as your answer.

Mostly the same in Lua: print(1)--)1-(tnirp

@val This is a community wiki answer, so feel free to edit.

It would be nice to find answers for those languages, without any comment.

@EricDuminil: https://codegolf.stackexchange.com/a/193169/81663

Now that is a true bigbrainer

///, 4 bytes
9/9-

Outputs 9.
Try it online!
Reversed:
-9/9

Outputs -9.
Try it online!
Everything before the / is printed, while the rest is ignored (not really used slashes much so I don't know exactly what happens, but it doesn't output anything).

+1 for using Slashes. The / begins the pattern-reading process, and thus, the characters after it is readed into the pattern, not outputted.

I came up with /\-//1- and thought I was clever. :D

Whitespace, 21 bytes
S S S T N
T   N
S T N
N
N
T   S N
T   N
T   T   S S

Letters S (space), T (tab), and N (new-line) added as highlighting only.
Outputs 1/-1.
Try it online or try it online reversed (with raw spaces, tabs and new-lines only).
Explanation:
Utilizing the Exit Program builtin being a short palindrome NNN.
The regular program will:
SSSTN  # Push 1 to the stack
TNST   # Pop and print the top of the stack as number
NNN    # Exit the program, making everything after it no-ops

The reverse program will:
SSTTN  # Push -1 to the stack
TNST   # Pop and print the top of the stack as number
NNN    # Exit the program, making everything after it no-ops

Small additional explanation of pushing a number:

First S: Enable Stack Manipulation
Second S: Push a number to the stack
S or T: Positive/negative respectively
Some S/T followed by a trailing N: number in binary, where S=0 and T=1

I.e. SSTTSTSN pushes -10.

Google, 3 bytes
2-1

Try it online!!enilno ti yrT

This also works in TI-Basic

"output" here isn't well defined for the entire search engine Google. Did you mean, specifically, Google's Calculator?

Also works in python IDLE

Stack Cats -mn, 4 bytes
:-:_

Try it online! In the footer I've included all other 4-byte solutions. (Stack Cats ignores everything after the first linefeed.)
Try the reverse!
Explanation
The -n flag turns on numeric output (and input, but we don't have any), and the -m flag is normally just a golfing convenience which lets you avoid the redundant part of the source code. This is because every Stack Cats program needs to have mirror symmetry. With the -m flag you only give it the first half (plus the central character). So the actual program here is:
:-:_:-:

As you can see in the first TIO link, there's a ton of 4-byte solutions, but I picked this one for its simplicity. Stack Cats is stack-based, and this program only uses the initial stack. Since we don't have any input, it contains a single -1 (an EOF marker) on top of an infinite well of zeros. The three commands in the program have the following meaning:
:   Swap the top two stack elements.
-   Negate the top stack element (i.e. multiply by -1).
_   Pop a. Peek b. Push b-a.

So here is how the program modifies the stack (states and commands are staggered to indicate how each command changes the stack from one state to the next):
   :   -   :   _   :   -   :

-1   0   0  -1   1   0   0   1
 0  -1  -1   0   0   1   1   0
 0   0   0   0   0   0   0   0
 …   …   …   …   …   …   …   …

As it turns out, the only command that really does anything here is _ which turns our EOF marker into a 1. Output at the end of the program is implicit, and the EOF marker is optional, so this just prints out the 1 we get.
Now if we reverse the source code, due to the implicit mirroring, the actual program becomes:
_:-:-:_

This does something very different:
   _   :   -   :   -   :   _

-1   1   0   0   1  -1   0  -1
 0   0   1   1   0   0  -1  -1
 0   0   0   0   0   0   0   0
 …   …   …   …   …   …   …   …

This time the bottom of the stack is still a -1 so it does act as the EOF marker and only the -1 on top of it gets printed.
...
Now with all of that said, since Stack Cats has such a unique relationship with reversing code, I feel that using -m is a little cheating. It's normally only meant to save bytes by omitting the redundant part of the source code, but here it actually makes the challenge a lot easier and even the full program shorter. This is because reversing a full program will only change the program if it contains any of <>[], which also means that the program ends up making use of multiple stacks (Stack Cats actually has a tape of stacks, where all but the initial one are only filled with zeros to begin with). Furthermore, reversing it then just swaps the <> and [] pairs, which still makes the execution symmetric. The only way to break that symmetry is to use I which does -] or -[ or nothing depending on the sign of the top of the stack. So...

Stack Cats -n, 11 bytes
*|]I*:*I[|*

Try it online! The footer again includes all other alternatives at the same byte count. Some of those output 1/-1 and some output 2/-2 as indicated after each program. I picked this one to explain kinda randomly as one of the ones that output 2.
Try the reverse!
Explanation
As I said, this one's a bit longer. Even if we did use the -m notation for this, it would weigh in at 6 bytes instead of the above 4.
The commands in use this time:
*   Toggle the least significant bit of the top of the stack.
|   Reverse the longest non-zero of prefix on this stack.
[]  Move one stack to the left/right and take the top of the current stack with you.
I   If the top of the stack is positive, -], if it's negative, -[, otherwise do nothing.
:   Swap the top two stack elements.

The first program only uses two stacks. That's a bit messy to do in ASCII art, but I'll try my best. The square brackets indicate which stack the tape head is on, and I'll put the commands between each pair of stack states.
  [-1]
…   0   0   …
    0   0
    …   …

      *

  [-2]
…   0   0   …
    0   0
    …   …

      | (does nothing)
      ]

      [-2]
…   0   0   …
    0   0
    …   …

      I

   [2]
…   0   0   …
    0   0
    …   …

      *

   [3]
…   0   0   …
    0   0
    …   …

      :

   [0]
…   3   0   …
    0   0
    …   …

      *

   [1]
…   3   0   …
    0   0
    …   …

      I

      [-1]
…   3   0   …
    0   0
    …   …

      [

  [-1]
…   3   0   …
    0   0
    …   …

      |

  [ 3]
…  -1   0   …
    0   0
    …   …

      *

  [ 2]
…  -1   0   …
    0   0
    …   …

Now the -1 acts as an EOF marker and the 2 gets printed.
The other program is the same until the [. It's still virtually the same all the way until the second I. We'll technically be on a different stack, but without values on them, they're all indistinguishable. But then the difference between I[ and I] ends up mattering:
    *|[I*:*I

      [-1]
…   3   0   0   …
    0   0   0
    …   …   …

        ]

          [-1]
…   3   0   0   …
    0   0   0
    …   …   …

        | (does nothing)
        *

          [-2]
…   3   0   0   …
    0   0   0
    …   …   …

And this time, we don't have an EOF marker, but the program still outputs the -2.

Klein 011, 5 bytes
1-
@/

Try it online!
Reversed
/@
-1

Try it online!
These take advantage of Klein's unique topology, specifically the real projective plane.  (Although individually each answer only needs a Klein bottle).

Haskell without comments, 41 bytes
Forwards prints 1 + newline:
main=print$!1
niam=main
"1-"!$rtStup=niam

Try it online!
Reversed prints -1 with no newline (which could be added at a cost of 2 bytes):
main=putStr$!"-1"
niam=main
1!$tnirp=niam

Try it online!

The first line of each program prints the number.

For -1 string output is used to avoid parentheses.
Using $! (strict application) instead of a space allows the reversed line to be a valid definition of the operator !$ (just $ wouldn't do since the redefinition would break the use).

The middle line ensures that niam is defined for the last line.
The last line is a definition of an operator !$, which is not used but needs to parse and typecheck correctly.

PHP, 15 13 bytes
A PHP version without comment abuse. ohce is an undefined constant, so it will be equal to string value of its name. As a result, this will try to print +1-'ohce' or -1+'ohce' when reversed. Since 'ohce' is a non-numeric value, 0 will be used instead in the arithmetic operations and only 1 or -1 will be printed.
;echo+1-ohce;

Try it online!
Try it online!

That's clever. Nice!

Man, it's sad that I've arrived to the same answer as you, 3 hours late :( Have my upvote.

Japt, 2 bytes
Any single digit integer >0 can be used in place of the 2 as can A-G, H, I, J or L (10-16, 32, 64, -1 & 100, respectively).
n2

Test it | Reversed
The n method when applied to an integer, subtracts that integer from the argument passed to it, which defaults to 0. When run forwards, the n method is being run on the implicit first input, which also defaults to 0.
Alternatively, the g method could be used instead of n, which gives the sign of the result of subtracting its argument from the integer it's applied to.

Cubix, 7 6 5 bytes
@)O(@

Try it here
Reversed
Explanation
Cubified:
  @
) O ( @
  .

Unrolling the control flow, we execute )O(@, which increments, outputs, decrements, and exits.
Reversed and cubified:
  @
( O ) @
  .

Unrolling the control flow, we execute (O)@, which decrements, outputs, increments, and exits.
Previous version
@O(.)O@

Try it here
Reversed
Not as short, but aesthetically pleasing.

nice, way to put it on a size 1 cube!

@)O(@ for 5 bytes and restoration of symmetry :)

T-SQL, 16 bytes
--Forwards:
PRINT 4--4-TNIRP

--Backwards:
PRINT-4--4 TNIRP

Picked 4 because 1 is overused :)

If you are curious, an answer for MySQL would be select 1#1-tceles (17 bytes). You can check the result on http://sqlfiddle.com/#!9/9eecb/107825.

Jelly, 2 bytes
NC

Try it online!
Negative, results in 0, then Complement, results in 1-0 = 1.

CN

Try it online!
Complement, results in 1-0 = 1. Negative, results in -1.

K (ngn/k), 3 bytes
2-1

Try it online!
am i missing something? seems obvious for REPL languages

Hexagony, 5 bytes
1!@!(

Try it online!
Any valid program must:

Have a termination command (@ or :). The latter is only different for the former when there's a memory pointer movement command. Also this command must not be at the first or the last byte.
Have an output command. (!, ; is also possible but would probably take more bytes)
Have a memory manipulation command.

Therefore a 2-byte program is obviously impossible. A 3-byte program is impossible because the second byte must be the termination command, and the first byte must not be a mirror/IP manipulation command, therefore only 1 byte can be executed.
I think a 4-byte program is not possible. Such a program must have the form a@bc with hexagonal grid
 Forward:       | Backward:
                |
  c b           |   a @
 @ a .          |  b c .
  . .           |   . .

Therefore a must be a IP redirection command. However it's impossible to generate both positive and negative number with only 1 memory manipulation command.

+1 for proof of optimality in an otherwise trivial answer

Runic Enchantments, 4 bytes
1@Z1

Try it online! Try it Reversed!
I couldn't find a way to re-use the 1 command, even at the expense of a byte or two.
1@ɩ also works, but is the same number of bytes.

Why the input? The question said your program must take no input.

@TwilightSparkle I misread and already fixed it

Yeah, I see. Clever.

APL (Dyalog Unicode),  4  3 bytes
1-0

Try it online!
Trivial answer. Prints 1 when run and ¯1 when run reversed.

Zsh, 12 bytes
<<<2 # 2-<<<

Try it online!
Basic forward, comment, reverse method.

If I/O is less restrictive, then a more interesting 11 byte solution is possible thanks to Zsh supporting negative return codes:
return -127

Reversed, 721- nruter exits with code 127 (command not found). exit -127 cannot be used, it would be cast to a u8.
Try it online!

CJam, 3 bytes
W;1

Try it online!

Normal
Reversed

How they work
Normal version:
W    e# Push -1
;    e# Delete
1    e# Push 1
     e# Implicit display

Reverse version: you get the idea.

Perl 5 (-p), 12 bytes
\$--{}}{++$\

Try it online!
!enilno ti yrT
The }{ pseudo-operator really comes in handy.

Perl 5 (-M5.010), 9 bytes
Provided by Nahuel Fouilleul in a comment
say+1-yas

Try it online!
!enilno ti yrT

should be say 1#1-yas

@NahuelFouilleul yas indeed

9 bytes : say+1-yas and say-1+yas

MATL, 3 bytes
Nqv

Try it online!

Normal
Reversed

How they work
Normal:
N   % Push number of elements in the stack: 0
q   % Subtract 1: gives -1
v   % Concatenate stack contents vertically: leaves -1 as is
    % Implicit display stack contents

Reversed:
v   % Concatenate stack contents vertically: gives the empty array, []
q   % Subtract 1: leaves [] as is
N   % Push number of elements in the stack: 1
    % Implicit display. [] is not displayed

Wolfram Language (Mathematica), 21 18 bytes
Print@1;tnirP//1-0

Try it online!
-3 thanks to Martin Ender

Retina, 6 bytes
-`<
-

Prints 1.
Try it online!

-
<`-

Prints -1.
Try it online!
Explanation: 1
-`<
-

This... does nothing. Due to the `, this is a substitution from < to - (with configuration -, which does nothing), but the input is empty, so the output is empty as well.

And this second stage matches the empty regex against the empty input and counts the number of matches, which is exactly 1. Output is implicit.
Explanation: -1

-

This time we replace the empty regex with -. This does indeed turn the empty input into a single -.
<`-

Here, the configuration actually does something: < prints the stage's input before executing the stage, so we print the -. Then - counts the hyphens in the stage's input which is again 1. Due to the implicit output, this prints a 1 after the -, giving us -1 as required.

brainfuck, 156 bytes
+++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++++++++++++++++++++++++++++++++++++<+++++++++++++++++++++++++++++++++++++++++++++++++.++++++++++

Try it online! / Forward/backward verifier in Bash
Prints -1 forward and \n1 backwards.
Despite being almost trivial, I believe this is the optimal solution for this particular fixed output.
Proof:

The program cannot have [ or ].
Therefore the program must have the form <A> . <B> . <C>.
Each , can be replaced with a sufficient number of < without increasing the number of + or -.
Each + is only useful in either the forward or the backward program, never both.
Proof: + in part A is obviously only useful in the forward program, and + in part C is obviously only useful in the backward program.
Denote shift(P) = number of < in P - number of > in P. Consider program <B> = <D> + <E>, the + in the middle is useful in the forward program \$\iff\$ shift(E) = 0, similarly it's useful in the backward program \$\iff\$ shift(D) = 0. However if shift(D) = shift(E) = 0 then the program B executed either forward or backward would add a fixed value to the current cell before printing the second time, which can't be the case because ord('1') - ord('\n') != ord('1') - ord('-').

Therefore the program needs at least ord('-')+ord('1')+ord('\n')+ord('1') = 153 +s, 2 .s, and at least a < > or , because shift(B) != 0.

Google Sheets, 12
Fun problem!
Forward:
=1+N("(N+1-=

Backward:
=-1+N("(N+1=

Google sheets auto-closes quotes and parens. N(string) is always 0.

https://docs.google.com/spreadsheets/d/1iJ_ak7F0OucUrc55Nl5n3Y7Hpc1lyL-21ZV-VIZD5fM/edit?usp=sharing Cool answer!

Haskell, 28 bytes
main=print 1--)1-(tnirp=niam

Try it online!
Try it enilno!

Triangular, 4 bytes
i%%d

Try it online!
Outputs 1.
Ungolfed:
   i
  % %
 d

Reversed:
d%%i

Try it online!
Outputs -1.

Java 5 or 6, 127 67 bytes
enum A{A;{System.out.print(9);}}//}};)9-(tnirp.tuo.metsyS{;A{A mune

Outputs 9/-9.
No online compiler, because Java 5 or 6 isn't available anywhere.
You can however try this 127 bytes Java 8 equivalent:
Try it online or try it online reversed.
Explanation:
enum A{                              // Create an enum
 A;                                  //  With a mandatory value
 {                                   //  And in a separate instance code-block:
  System.out.print(9);}}             //   Print 9 to STDOUT
//}};)9-(tnirp.tuo.metsyS{;A{A mune  // Comment and thus a no-op

Java 5 and 6 had a bug allowing you to create a code block inside an enum to do something, despite missing a program's mandatory main-method. This will result in an error:

java.lang.NoSuchMethodError: main
Exception in thread "main"

But will still output what we'd want to STDOUT first, so we can ignore that.

JavaScript, 31 bytes
The obligatory comment abuse for JavaScript!
console.log(1)//)1-(gol.elosnoc

and reversed:
console.log(-1)//)1(gol.elosnoc

Golang, 109 bytes
package main;import "fmt";func main(){fmt.Println(1)}//})1(nltnirP.tmf{)(niam cnuf;"tmf" tropmi;niam egakcap

And its reverse:
package main;import "fmt";func main(){fmt.Println(-1)}//})1(nltnirP.tmf{)(niam cnuf;"tmf" tropmi;niam egakcap

Try it online!

I don't know Go, but it seems you can remove a few bytes. The Println can be Print, and the import "fmt"; doesn't need the space: import"fmt";. :)

\$\Large{\mathbf{\TeX} \left(\text{MathJax}\right)},~4\,\text{bytes}\$
1%1-

$$
\begin{array}{|r|c|c|}
\hline
 & \textbf{Code}
 %& \begin{array}{c}\boxed{\textbf{Boxed}} \\ \textbf{Result} \end{array}
 & \textbf{Result}
\\\hline
\textbf{Forward:} & \texttt{1%1-} &
  %\boxed{
1%1-
  %}
\\\hline
\textbf{Backward:} & \texttt{-1%1} &
  %\boxed{
-1%1
  %}
\\\hline
\end{array}
$$

Poetic, 153 bytes
mood o-o level a
was i redder?o,rats
lived on,lager:a trap!no reviver
ah hah ha
god deified on?now i strap on
redder was i?redder i saw,o
sleep o-on time

Try it online!
Prints 1.
Reversed
emit no-o peels
o,was i redder?i saw redder
no parts i won?no deified dog
ah hah ha
reviver on!part a:regal,no devil
star,o?redder i saw
a level o-o doom

!enilno ti yrT
Prints -1.

Wow! Point is, they are still words when reversed!

MarioLANG, 5 bytes
+
:
-

Try it online!
Reversed:
-
:
+

Try it online!

Stax, 2 bytes
U1

Run and debug it at staxlang.xyz!
!zyx.gnalxats ta ti gubed dan nuR
Push -1. Push 1. Implicitly print the top of the stack.

Turing Machine Language, 29 bytes
0 * - r 1
1 * 1 * 1
1 r _ * 0

And its reverse:
0 * _ r 1
1 * 1 * 1
1 r - * 0

Try it online!
Note: This will run in a continous loop both ways.
Explanation:
0 * - r 1     ; Prints a hyphen '-' then moves right along the tape.
1 * 1 * 1     ; Prints '1' and loops back in on itself.
1 r _ * 0     ; Never hits.

And its reverse:
0 * _ r 1     ; Prints a space then moves right along the tape.
1 * 1 * 1     ; Prints '1' and loops back in on itself.
1 r - * 0     ; Never hits.

><>, 7 bytes
A solution using the stack length. The regular and reversed programs share most of the code.
2l-n;<3

Try it online!
!enilno ti yrT

><>, 7 bytes
A more boring solution where the programs only share the ;.
1n;n-10

Try it online!
!enilno ti yrT

If we were allowed to use the fact that stdin is empty, this 5-byte variation of the second solution would be legal. Alas, it is not.
1n;ni

Try it online!
!enilno ti yrT

Forth (gforth), 10 8 bytes
1 . -1 0

Outputs: 1
Reverse:
0 1- . 1

Outputs: -1
Try it online!
Code Explanation
1     \ Place 1 on the stack
.     \ Output top of stack
-1 0  \ Place -1 and 0 on the stack but don't output them

Reverse:
0 1-  \ Place 0 on the stack and subtract 1
.     \ Output top of stack
1     \ Place 1 on stack, but don't output it

PHP, 10 bytes.
Not very special, but it's rare for PHP to be short :)
<?=1#1-=?<

I haven't tested this, but I suspect the last > should be <.

This doesn't work when reversed. And with > changed to < it won't work at all because of "unexpected end of file" error. It would need semicolons to work which will be same as the version already posted in this post: https://codegolf.stackexchange.com/a/192982/81663

International Phonetic Esoteric Language, 8 6 bytes (WIP language) (OLD)
No TIO interpreter yet, but is runnable by cloning the repository above, and calling python main.py "code here".
Forward, prints 1:
od12do

Backward, prints -1:
od21do

If instructions try to peek or pop at an empty stack, they are noped. In this case, instructions o, ɲ, and d turn into nops when the code is run, depending on where they are.
Forward:
oɲd12dɲo
o      ; nop
 d     ; nop
  1    ; push 1
   2   ; push 2
    d  ; pop, pop, push [2 - 1]
     o ; pop, print

Backward:
oɲd21dɲo
o      ; nop
 d     ; nop
  2    ; push 2
   1   ; push 1
    d  ; pop, pop, push [1 - 2]
     o ; pop, print

-2 bytes for not swapping the stack.

MAWP 0.1, 18 bytes
?.:M?%?00?;W590?.?

Displays 1.
Try it!
?.?095W;?00?%?M:.?

Displays '-' and then 1, which shows -1.
Try it!

Nice answer, +1. You are answering with MAWP 0.1 everywhere recently.

your link is broken

All MAWP links are broken since Dion rerouted the website. It was too much manual work, so I've left most of my answers as is. You can test this here: https://8dion8.github.io/MAWP

Arn, 3 bytes
Forward:
1-0

Backward:
0-1

Pretty simple, I'm looking for a more interesting answer now

Vyxal, 2 bytes
-1

Try it Online!

HBL, 1 byte
+<

Run forwards, outputs 4:
+   Increment
 <  Three

Run backwards, outputs -4:
<   Negate
 +  Four

Found while exploring different answers to Am I being run backwards?, which is a superset of this question.

One of the not-so-trivial answers to this trivial challenge!

Python 3, 18 bytes
print(1)#)1-(tnirp

Try it online!

Ruby, 8 7 bytes
p 1#0~p

Try it online!
Thanks Arnauld for chipping off 1 byte and making it less dull.

Charcoal, 5 bytes
ωＰ¹1←

Try it online! Outputs 1. Explanation:
ω   Print the empty string (does nothing)
Ｐ¹ Print a `-` without moving the cursor
1   Print a `1`
←   Move the cursor left (no effect on output)

Reversed:
←1¹Ｐω

Try it online! Outputs -1. Explanation:
←1  Print a `1` and move the cursor left
¹   Print a `-`
Ｐω  Print the empty string (does nothing)

Brachylog, 4 bytes
wṅ1?

Try it online!
Prints the positive output with a leading zero. The leading zero is actually just a zero that gets printed separately, but...
w       Print the input variable.
 ṅ      Something negated
  1     is 1,
   ?    which is the input variable.

!enilno ti yrT
?       The input variable is the input variable,
 1      which is 1.
   w    Print it
  ṅ     negated.

Stax, 5 bytes
1PsPU

Not going to win any awards, but this one is refreshingly straightforward. Depends on input being empty.

Vim, 6 keystrokes/bytes
<C-x><C-x><esc>1i1

Outputs 1. Try it online!
1i1<esc><C-x><C-x>

Outputs -1. Try it online!

Keg, 5 bytes
1#-10

Explanation:
1#    Push 1
 #-10 Comment

Reversed explanation:
01-#  Push -1
   #1 Comment

Befunge-93 (FBBI), 7 6 bytes
1-.@.1

-1 byte thanks to @squid.
Try it online!

GolfScript, 4 bytes
Simply abusing comments to remove a number.
1#1-

TIO
Reversed:
-1#1

TIO

Pip, 3 2 bytes
vo

o is a variable denoting 1, v is -1.
0-1 is another 3 byte solution, but since it was already made in Python, I decided to make this instead.
-1 byte from Dlosc.
Try it online!

You are learning Pip. Wow. Something I always wanted to learn but haven't time.

It is surprisingly easy.

The newline isn't necessary, so you can officially beat Python. ;)

I was initially using 1 and -1 instead of v and o. silly me.

Vyxal, 2 bytes
u1

Try it Online!
!enilnO ti yrT
1 pushes 1, u pushes -1. The last one pushed is automatically printed at the end of execution.

Fueue, 9 bytes
(H)!45 54

Outputs 6.
Try it online!
Reversed
45 54!)H(

Outputs -6.
!enilno ti yrT
Explanation
Fueue is a queue-based language where the program is stored in a queue. (The program queue is also the only way to store data.) From Esolang:

Evaluation proceeds as follows:

Look at the front element of the queue.
If it is a numeric value, convert it to a character and print.
If it is a function, and there are enough values of the appropriate type directly behind it in the queue, the function and those values are popped, and the result is pushed back to the end of the queue.
Otherwise, it is simply sent to the back of the queue.

(There is another bullet point on the Esolang page, but it is irrelevant for this answer.)
I take advantage of the fact that the decimal representation of the ASCII code for 6, which is 54, is the reverse of the ASCII code for -, which is 45.
In my explanations, I will be listing out the steps to evaluate each program, skipping a few obvious steps. The explanation to the right of a queue is how to get from the previous queue to the current queue, not how to get from the current queue to the next queue.
Normal

QUEUE
EXPLANATION

(   H   )   !   45  54
Starting code.

)   !   45  54  [H]
Put H in a block. (Note that the results of an operation are put at the end of the queue.)

!   45  54  [H] )
Can’t be executed, so moved to end of queue.

54  [H] )
Pop 45.

[H] )
Output "6".

)   [H]
Blocks can’t be executed normally.

H
Unblock [H].

Halt.

Reversed

QUEUE
EXPLANATION

45  54  !   )   H   (
Starting code.

!   )   H   (
Output "-6".

H   (
Pop ).

Halt.

convey, 8 7 bytes
-1 byte if writting it horizontaly and not verticaly, (you save one line feed)
Prints -1 and 1
1-0
[}[

Try it online! (old version)
[}[
0-1

Try it online! (old version)
I wonder if there is someway to work whit the direction of the conveyor when you reverse the code, i have been trying to do something like that but it changes also the output position } and the code doesn't compile :(

Another of the not-so-trivial answers to this trivial challenge!

Knight, 4 bytes
O1~O

Try It Online!
Try It Online reversed!

MathGolf, 3 bytes
d;3

Boring approach for now. Will see if a 2-byter is possible.
Outputs 3/-3. c;2 and b;1 are two alternatives for 2/-2 and 1/-1 respectively.
Try it online or try it online reversed.
Explanation:
d    # Push builtin -3
 ;   # Discard the top of the stack
  3  # Push 3
     # (output the entire stack joined together implicitly)

Why does MathGolf have a builtin for -3?

@TwilightSparkle I have absolutely no idea.. XD It has way too many 1-byte number builtins tbh.. The ones available are: -3 through and including 38; 60; 64; 100; 128; 256; 512; 1000; 1024; 2048; 3600; 4096; 10000; 86400; 100000; 1000000; 10000000; 100000000. As well as PI, 2*PI, golden ratio, [0], [1], etc.. All single-byte builtins.. In the mean time it's missing a simple 1-byte negate. ;)

Why not a built in for the Ultimate Answer(42), like AlephAlpha's esolang, Samau?

@TwilightSparkle Like I said, I have no idea why there are so many number builtins to begin with. ;) You should ask maxb who created the language.

C (clang), 39 bytes
main(){puts("1");}//};)"1-"(stup{)(niam

Try it online!
Corrected as @AdamBorkBork error spotting.

Darn! You beat me by... 4 hours.

Bash, 16 bytes
echo -1 # 1 ohce

Try it online!

Gaia, 4 bytes
2-”2

Try it online!
2-”	| push the string "2-"
   2	| push 2
	| implicit print TOS

2”	| push the string "2"
  -2	| push -2
	| implicit print TOS

Python REPL, 4 bytes
1-0

Only works in the Python REPL environment.
Shaved one byte based on suggestion from Ilmari Karonen.

Welcome to the site! As this only works in Python REPL, I've edited the language to reflect that.

Thanks, I appreciate that!

Wouldn't 1-0 be one byte shorter?

It would, yes. I'll update it.

Putt, 3 2 bytes
N1

NEGATE
PUSH 1
Prints implicitly

Reverse:
1N

PUSH 1
NEGATE
Prints implicitly

dc, 4 bytes
1p1_

prints 1
in reverse,
_1p1

prints -1

ink, 6 bytes
1//1-\

Try it online!
Reversed
\-1//1

Try it online!

Rattle, 5 bytes
+p;p-

Try it online!
This is pretty basic. Forwards, it will increment then print 1 (p- is an uncalled function). Reverse, it will decrement then print -1 (p+ is an uncalled function).

Pxem, filename: 6 bytes + content: 0 bytes = 6 bytes.

Filename: 1.p.1-
Content: empty

Try it online!
.p is until empty; do putchar pop; done. .1 is not a command; treated as a substring for literal.

M4, 10 bytes, with warning
1dnl lnd1-

Try it online!

M4, 16 bytes, clean output
1m4exit tixe4m1-

Try it online!

<>^v, 3 bytes
(;)

Prints -1.
Reversed:
);(

Prints 1.
Explanation
In <>^v, the stack is initialized to [0] (only one element, the number 0) at the start of every program. ( decrements the top of the stack, ; prints the top of the stack and ) increments the top of the stack. So (;) turns 0 into -1, then prints it, then turns it back into 0. Its reverse, );(, turns 0 into 1, prints it, then turns it back into 0.
Normal version ((;))
Reversed ();()


text:
Counting creatures on a hexagonal tiling
This challenge will have you count "creatures" in the tile game Palago.

A creature is any closed shape that can be formed by Palago tiles of matching colour in a hexagonal grid.

The game Palago consists of tiles like this:

These tiles can be rotated \$120^\circ\$, \$240^\circ\$, or not at all and placed anywhere on a hexagonal grid. For example, here is a (red) creature that requires 12 tiles.
Challenge
The goal of this challenge is to write a program that takes an integer n as an input and computes the number of creatures (up to rotation and reflection) that require n tiles. The program should be able to handle up to n=10 on TIO. This is code-golf, so fewest bytes wins.
Example data
The values should match the data found in the "Creature Counts and Estimates" section of the creator's website. Namely
 n | output
---+-------
 1 | 0
 2 | 0
 3 | 1
 4 | 0
 5 | 1
 6 | 1
 7 | 2
 8 | 2
 9 | 9
10 | 13
11 | 37
12 | 81

"The program should be able to handle up to n=10 on TIO." -- if that is an execution speed requirement, please use [tag:code-challenge] instead of [tag:code-golf], the latter referring to a pure byte optimization task.

Based on the discussion here, it looks like it's okay to have an execution speed requirement in a [tag:code-golf] question, as long as the scoring is number of bytes.

+1 Just like a spiral sequence, this challenge is easy to understand and really interesting to solve ... but requires quite a bit of code. :p

So.... we're just taking an input and returning the output from the list above, for n between 1 and 10? Can I just use a lookup table?

@BradC This is a default loophole. The OP just said that solutions should be able to handle up to $n=10$ on TIO.

JavaScript (Node.js), 480 417 bytes
-63 bytes thanks to @Arnauld. Wow.
n=>(E=(x,y,d,k,h)=>V[k=[x+=1-(d%=3),y+=~d%3+1,d]]?0:(V[k]=1,h=H.find(h=>h[0]==x&h[1]==y))?(d^(t=2-h[2])?E(x,y,t)||E(x,y,h[2]*2):E(x,y,t+2)):[x,y,0],I=c=>c.map(([x,y,t])=>[x-g(0),y-g(1),t],g=p=>Math.min(...c.map(h=>h[p]))).sort(),S=e=>(V={},e=E(0,0,0))?(--n&&H.pop(H.push(e),S(),S(e[2]=1),S(e[2]=2)),++n):n-1||E[I(c=H)]||[0,0,0,++N,0,0].map(r=>E[I(c=c.map(([x,y,t])=>[-x-y,r?y:x,(r?t*2:t+1)%3]))]=1))(H=[[N=0,0,1]])&&N

Try it online!
Firstly, repect to Arnauld whose answer gave me the inspiration to dig deeper.  I have tried hard to be original with my algorithms, although I intentionally changed some of my code to use the same variables as Arnauld so that the code could be more easily compared.
Searching for empty hexes
The search for creatures is:

Initialize list of tiles with tile 1 at 0,0
Recursively:

Search for an empty hex that is needed to complete creature
If empty hex found

Add each type of tile 0,1,2 to empty hex and recurse

If empty hex not found

If creature is of correct size and is not already in zoo

Increment number of distinct creatures found by one
Add all rotations and reflections of creature to zoo

The search for empty hexes uncovered an interesting symmetry.  Arnauld discovered that one of the six directions could be ignored, but in fact three out of six can be ignored!
Here is Arnauld's original direction and tile key:

Imagine we start at tile A of type 1 at the blue dot. It seems that we have to recurse out in d=0 and d=5.  However, whichever tile is placed in d=0, it will certainly have an exit in d=4, which will visit the same hex as exiting tile A in d=5.  That is Arnauld's discovery, and it's what started me thinking.
Notice that:

Every tile that has an exit in d=0 has an exit in d=5
Every tile that has an exit in d=2 has an exit in d=1
Every tile that has an exit in d=4 has an exit in d=3
Every tile that can be entered from d=0 has an exit in d=4
Every tile that can be entered from d=2 has an exit in d=0
Every tile that can be entered from d=4 has an exit in d=2

This means that we only need to consider directions 0,2,4.  Any exits in directions 1,3,5 can be
ignored because the hexes reachable in directions 1,3,5 can instead be reached from an adjacent hex
using directions 0,2 or 4.
How cool is that!?
Relabelled Directions
So I relabel the directions and tiles like this (Arnauld's image edited):

Now we have the following relationship between tiles, entries and exits:
    |  t=0  |  t=1  |  t=2
----+-------+-------+-------
d=0 |  0,2  |  1,2  |    2
d=1 |  0,2  |    0  |  0,1
d=2 |    1  |  1,2  |  0,1

So exits are: d+t==2 ? (4-t)%3 : 2-t and 2*t%3
Hexagonal Rotations and Reflections
For rotations and reflections, I decided to try x,y hexagonal axial coordinates instead of the x,y,z cube coordinates.
-1,2   0,2   1,2   2,2
    0,1   1,1   2,1
 0,0   1,0   2,0   3,0

In this system, the rotation and reflection were simpler than I expected:
120 Rotation:   x=-x-y   y=x   t=(t+1)%3
Reflection:     x=-x-y   y=y   t=(t*2)%3

To get all the combinations I performed : rot,rot,rot,reflect,rot,rot
Code (Original 480 byte)
f=n=>(
    // H:list of filled hexes [x,y,tile] during search for a complete creature
    // N:number of distinct creatures of size n
    // B:record of all orientations of all creatures already found
    H=[[0,0,1]],N=0,B={},

// E: find an empty hex required to complete creature starting in direction d from x,y
    E=(x,y,d,k,h)=>(
        x+=1-d,
        y+=1-(d+1)%3,
        // V: list of visited hexes during this search in E
        V[k=[x,y,d]] ?
            0
        : (V[k]=1, h=H.find(h=>h[0]==x&&h[1]==y)) ?
            // this hex is filled, so continue search in 1 or 2 directions
            (d==2-h[2] ? E(x,y,(4-h[2])%3) : (E(x,y,2-h[2]) || E(x,y,h[2]*2%3)))
        : [x,y,0] // return the empty hex
    ),

    // I: construct unique identifier for creature c by moving it so x>=0 and y>=0
    I=c=>(
        M=[0,1].map(p=>Math.min(...c.map(h=>h[p]))),
        c.map(([x,y,t])=>[x-M[0],y-M[1],t]).sort()
    ),

    // A: add complete creature c to B
    A=c=>{
        n==1&&!B[I(c)]&&(
            // creature is correct size and is not already in B
            N++,
            [0,0,0,1,0,0].map(
                // Add all rotations and reflections of creature into B
                // '0' marks a rotation, '1' marks a (vertical) reflection
                // rotation:   x=-x-y   y=x   t=(t+1)%3
                // reflection: x=-x-y   y=y   t=(t*2)%3
                r=>B[I(c=c.map(([x,y,t])=>[-x-y,r?y:x,(r?t*2:t+1)%3]))]=1)
        )
    },

    // S: recursively search for complete creatures starting with hexes H
    S=e=>{
        V={};
        (e=E(0,0,0)) ?
            // e is a required empty hex, so try filling it with tiles 0,1,2
            (--n && (H.push(e),S(),S(e[2]=1),S(e[2]=2),H.pop()), ++n)
        : A(H) // creature is complete, so add it to B
    },

    S(),
    N
)

Code (Arnauld 417 byte)
Arnauld kindly submitted a 63 byte saving that used tricks that took me quite some time to wrap my head around.  Since it has many interesting edits, I thought I'd put his code below (I've added my comments) so that it can be contrasted with my version.

f=n=>(
    // E:find an empty hex required to complete creature starting in direction d from x,y
    E=(x,y,d,k,h)=>
      V[k=[x+=1-(d%=3),y+=~d%3+1,d]] ?
        0
      :(V[k]=1,h=H.find(h=>h[0]==x&h[1]==y)) ?
        (d^(t=2-h[2]) ? E(x,y,t) || E(x,y,h[2]*2) : E(x,y,t+2))
      :[x,y,0],

    // I: construct unique identifier for creature c by moving it so x>=0 and y>=0
    I=c=>c.map(([x,y,t])=>[x-g(0),y-g(1),t],g=p=>Math.min(...c.map(h=>h[p]))).sort(),

    // S: recursively search for complete creatures starting with hexes H
    S=e=>
      (V={},e=E(0,0,0)) ?
        (--n&&H.pop(H.push(e),S(),S(e[2]=1),S(e[2]=2)),++n)
      :n-1
        ||E[I(c=H)]
        // creature is the correct size and has not been seen before
        // so record all rotations and reflections of creature in E[]
        ||[0,0,0,++N,0,0].map(r=>E[I(c=c.map(([x,y,t])=>[-x-y,r?y:x,(r?t*2:t+1)%3]))]=1)
)
// This wonderfully confusing syntax initializes globals and calls S()
(H=[[N=0,0,1]]) && N

Nice insight on the directions! And I think this can be golfed below the size of my answer.

417 bytes

@Arnauld That is awesome! I have a big work day ahead of me now, but look forward to checking this out tomorrow. Thanks.

JavaScript (Node.js),  578 ... 433  431 bytes
f=(n,T=[B=[N=0,0,0,1,1]])=>!n||T.some(([x,y,q,m])=>B.some((p,d)=>m>>d&1&&((p=x+~-s[d],q=y+~-s[d+2],t=T.find(([X,Y])=>X==p&Y==q))?(q=t[3])&(p=D[d*3+t[4]])^p?t[f(n,T,t[3]|=p),3]=q:0:[0,1,2].map(t=>f(n-1,[...T,[p,q,-p-q,D[d*3+t],t]])))),s="2100122",D=Buffer("160).(9!'8 &$<%"))|n>1||[0,1,2,1,2,0].some((_,d,A)=>B[k=T.map(a=>[(h=n=>Math.min(...T.map(R=a=>a[A[(d+n)%6]]))-R(a))(0),h(3),(x=(a[4]+d*2)%3,d>2)*x?3-x:x]).sort()])?N:B[k]=++N

Try it online! (\$n=1\$ to \$n=13\$)
How?
Directions and tiles
We use the following codes for the 6-direction compass and the tiles:

We assume that the creature is blue.
Connections
We need a table to know which parts of the creature need to be connected to other tiles when we enter a given tile in a given direction:
     |  T=0  |  T=1  |  T=2
-----+-------+-------+-------
 d=0 | 0,4,5 | 1,2,4 |   4
 d=1 | 0,3,5 | 1,2,3 |   3
 d=2 | 0,3,4 |   0   | 0,1,2
 d=3 | 3,4,5 |   5   | 1,2,5
 d=4 |   2   | 2,3,4 | 0,2,5
 d=5 |   1   | 1,3,4 | 0,1,5

Example:
If we enter a tile of type \$1\$ with direction \$5\$, we need to connect in directions \$1\$, \$3\$ and \$4\$:

But the way the tiles are designed, there can't possibly be a single missing connection in a single direction. A consequence of that is that we can ignore one direction entirely and still be able to detect if the path is closed or not. By convention, we are going to ignore direction \$5\$.
     |  T=0  |  T=1  |  T=2
-----+-------+-------+-------
 d=0 |  0,4  | 1,2,4 |   4
 d=1 |  0,3  | 1,2,3 |   3
 d=2 | 0,3,4 |   0   | 0,1,2
 d=3 |  3,4  |   -   |  1,2
 d=4 |   2   | 2,3,4 |  0,2

These updated sets of directions are first re-encoded as 5-bit integers, and then as ASCII characters with a fixed offset of \$+32\$:
     |  T=0  |  T=1  |  T=2              |  T=0  |  T=1  |  T=2
-----+-------+-------+-------       -----+-------+-------+-------
 d=0 |   17  |   22  |   16          d=0 |  "1"  |  "6"  |  "0"
 d=1 |    9  |   14  |    8          d=1 |  ")"  |  "."  |  "("
 d=2 |   25  |    1  |    7    -->   d=2 |  "9"  |  "!"  |  "'"
 d=3 |   24  |    0  |    6          d=3 |  "8"  |  " "  |  "&"
 d=4 |    4  |   28  |    5          d=4 |  "$"  |  "<"  |  "%"

Once flattened, this gives:
D = Buffer("160).(9!'8 &$<%")

Coordinates
To describe the positions of the tiles, we use cube coordinates with \$x+y+z=0\$:

Credits: www.redblobgames.com
It will make it easier to process rotations and reflections in the final step of the algorithm.
Tile encoding
The tiles are stored in a list, with no specific order. It means that we don't have to worry about some dynamic 2D allocation and we can easily iterate on the existing tiles. The downside is that, given specific coordinates, we need to find() the corresponding tile in the list.
Each tile is stored as \$(x, y, z, m, t)\$ where:

\$(x, y, z)\$ are the cube coordinates of the tile as described above
\$m\$ is the 5-bit mask of directions that need to be connected
\$t\$ is its type (\$0\$, \$1\$ or \$2\$)

Algorithm
We start with a single tile of type \$1\$ at \$(0,0,0)\$, with a required connection in direction \$0\$:

Therefore, this tile is encoded as [0,0,0,1,1].
At each iteration, we look for:

Tiles with missing connections: in this case, we successively try to complete the connection with each type of tile.
Tiles that are already connected but for which new connections need to be added because they have been reached in a different direction: in this case, we update the direction mask (with a bitwise OR) and force a new iteration.

If all connections are valid and we have reached the requested number of tiles, we still need to test whether it is a new creature or just a modified version of an existing one:

We apply the following transformations:

We perform the 3 possible rotations by replacing \$(x,y)\$ with \$(x,y)\$ (no rotation), \$(y,z)\$ (120°) or \$(z,x)\$ (240°), and updating the types of the tiles accordingly.
We perform the 3 corresponding reflections by replacing \$(x,y)\$ with \$(y,x)\$, \$(z,y)\$ or \$(x,z)\$, and updating the types of the tiles accordingly.

For each transformation, we translate all tiles such that the bottom-right corner is always located at \$(0,0)\$. (The signs of the coordinates are inverted in the process, which technically leads to another reflection, but this is harmless.)
We sort the tiles according to their coordinates and types. (This sort is processed in lexicographical order, which is fine.)
We finally coerce the resulting list to a key string which can be compared with the other keys.
We abort as soon as a known key is matched, or store the new key and increment the final result if none of the transformations lead to a known key.

Commented
f = (n, T = [B = [N = 0, 0, 0, 1, 1]]) =>
  // abort if n = 0
  !n ||
  // for each tile in T
  T.some(([x, y, q, m]) =>
    // for d = 0 to d = 4
    B.some((p, d) =>
      // if this tile requires a connection in this direction
      m >> d & 1 && (
        // look for a connected tile t at the corresponding position (p, q)
        (
          p = x + ~-s[d],
          q = y + ~-s[d + 2],
          t = T.find(([X, Y]) => X == p & Y == q)
        ) ?
          // if t exists, make sure that its direction mask is up-to-date
          (q = t[3]) & (p = D[d * 3 + t[4]]) ^ p ?
            // if it's not, update it and force a new iteration
            t[f(n, T, t[3] |= p), 3] = q
          :
            0
        :
          // if t does not exist, try each type of tile at this position
          [0, 1, 2].map(t => f(n - 1, [...T, [p, q, -p - q, D[d * 3 + t], t]]))
      )
    ),
    // s is used to apply (dx, dy)
    s = "2100122",
    // D holds the direction masks for the connections
    D = Buffer("160).(9!'8 &$<%")
  ) |
  // stop here if the above some() was truthy or we have more tiles to add
  n > 1 ||
  // otherwise, apply the transformations
  [0, 1, 2, 1, 2, 0].some((_, d, A) =>
    B[
      // compute the key k
      k =
        // by generating the updated tuples [x, y, type] and sorting them
        T.map(a =>
          [
            // transform the 1st coordinate
            (h = n => Math.min(...T.map(R = a => a[A[(d + n) % 6]])) - R(a))(0),
            // transform the 2nd coordinate
            h(3),
            // update the type
            (x = (a[4] + d * 2) % 3, d > 2) * x ? 3 - x : x
          ]
        ).sort()
    ]
  ) ?
    // if the key was found, just return N
    N
  :
    // if this is a new creature, store its key and increment N
    B[k] = ++N

Love this answer. Got me all fired up to give it a shot over the weekend!

I am just about to post an answer that I hope you find interesting.  Would it be ok for me to use one of your images to help my explanation?  I will credit you of course.

@JohnRees Sure, no problem.