text:
How close are we, really?
Please note: this is a restricted-source challenge — see details below!
Each natural number \$n\$ has 10 faces: its decimal representations in bases \$1\$ through to \$10\$. For example, the 10 faces of \$12\$ are \$[111111111111, 1100, 110, 30, 22, 20, 15, 14, 13, 12]\$, and the 10 faces of \$4\$ are \$[1111, 100, 11, 10, 4, 4, 4, 4, 4, 4]\$
We can then say that two numbers face each other \$n\$ times if they share \$n\$ faces, counting duplicate faces repeatedly. For instance \$12\$ and \$4\$ do not share a face as no number is in both of their list of faces, whereas \$6\$ and \$11\$ do:

\$\text{faces}(6) = [111111, 110, 20, 12, 11, 10, 6, 6, 6, 6]\$
\$\text{faces}(11) = [11111111111, 1011, 102, 23, 21, 15, 14, 13, 12, 11]\$

Both \$11\$ and \$12\$ are in both lists, so \$6\$ and \$11\$ share 2 faces, and so face each other twice.
Finally, we will say that any pair of numbers has a closeness, which is defined as the number of times the two numbers face each other. So far we already have:

\$\text{closeness}(12, 4) = 0\$
\$\text{closeness}(6, 11) = 2\$

Notice that \$\text{closeness}(1, 1)\$ is \$100\$ because all 100 possible pairs of \$1\$'s faces are equal i.e. duplicate faces count multiple times.
Your task is, given two natural numbers \$a\$ and \$b\$, output \$\text{closeness}(a, b)\$. You may take input and output in any convenient method or format.
However, your program must only consist of pairs of characters that face each other. In order to determine if a pair of characters face each other, take their code points \$(m, n)\$ in whatever code page you are using to score your program, then, if \$\text{closeness}(m, n) \ne 0\$, then that pair of characters faces each other and can be in your program. This applies to all overlapping pairs in your program. So if your code is abcd, then ab, bc and cd must all be pairs that face each other.
You may use any pre-existing code page to score your answer, but it must have existed before this challenge was posted.
For instance, none of the pairs of letters in print (pr, ri, in and nt) face each other, so your code cannot contain any of those pairs of characters. However, all the pairs in (p b> ((p, p ,  b and b>) do face each other, so your code may contain them. Here is a newline-separated list of printable ASCII pairs that face each other for reference, this (Thanks to @Kevin Cruijssen) is a list of all pairs of integers between \$0\$ and \$255\$ which face each other, and this is a Jelly program which verifies that a given string complies with the rules, according to Unicode encoding. It does take 10-15 seconds to run, so be patient with it.
This is code-golf, so the shortest code in bytes wins
Test cases
a, b => closeness(a, b)
24, 35 => 1
10, 15 => 0
50, 11 => 0
18, 12 => 3
16, 15 => 2
 1,  1 => 100
12, 10 => 5
30, 18 => 2
 6,  6 => 22
20,  4 => 0
 3, 35 => 0
23,  3 => 0

Here is a list of \$\text{closeness}(a, b)\$ for all pairs \$\{(a, b) \:|\: 1 \le a \le 50, 1 \le b \le 50\}\$, where the \$n\$-th element of the \$m\$-th row is the result for \$\text{closeness}(m, n)\$:
[100, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 66, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 2, 52, 2, 2, 2, 3, 2, 2, 2, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]
[0, 2, 2, 40, 2, 2, 2, 2, 3, 2, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0]
[0, 2, 2, 2, 30, 3, 3, 3, 3, 4, 2, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 0, 0, 2, 0, 1, 0, 1, 0, 0, 2, 1, 0, 0, 0, 10, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 10, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 10, 0, 0]
[0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 10, 0]
[0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 2, 0, 2, 0, 0, 2, 0, 0, 0, 1, 2, 0, 0, 0, 0, 10]

Deleted Sandbox post. Also, I'd appreciate any and all feedback, including any explanations behind any downvotes, if you'd like to voice your concerns. After all, I can only improve.

Jelly, 37 27 bytes
b ȷ2½RJÞ©¤µ€$ p /Aµ~E)UCCTL

Try it online!
A monadic link that takes a pair of integers as its argument and returns the closeness as an integer. When run as a full program implicitly prints the result.
Note encoding is using the Jelly codepage (available at Jelly); byte count and neighbouring pair closeness both reflect this.
This TIO link has a footer that breaks the program itself into overlapping pairs, converts each to the codepoints in the Jelly code page and then calls the code itself on each pair. The code section actually isn’t used; it actually evaluates the copy of the code seen in the argument.
A (possibly) minimal implementation of the closeness algorithm without the code restriction would be 9 bytes bⱮ€⁵ŒpE€S, so there’s effectively a 18 byte cost to ensuring all pairs are close.
Test using version of OP’s link
Verification of closeness of every pair between 1 and 30 using the data from the question (will print 1 if all match).
Explanation
Code explained below. I’ve omitted the spaces since they are ignored here. I’ve indicated steps that are only there because of the code restriction in square brackets. Note many of these aren’t no-ops, but they do not change the final result.
           $              | [Following as a monad]
         µ€               | - For each integer in input:
b       ¤                 | - Convert to each of the following bases:
 ȷ2                       |   - 100
   ½                      |   - Square root
    R                     |   - Range
     JÞ©                  |   [- Sort by sequence along each list]
            p/            | Reduce using Cartesian product
              A           | [Absolute]
               µ          | Start a new monadic chain
                  )       | For each sublist:
                ~         | [- Bitwise not]
                 E        | - Check whether equal
                   U      | [Reverse]
                    C     | [1 minus this]
                     C    | [1 minus this]
                      T   | Convert to list of indices for each positive entry
                       L  | Length

Finally, here’s a handy TIO link to generate the pairs of integers 0-255 as well as characters in any codepage. The link as provided will give the pairs for Jelly, but you can change the argument for any other code page provided the characters exist in Unicode. They should be provided as a single string from 0 to 255. Example for 05AB1E, without the preceding integer bit (just characters).

Still getting zero for the output of the OP's code face tester. Just testing I've got the right paste, "b :.CU¶U )$ñþ⁵+938ZAµ$ p /Aµ~E)U=1+0BS". Looks right.

@ouflak are you using the Jelly codepage?

shrug I'm just dropping it into the OP's link.

@ouflak That link of OP uses Unicode codepoints instead of the Jelly codepage.

@KevinCruijssen, Ok, cool.

Together we got a 26 :)

05AB1E, 59 52 51 43 bytes
εηθA~TLTBB™ÿćV9yΓиΓdJRzzªh}¯``ðð~V¢ 2
D//wO

Ok, that took a while.. Did it by trial-and-error, but I have the feeling that creating a brute-force program would have been more time-efficient now that I'm finally done.. But, it works!
-9 bytes thanks to @Grimy.
Uses the 05AB1E encoding; the characters map to these 0..255 values.
Try it online or verify all test cases or verify the program itself.
Explanation:
The base program I started with was 12 bytes, which was either εTLBćy×š}`¢O or vyTLBćy×š}¢O.
Here an explanation of the first base program (second is similar, but with a loop instead of map):
ε         # Map both values in the (implicit) input-pair to:
 TL       #  Push a list in the range [1,10]
   B      #  Convert the current value to each of these [1,10] bases
    ć     #  Extract head; pop and push remainder-list and first item separated to the stack
     y    #  Push the current value again
      ×   #  Repeat the "1" that many times
       š  #  And prepend it back to the list
}`        # After the map: push both lists separated to the stack
  ¢       # Count for each value in the second list how many times it occurs in the first list
   O      # And sum those counts together
          # (after which the result is output implicitly)

Note that the ćy×š is to fix the base-1 conversions, since in 05AB1E any number converted to base-1 would result in a single 1 instead of \$n\$ consecutive 1s.
That was the easy part.. I then had to add no-ops to comply to the challenge rules.. I've first created a list of all unique pairs of the 0..255 values (since the one in the challenge description is incorrect I noticed..). And then used this helper program I created to get all characters in the 05AB1E encoding facing the character I've input in the header (you may want to collapse the Input section on TIO in this helper program).
As for the resulting program and how I (and @Grimy) have made the no-ops:
ε           # Map both numbers in the (implicit) input-pair to:
 η          #  Pop and push a list of prefixes of the number
 θ          #  Pop and push the last prefix (the number itself)
 A          #  Push the lowercase alphabet "abcdefghijklmnopqrstuvwxyz"
 ~          #  Bitwise-OR the number and alphabet (results in the number)
  T         #  Push 10
   L        #  Pop and push a list in the range [1,10]
    TB      #  Convert each to base-10 (they'll remain the same)
    B       #  Convert the current value to each of these [1,10] bases
      ™     #  Titlecase each number (does nothing on integers)
      ÿ     #  String interpolation (does nothing outside of a string)
      ć     #  Extract head; pop and push the remainder-list and first item separated to the stack
       V    #  Pop this 1, and save it in variable `Y`
       9    #  Push 9
       y    #  Push the current value
        Γ   #  Actual no-op; this character is unbound as any builtin
        и   #  Repeat the 9 the value amount of times as list
            #  (alternative for the `×`, since the builtins facing `×` were useless;
            #   this does mean I need an additional join `J` though)
         Γ  #  Actual unbound no-op again
         d  #  Check for each 9 if its non-negative; which is truthy, so they'll become 1s
         J  #  Join the list of 1s together to a string
          R #  Reverse this string of 1s (no change)
          z #  Take 1 divided by this number
          z #  And do it again so we're back at this number again
          ª #  Append it back to the list
          h #  Transform all values to hexadecimal (since we only care about equality,
            #  it doesn't matter the numbers are now hexadecimal strings
            #  - except for a weird bug where the string `"3E#"` equals `3`..)
}           # Close the map
 ¯          # Push the global array (empty by default)
 `          # Push its content (nothing) to the stack
 `          # Push the inner lists we just mapped separated to the stack
  ðð        # Push two space characters
  ~         # Bitwise-OR between the two space characters
  V         # Pop and store it in variable `Y`
  ¢         # Count for each value in the second list how many times it occurs in the first list
     2      # Push a 2
    \nD     # Duplicate this 2
    //      # Divide the 2 by 2, and then each count by 1 (so they remain the same)
    w       # Another unbound no-op
       O    # And sum all counts together
            # (after which the result is output implicitly)

I'm glad you got it working, I gave up less than halfway in (: I think Z½ÿ™´ can be ηθA~ for -1. I'll look for other improvements.

7NVV can be V9.

A big one: ¤4 \\šXX*/D can be Rzzªh.

@Grimmy Thanks for the ηθA~, but I'm afraid the other two are incorrect. The V in V9 will pop the extracted 1 and push a 9 instead. This would fail with for example [2, 11] As for the Rzzªh, the first four bytes are smart, but the h unfortunately transforms the integers above 9 incorrectly to hexadecimal. This would fail with for example [3, 9].

@Grimmy There also seems to be a bug in the counter builtin in general I now notice.. legacy vs rewrite.. :S It seems to only look at the first character instead of the entire string.. But unrelated to the problem of the h in your proposal, though.

Converting to hexadecimal shouldn’t be an issue since it’s bijective and we only care about equality, not about the values themselves. The discrepancy is only due to an ugly 05AB1E bug: 3E9 is incorrectly considered equal to 3. This isn’t specific to ¢.

Your first link doesn’t match the actual code in the answer. Your answer uses иdJ, not ×. This is why V9 works.

@Grimmy Ah, didn't thought about how the d transforms the 9s to 1s again when testing your golfing suggestions. That makes sense. And that bug is weird.. Might have something to do with e numbers like 1e9, but it's still very weird that the string 3E9/3e9 equals 3, since 3e9 is 3 billion.

Wtf haha, I just realized I have typed Grimy in all my answers instead of Grimmy.. Woops..  How did I not notice this before.. Sorry 'bout that.

Not your fault, I changed from Grimy to Grimmy a few weeks ago. (It was always meant to be pronounced with a short i, so I changed the spelling to reflect that.)

@Grimmy Ah ok, that explains it. I thought I was going partially blind for a moment, haha. I will try to mention Grimmy from now on in that case.

Japt, 60 bytes
Ë5A $$ óKS{3N=DVNìN=KDV)q-2
DU=CgM=U)UxPÈ4C=Mg493)UCè¶r4 $$P

Try it
I used this program to find facing pairs. This program is Japt-specific, as it filters out characters Japt doesn't use. To use, enter any characters in the input section, and it will find all valid Japt characters that face them. To include control characters in the input, input 《number》 into the input section. To include control characters in the list of facing characters, prepend 。 before the character, like 。#.
This challenge is made much more difficult by the fact that there are many characters in the ISO-8859-1 codepage (Japt's default) that are unused in Japt, and cause syntax errors if they are not part of a string. Additionally, since calls to functions must be closed with  , ), or ¹, many functions are off limits. The code only contains calls to 8 functions total.
Here is the equivalent Javascript code:
U = U.m(function(D, E, F) { return (D, 5, A ).ó(function(K, S) { return (3, N = D, V, N.ì(N = K, D, V)).q("-", 2) }) });
(D, U = C.g(M = U)), U.x(function(P, X, Y, Z) { return (X, 4, C = M.g(493)), U, C.è("===".r(4), P) })

As you can see, there are many assignments made to different variables, because very few variables face a function. The Cartesian product function (ï) is locked, since every character ï faces is an unprintable that results in a syntax error in Japt.
A thing to note is that when values are chained together not like DU or 5A, only the value at the end is used, but only if the values are not arguments to a function. The values before are essentially no-ops.
Ë5A $$ óKS{3N=DVNìN=KDV)q-2
Ë                                //Map each variable D in the input
 5A                              //A is the variable for 10
  \t$$                           //Tab (a no-op) followed by $$, followed by a single space
                                 //Everything between 2 dollar signs is
                                 //injected into the transpiled JavaScript
                                 //literally. In this case, we inject nothing
                                 //Space is not a no-op in Japt, it acts like parentheses
      ó                          //Range, 0-9
                                 //Map each in the range through the following function
       KS{                       //An "old-style" function, taking in parameters K and S
                                 //K = current #, S = index (ignored)
                                 //Obsolete nowadays, replaced by '@','_','È',and 'Ï'
           3N=D                  //Assign N to D
               V                 //No-op variable
                NìN=KDV          //Convert N to base K array, the last two variables are
                                 //ignored in the function call. Luckily, if 0
                                 //is passed as the base, it returns base-10 digits
                                 //Though 's' is much more handy as it returns a string,
                                 //It only accepts bases 2-36
                         )q-2    //Join the base-K array with '-' (2 is a no-op)
                                 //Newline - assign the result of the previous to U
DU=CgM=U)UxPÈ4C=Mg493)UCè¶r4 $$P
   C                             //12
    g                            //Index into (wrapping)
     M=U)                        //U, essentially getting first element, also assign U to M
DU=                              //Assign that to U

         Ux                      //Map everything in U to the following function, then sum
           PÈ                    //Function w/ parameters 'P','X','Y','Z'
             4C=Mg493)           //Assign C to M[1] (indices are wrapping)
                         ¶r4     //Replace all "4" strings in "===" with ""
                      UCè    $$P //No. of elements in C that "===" (equals) P

Jelly, 27 bytes
5+5ɓz2z2b ð€Z<Ƈp /*6EE¹?ƇTL

A full program accepting a pair of integers which prints the closeness integer.
Try it online!
Or see the 50 by 50 grid (takes ~30s when not cached)
For verification, the bytes used (in hexadecimal) are:
35 2B 35 9B 7A 32 7A 32 62 20 18 0C 5A 3C 90 70 20 2F 2A 36 45 45 81 3F 90 54 4C

...which, as a list of integers, is:
[53, 43, 53, 155, 122, 50, 122, 50, 98, 32, 24, 12, 90, 60, 144, 112, 32, 47, 42, 54, 69, 69, 129, 63, 144, 84, 76]

How?
5+5ɓz2z2b ð€Z<Ƈp /*6EE¹?ƇTL - Main Link: list of (two) integers, [a, b]
5+5                         - five plus five -> ten
   ɓ      ð€                - for €ach n in [1..10] do f([a, b], n):
    z2                      -   transpose [a, b] with filler two -> [[a,b]]
      z2                    -   transpose that with filler two -> [[a],[b]]
        b                   -   convert that to base n (vectorises) [[[xs]],[[ys]]]
            Z               - transpose -> [[[xs],[ys]]]
              Ƈ             - filter keep if:
             <              -   less than [a, b] (always true so filter is a no-op)
                 /          - reduce by:
               p            -   Cartesian product (get all pairs of wrapped representations)
                  *6        - raise to the sixth power (vectorises)
                        Ƈ   - filter keep those for which:
                       ?    -   if...
                      ¹     -   ...condition: identity
                    E       -   ...then: all equal?
                     E      -   ...else: all equal?
                         T  - truthy indexes
                          L - length

Combining the start of Nick Kennedy's and the end of mine gives us a joint 26 byte answer!:
b ȷ2½RJÞ©¤µ€$ p /*6EE¹?ƇTL

Try it online!

I put your code into the checker, and it returned '0'. I just don't know if that is good or bad.

@ouflak that is a bad thing - I didn't realise this was a source layout problem!!


text:
Circular robot instructions
This challenge is based on Project Euler problem 208. Also related to my Math Stack Exchange question, Non-self-intersecting "Robot Walks".
You have a robot that moves in arcs which are \$1/n\$ of a circle, with each step turning toward the left or to the right. The robot takes in an array of instructions of the form \$(a_1, a_2, \dots, a_{2m})\$ with \$a_k \in \mathbb N_0\$. The robot follows these instructions by taking \$a_1\$ steps to the right, followed by \$a_2\$ steps to the left, followed by \$a_3\$ steps to the right, continuing in this alternating fashion until completing the final instruction by taking \$a_{2m}\$ steps to the left. If the robot is in the same position (and same orientation) that it began in, then it terminates, otherwise, it starts the sequence of moves over.

The goal of this challenge is to write a program that takes in an integer \$n \geq 2\$ and a list of instructions \$(a_1, a_2, \dots, a_{2m})\$ and computes how many self-intersections the robot's path contains.

Example
For example, with \$n = 5\$, these are the following walks for
[1,2],
[1,3],
[1,4],
[2,3],
[2,4], and
[3,4]
respectively:

The number of intersections are 0, 5, 10, 0, 5, and 0 respectively.
Play
Want to try it out for yourself? You can use the left/right arrow keys on your computer via this web app forked from Github user cemulate. Change the step size by modifying the n=6 parameter in the URL.
Change the initial walk by modifying the w=5,3 parameter in the URL, or remove the initial walk by removing the &w=5,3 parameter altogether.

Test data
  n | instructions  | output
----+---------------+--------
  3 | [3,0]         | 0
  3 | [3,1]         | 3
  3 | [3,3]         | 1
  3 | [3,2,3,1]     | 2
  6 | [1,1]         | 0
  6 | [5,1]         | 3
  6 | [5,2]         | 1
  6 | [5,3]         | 3
  6 | [5,4]         | 6
  6 | [1,1,1,5]     | 3
  6 | [1,2,3,4]     | 0
  6 | [1,2,3,4,5,6] | 8
  7 | [2,3,1,3,1,1] | 14
  7 | [3,1,4,1]     | 56
 19 | [1,2]         | 0

Note: You can assume that the instructions will not cause the robot to retrace it's track (as in \$n = 6\$ and [1,4,2,3] or \$n = 7\$ and [2,3,1,3].) That is, the robot may intersect its path tangentially or transverally, but it will not retrace a step. You can also assume that there will be a finite number of intersections (e.g., [5,5] will never be an instruction for \$n = 6\$).

Challenge
Your program must take two parameters

A positive integer, n, the reciprocal of which gives the step size, and
An even-length array of nonnegative integers, a, the instruction for the robot.

Your program must output a single integer, which counts the number of times that the robot intersects its path, tangentially (as in \$n=6\$ with [5,3]) or transverally (as in \$n=5\$ with [1,3]).
This is a code-golf challenge, so the shortest code wins.

@Arnauld, thanks for the comment. I mentioned this briefly at the end of the "test data" section, but I added it to the "challenge" section now too. Please suggest more clarifying edits if you see anything unclear.

If the robot goes over the same point 3 or more times, how do we count that for self-intersections?

@xnor, do you have an example?

@PeterKagey Nope, I haven't checked whether it's possible.

I've realized that this challenge is equivalent to counting self-intersections in an arbitrary, closed robot walk. If there are tweaks that I can make to the rules to make this challenge more tractable without changing the spirit of the problem, please let me know.

I think in general counting intersection exactly (i.e. if you don't want people to rely on approximate solutions) is hard - I'm pretty convinced there are paths for some n that let two paths come arbitrarily close.

On the "retraces steps" problem, [1,2,3,4,5,6] does interesting things.

Shouldn't test cases like 6 [1,1] and 6 [5,5] be excluded as infinite or these are to be handled by the program? Btw, does 6 [5,5] really gives 0 intersections? There will be infinity tangent intersections, IMHO.

@AlexeyBurdin, you're correct that 6 [5,5] has an infinite number of intersections—it was incorrect in the test data, and I've removed it. However, although 6 [1,1] is infinite, it has no intersections, so I think it's valid input. (In particular, if the instructions result in an infinite walk, this means that the walk has no intersections because infinite-intersection instructions are illegal inputs.)

@flawr, you're right that when $n \neq 2, 3, 4$ or $6$, paths can come arbitrarily close.

In the case 4 [2, 4], is the answer 2? Before making the last full circle it kind of touches the starting point.

@justhalf, that's right. Its path looks like three circles "ooo", so there are two places where the path self-intersects.

Python 3.8 (pre-release), 1533 bytes
def w(n,ll,ans):
	global p,q
	from math import sin,cos,pi,atan2
	def y(s,e,f,a,b):
		x,y=f(s),f(e)
		g=lambda a,b,x:0<=(x-a)%2<=b-a
		while e-s>1e-15:
			m=(s+e)/2
			z=f(m)
			if x*z<=0:
				e,y=m,z
			else:
				s,x=m,z
		return (g(a,b,s)or g(a,b,e))and[s]or[]
	from fractions import Fraction as R
	s,v,d=(0,0,R(1,2)),[],1
	while True:
		for l in ll:
			b=s[2]+R(1,2)*d
			c=s+(R(2,n)*l,d,(s[0]-cos(b*pi),s[1]-sin(b*pi)),b,b-R(2,n)*l*d)
			if l:
				v.append(c)
				s=(c[5][0]+cos(c[7]*pi),c[5][1]+sin(c[7]*pi),(c[7]-R(1,2)*d)%R(2))
			d=-d
		if s[2]==R(1,2):
			break
	e,l=enumerate,len(v)
	q=lambda x:all(abs(i)<1e-7 for i in x)
	p=[]
	h=lambda i,p:any(all(q([j-k]) for j,k in zip(i,a))for a in p)
	def z(u):
		global p,q
		for i in u:
			if not h(i,p):
				p.append(i)
	if all(abs(i)<1e-6 for i in s[:2])and l>1:
		[z([c[:2]]) for c in v if c[3]==R(2)]
		x_=[t_ for n,c in e(v) for m,d in e(v) if (n-m)%l not in [0,1,l-1] and len(t_:=[(f,t) for f,g in [(c,d),(d,c)]if not q(x:=[f[5][i]-g[5][i]for i in[0,1]])and (a:=x[0])**2+(b:=x[1])**2<=4+1e-14 and(t:=sum((y((r:=[1,-1][b<0]*2/pi*atan2((1-(u:=a/(a*a+b*b)**.5)*u)**.5,u-1))-i,r+j,lambda t:(a+cos(pi*t))**2+(b+sin(pi*t))**2-1,*sorted(f[6:]))for i,j in[(1,0),(0,1)]),[]))])==2]
		[z([i for i in x[1] if h(i,x[0])])for x in[[[(f[5][0]+cos(i*pi),f[5][1]+sin(i*pi))for i in t]for f,t in t_]for t_ in x_]]
		print(len(p),sep='',end='')
		if len(p)!=ans:
			print(min((abs(i[0]-j[0])+abs(i[1]-j[1]),n,m) for n,i in e(p) for m,j in e(p) if n!=m))
		else:
			print('')
	else:
		print(0)

Try it online!
Python 2 (PyPy), 1580 bytes
n,ll=map(eval,input().split(' '))
from math import sin,cos,pi,atan2
#and let's implement the bisection
def y(s,e,f,a,b):#solve f=0 within (s,e) if x in (a,b)
    x,y=f(s),f(e)
    g=lambda a,b,x:0<=(x-a)%2<=b-a
    while e-s>1e-15:# or g(a,b,s)!=g(a,b,e):
        m=(s+e)/2
        z=f(m)
        if x*z<=0:
            e,y=m,z
        else:
            s,x=m,z
    c,d=g(a,b,s),g(a,b,e)
    #c,d
    #True,True [s]
    #True,False [s]
    #False,True [s]
    #False,False []
    return (c or d)and[s]or[]
from fractions import Fraction as R
#the start point
s=(0,0,R(1,2))
#now let's compute the arcs
#we need to store x0,y0,angle,length,direction,center,start angle,end angle
#arcs array
v=[]
d=1#the direction, 1 for clockwize
while True:
    for l in ll:
        b=s[2]+R(1,2)*d#start angle
        c=s+(R(2,n)*l,d,(s[0]-cos(b*pi),s[1]-sin(b*pi)),b,b-R(2,n)*l*d)#the arc
        if l:
            v.append(c)
            s=(c[5][0]+cos(c[7]*pi),c[5][1]+sin(c[7]*pi),(c[7]-R(1,2)*d)%R(2))
        d=-d
    if s[2]==R(1,2):
        break
e,l=enumerate,len(v)
q=lambda x:abs(x)<1e-7
p=[]#array of intersection points
#like in array
h=lambda i,p:any(all(q(j-k) for j,k in zip(i,a))for a in p)
def z(u):#add points if not in array
    global p,q
    #print(p,u)
    for i in u:
        if not h(i,p):
            p.append(i)
if all(abs(i)<1e-6 for i in s[:2])and l>1:
    #returned to the same point
    for n,c in e(v):
        if c[3]==R(2):z([c[:2]])
        for m,d in e(v):
            if (n-m)%l not in [0,1,l-1]:
                #compute the intersection
                x=[]
                for f,g in [(c,d),(d,c)]:
                    a,b=[f[5][i]-g[5][i]for i in[0,1]]
                    if q(a)and q(b):
                        break
                    if a*a+b*b>4+1e-14:
                        break
                    u=a/(a*a+b*b)**.5
                    #the angle from a to b
                    r=[1,-1][b<0]*2/pi*atan2((1-u*u)**.5,u-1)
                    t=sum(
                    (y(r-i,r+j,lambda t:(a+cos(pi*t))**2+(b+sin(pi*t))**2-1,\
                        *sorted(f[6:]))for i,j in[(1,0),(0,1)]),[])
                    #that's it
                    if not t:
                        break
                    x.append([(f[5][0]+cos(i*pi),f[5][1]+sin(i*pi))for i in t])
                else:
                    #intersection points
                    z([i for i in x[1] if h(i,x[0])])
    print(len(p))
else:
    #infinite, return 0
    print(0)

Try it online!
Runs in all test cases.
Python 3.8 + sympy, ungolfed,
covering almost all test cases (except 7 and 19 -- sympy can't simplify some expressions)
at least to know what you have to bear.
Major improvement in comparison with previous version is that:

It simply holds array of intersection points,
Any arc end counts as intersection if arc length \$=2\pi\$ unless arc array length is \$1\$
Still need to be rewritten into precise \$i^{\frac{2\pi}{n}}\$ arithmetic

from sympy import *
R=Rational
angle=R(0)
class Arc:
    def __init__(self,x0,y0,angle,length,direction):
        #','.join('self.%s'%i for i in 'x0,y0,angle,length'.split(','))
        (self.x0,
         self.y0,
         self.angle,
         self.length,
         self.dir)=x0,y0,angle,length,direction
        self.start=(angle+pi/R(2)*direction)#%(R(2)*pi)
        self.end_=self.start-self.length*self.dir
        self.center=(x0-cos(self.start),y0-sin(self.start))
    def i(self,a0):
        #t=symbols('t')
        #param_form=(self.center[0]+cos(self.start+t),
        #            self.center[1]+sin(self.start+t))
        #z=solveset((a.center[0]-param_form[0])**2+
        #           (a.center[1]-param_form[1])**2-1,t)
        #return z
        #to (a + cos(t))^2 + (b + sin(t))^2 = 1
        a,b=[self.center[i]-a0.center[i] for i in [0,1]]
        try:
            d={frozenset([-cos(3*pi/7) - sin(pi/14), -2*sin(3*pi/7)]):False,
               frozenset([cos(3*pi/7) + sin(pi/14), 2*sin(3*pi/7)]):False}
            if (frozenset([a,b]) in d and d[frozenset([a,b])]) or \
               (frozenset([a,b]) not in d and a**R(2)+b**R(2)>R(4)):
                return set()
            if a**R(2)+b**R(2)==R(4):
                #https://www.wolframalpha.com/input/?i=%28a%2Bcos%28t%29%29%5E2%2B%28b%2Bsin%28t%29%29%5E2%3D1+and+a%5E2%2Bb%5E2%3D4
                #s=R(-1,2)*sqrt(R(4)-a**R(2))
                #c=R(-1,2)*a
                if (a==R(2)):
                    return set([pi])
                return set([(R(-1) if b<R(0) else R(1))*R(2)*\
                            atan2(sqrt(R(4)-a**R(2)),a-R(2))])
        except Exception:
            print((a,b))
            raise
        #https://www.wolframalpha.com/input/?i=%28a%2Bcos%28t%29%29%5E2%2B%28b%2Bsin%28t%29%29%5E2%3D1
        if a!=R(0) and a!=R(2) and ((z0:=b**R(2)+a**R(2)-R(2)*a)==0 or\
           abs(float(z0))<1e-6):
            s=R(2)*(R(-1) if b<R(0) else R(1))*atan2(sqrt(-(a-R(2))*a),(a-R(2)))
            return set([s])
        if not ((z0:=b**R(2)+a**R(2)-R(2)*a)==0 or\
           abs(float(z0))<1e-6):
            s=sqrt(-a**R(4)-2*a**R(2)*b**R(2)+4*a**R(2)-b**R(4)+R(4)*b**R(2))
            r=set()
            for sg in [R(-1),R(1)]:
                d=a**R(3)-2*a**R(2)+sg*b*s+a*b**R(2)-R(2)*b**R(2)
                if d!=0 or abs(float(d))>=1e-6:
                    r.add(R(2)*atan2((sg*s-R(2)*b),z0))
            return r
        #thank you so much for such interesting coding challenge
        if a==R(0) and b==R(0):
            return set()
        print((a,b))
        raise Exception('')
    def end(self):
        return (self.center[0]+cos(self.start-self.length*self.dir),
                self.center[1]+sin(self.start-self.length*self.dir),
                (self.end_-pi/R(2)*self.dir)%(R(2)*pi))

from PIL import Image,ImageDraw
d=300
x0,y0=d//2,d//2
r,r0=20,2
n,l=7 , [2,3,1,3,1,1]#5,[3,4]
s=(r'''  3 | [3,0]         | 0
  3 | [3,1]         | 3
  3 | [3,3]         | 1
  3 | [3,2,3,1]     | 2
  6 | [1,1]         | 0
  6 | [5,1]         | 3
  6 | [5,2]         | 1
  6 | [5,3]         | 3
  6 | [5,4]         | 6
  6 | [1,1,1,5]     | 3
  6 | [1,2,3,4]     | 0
  6 | [1,2,3,4,5,6] | 8
  7 | -[2,3,1,3,1,1] | 14
  7 | -[3,1,4,1]     | 56
 19 | -[1,2]         | 0'''
r'''5 | -[0,1,1,3,4,1,2,1,1,4,1,2,1,3] | 2
'''
)
def add_point(point):
    global points,count
    if not any(all(abs(float(j-k))<1e-6 \
                   for j,k in zip(i,point)) for i in points):
        points.append(point)
        count+=1

import re
for n,l,ans in\
re.findall(r'\s*(\d+)\s*\|\s*\[(.*?)\]\s*\|\s*(\d+)',s):
#[(5,'0,1,1,3,4,1,2,1,1,4,1,2,1,3',2)]:
#[('7', '2,3,1,3,1,1', '14')]:
#    [('6', '1, 1', '0')]:
#    [(6,'1,1,1,5',3)]:
    print(n,l,end='')
    n=int(n)
    l=[int(i.strip()) for i in l.split(',')]
    fn='196399/%d_%s.png'%(n,'_'.join(map(str,l)))
    start=(0,0,pi/R(2))
    dir_=1
    a_array=[]
    for count in range(30):
        for l_ in l:
            a=Arc(*start,pi/R(n)*R(2*l_),dir_*2-1)
            a_array.append(a)
            start=[simplify(i) for i in a.end()]
            #print(start,a.center,a.start,a.end_)
            dir_^=1
        if (abs(float(start[0]))<1e-3) and \
           (abs(float(start[1]))<1e-3) and start[2]%(R(2)*pi)==pi/R(2):
            break
##        else:
##            continue
##        break
    print(' ',count,'loops made',end='')
    a_array=[a for a in a_array if a.length!=0]
    print(' ',len(a_array),end='')
    count=0
    points=[]
    if len(a_array)==1:
        print(' ans=%s, count=%d'%(ans,count))
        continue
    for n,a in enumerate(a_array):
        if a.length==R(2)*pi:
            add_point((a.x0,a.y0))
        for m,b in enumerate(a_array):
            if (n-m)%len(a_array) not in [0,1,len(a_array)-1]:
                #print('.',sep='',end='')
                try:
                    i_=[list(a.i(b)),list(b.i(a))]
                    p_=list(list(0<=((-R(d_)*(i-st))%(R(2)*pi))<=l_ for i in s) \
                           for s,l_,st,d_ in \
                           zip(
                               (i_),
                               [a.length,b.length],
                               [a.start,b.start],
                               [a.dir,b.dir]
                               ))
                    if all(any(i) for i in p_):
                        for t,angle in zip(p_[0],i_[0]):
                            if t:break
                        point=tuple(i+f(angle) for i,f in zip(a.center,[cos,sin]))
                        add_point(point)
                        #print('\n',(n,m),sep='')
                except Exception:
                    print(i_,[a.length,b.length],[a.start,b.start])
                    raise
    #assert count//2==int(ans)
    print(' ans=%s, count=%d'%(ans,count))
    #break
    continue
    xy=[sum(map(f,a_array))/len(a_array) for f in \
        [(lambda i:lambda a:a.center[i])(i) for i in [0,1]]]
    image = Image.new('RGB',(d,d),'white')
    draw = ImageDraw.Draw(image)
    point=lambda x,y:draw.ellipse((x0-r0+x,y0-r0-y,x0+r0+x,y0+r0-y),'blue','blue')
    for a in a_array:
        start=[a.x0,a.y0,a.angle]
        dir_=a.dir
        point(*[int((i-xy_)*R(r)) for i,xy_ in zip(start[:2],xy)])
        c=[int((i-xy_)*R(r)) for i,xy_ in zip(a.center,xy)]
        draw.arc((c[0]-r+x0,-c[1]-r+y0,c[0]+r+x0,-c[1]+r+y0),
                 *([int(-a.start*180/pi),int(-a.end_*180/pi)][::dir_]),
                 0x3a2af6)
    #image.save(fn,'PNG')
    #break
#image.show()
a=a_array
f=lambda n,m:(a[n].i(a[m]),a[n].start,a[n].length,a[n].dir)
g=lambda a,b:list(list((0,((-R(d_)*(i-st))%(R(2)*pi)),l_) for i in s) \
                           for s,l_,st,d_ in \
                           zip(
                               (i_),
                               [a.length,b.length],
                               [a.start,b.start],
                               [a.dir,b.dir]
                               ))

Output:
3 3,0  0 loops made  1 ans=0, count=0
3 3,1  2 loops made  6 ans=3, count=3
3 3,3  0 loops made  2 ans=1, count=1
3 3,2,3,1  0 loops made  4 ans=2, count=2
6 1,1  29 loops made  60 ans=0, count=0
6 5,1  2 loops made  6 ans=3, count=3
6 5,2  1 loops made  4 ans=1, count=1
6 5,3  2 loops made  6 ans=3, count=3
6 5,4  5 loops made  12 ans=6, count=6
6 1,1,1,5  2 loops made  12 ans=3, count=3
6 1,2,3,4  2 loops made  12 ans=0, count=0
6 1,2,3,4,5,6  1 loops made  12 ans=8, count=8

But it can generate such things although it was not in the task.

50% of test cases is not good enough. All answers have to solve the problem fully, and to be a serious competitor, one must at least attempt to golf it.

I don't know what is wrong with intersection being end points, I already count intersections with <= (line 124). I already invested more than 7 hours into it and it's not enough, it needs to be re-worked to exact calculations without sympy, although after embedding wolframalpha solution of $(a+\cos(t))^2+(b+\sin(t))^2=1$ along with corner cases I did not want to continue with it at all, hard-coding the formulas (as one will eventually do if does not prefer a numerical method) is mandatory part of the task, it's boring. See my point? Golfing will be after de-sympy-fying.

That's fair. The golfing part is less significant; getting rid of most of the spaces is fine for a first attempt. Draft answers are usually discouraged (I'm not sure if they're disallowed, but very uncommon at least) though, outside of proof of feasibility for problems that have questionable solvability.

For what it's worth, I really appreciate this submission as a proof of concept—I voted it up. Even if you don't complete it, I think this can be a valuable resource for other people attempting the challenge.

I'm very impressed by this solution and the effort that went into it. I've put a bounty on this question that I'll be able to award to you in 24 hours

Thanks a lot. Btw, wouldn't any downvoters care to explain why. I'm getting -1 even after the full solution is posted) About the original 208 problem: $\sin\left(\frac{2\pi}{5}\right),\cos\left(\frac{2\pi}{5}\right),\sin\left(\frac{4\pi}{5}\right)$ seems to be linearly independent over $\mathbb{Z}$ so you need like a dictionary over $140^3\cdot 5$ entries to compute the number of all closed curves length $70$.

@AlexeyBurdin I didn't downvote (in fact, I upvoted yours), but perhaps because the code looks long (even though in this problem it seems that this is unavoidable), and that the indentation looks long (even though you use single character: tab here).

1496 bytes with some very minor golfs (removed loads of spaces; changed some multi-byte variables to single-byte uppercase characters; changed the while True to while 1; etc.) You could paste both your function and this function I linked in text-compare.com for an easy comparison of the changes I did. I'm sure an actual Python golfer could reduce the byte-count drastically, but unfortunately I'm not too skilled in Python. Nice answer btw!

1447 bytes (expanding from @KevinCruijssen 's golf) , primarily by removing unnecessary whitespace.

1420 bytes

source: Stack Exchange

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

sort: votes


text:
Rock Paper Scissors (Sorta) Quine
Create three programs, which we'll call Rock, Paper, and Scissors.
Each program must be unique, and accept input.
If a program gets any input which is not one of the programs Rock, Paper or Scissors, it must print itself.
RPS style, the programs will each print one of the following four outputs:

"win" if the running program beats the program that is being input
"lose" if the running program loses against the program that is being input
"tie" if the input is equal to the source code of the running program
The source code of the running program itself for any other input (including an empty input)

General rules:

The three programs can be in any language. Rock can be in a different language from Paper: same for any other pair.
They are not restricted by size.
They must print through STDOUT or closest equivalent, and must print strings or closest equivalent. They must not print to STDERR.
They need not be full programs. They can be functions, if you wish to get rid of the stuff needed in a program, like C's #includes.

This is a code-golf challenge, where your score is determined by the sum of the programs' sizes. The person with the lowest score wins.
If two people have the same score, the person whose largest program by bytes out of the set Rock, Paper, Scissors is smaller wins.

I recommend sum instead of average, no need to divide or include annoying thirds. Then, this could just be tagged [tag:code-golf]  and [tag:quine]

I thought the scores would get too boringly small with sums, but then again, that applies to thirds too,

So far both answers have interpreted "If given any input other than what will be specified below, each prints itself" to mean they are allowed to output win/lose/tie for certain inputs that are not the other program. If you intend to keep this requirement I suggest you further reinforce it.

I took the liberty of formatting the challenge description a bit, since it was a bit hard to read with all separated lines instead of paragraphs. If I accidentally removed or misinterpret something, feel free to change it again. And one question: you state the three programs can be in any language, does this mean the Rock program could be in a different language than the Paper program as well? Or you simply mean all languages are open to compete, but the Rock, Paper, and Scissor programs should still be in that same language?

Is a full program mandatory, or could we also do a (lambda) function? Usually functions are allowed by default to get rid of all the fuss every program need mandatory (like interface M{static void main(String[]a){...}} for Java instead of v->{...} if it's a function.

Jelly, 67 59 bytes × 3 = score of 177
“3ṛṾ;Ṫ,ɠ;µḣ2O_/2ị%3+1×ḣ2a2¦Ɱ3Ṿ€¤ċɗ/$ịṚ“win“lose“tie“1ịv”1ịv

Try it online!
A full program that reads a line from STDIN and returns tie if given the same program, win if given a program against which it can win and lose if a program against which it loses. If provided with anything except one of the rock, paper or scissors programs it prints itself.
The digit in second position in the program indicates which it is:

Rock
Scissors
Paper

Python 3, 273, 489, 429  bytes
Rock:
r=['tie', 'lose', 'win'];s="i=input();t=[f'r={r[n:]+r[:n]};s={s!r};exec(s)'for n in[0,1,2]];print(i in t and r[i.find('t')//7]or t[0])";exec(s)

Try it online against itself!
Try it online against Paper!
Try it online against Scissors!
Try it online against rubbish!
Paper:
r=['win', 'tie', 'lose'];s="i=input();t=[f'r={r[n:]+r[:n]};s={s!r};exec(s)'for n in[0,1,2]];print(i in t and r[i.find('t')//7]or t[0])";exec(s)

Try it online against itself!
Try it online against Scissors!
Try it online against Rock!
Try it online against garbage!
Scissors:
r=['lose', 'win', 'tie'];s="i=input();t=[f'r={r[n:]+r[:n]};s={s!r};exec(s)'for n in[0,1,2]];print(i in t and r[i.find('t')//7]or t[0])";exec(s)

Try it online against itself!
Try it online against Rock!
Try it online against Paper!
Try it online against trash!
The same as the previous version, but check that the input exactly matches the source code of one of the programs.
Try it online (together)!
Old (invalid) version
Rock:
s="print(['tie','lose','win','s='+repr(s)+';exec(s)',''][input().find('ti')//7-1])";exec(s)

Paper:
s="print(['win','tie','lose','s='+repr(s)+';exec(s)',''][input().find('ti')//7-1])";exec(s)

Scissors:
s="print(['lose','win','tie','s='+repr(s)+';exec(s)',''][input().find('ti')//7-1])";exec(s)

Try it online!
Three almost identical programs (all with 91 bytes), the only difference is the order of the win/tie/lose, which each program uses the position of the 'tie' to determine the result from it's own ordering.
As pointed out, these programs are invalid, as they will only print out themselves if the input doesn't contain 'ti' (or the 'ti' is in a certain place).

I don't think this is valid - you are supposed to output your source no matter what the input is, unless it is the other programs: "If given any input other than what will be specified below, each prints itself".

Right, I see now. As long as the input doesn't contain 'ti' it'll print itself.

@EmbodimentofIgnorance It's mentioned as "lose" the first time in the spec, then again as Lose (without quotations). Also it just feels a lot nicer as all lowercase :)

The question is pretty hard to read, sorry about that. And I also agree it feels a lot nicer as all lowercase :)

Would removing spaces in your latest version's starting list provide a helpful -9?

@Corsaka I would if I could, but the quines generated include spaces due to Python's representation of a list, so I have to leave them in.

Java 10, 1716 (three time 572) bytes
Rock program:
interface R{static void main(String[]a){var s="interface R{static void main(String[]a){var s=%c%s%1$c;System.out.print((s=s.format(s,34,s)).equals(a[0])?%1$ctie%1$c:t(s).equals(a[0])?%1$close%1$c:t(t(s)).equals(a[0])?%1$cwin%1$c:s);}static String t(String s){var r=%1$c%1$c;for(int b:s.getBytes())r+=(char)(b==82?80:b==80?90:b==90?82:b);return r;}}";System.out.print((s=s.format(s,34,s)).equals(a[0])?"tie":t(s).equals(a[0])?"lose":t(t(s)).equals(a[0])?"win":s);}static String t(String s){var r="";for(int b:s.getBytes())r+=(char)(b==82?80:b==80?90:b==90?82:b);return r;}}

The Paper program is similar, except with both R replaced with P.
The Scissor program is similar, except with both R replaced with Z (since S is already used in String).
Rock program:
- Try it online with itself as input.
- Try it online with the Paper program as input.
- Try it online with the Scissor program as input.
- Try it online with rubbish input.
Paper program:
- Try it online with itself as input.
- Try it online with the Scissor program as input.
- Try it online with the Rock program as input.
- Try it online with rubbish input.
Scizzor program:
- Try it online with itself as input.
- Try it online with the Rock program as input.
- Try it online with the Paper program as input.
- Try it online with rubbish input.
Explanation:
General quine explanation:

The var s contains the unformatted source code
%s is used to put this String into itself with s.format(...)
%c, %1$c, and 34 are used to format the double-quotes
s.format(s,34,s) puts it all together

Challenge part:
I've added a separated method t which will transliterate the characters RPZ once clockwise in all three programs:
static String t(String s){ // Method with String as both parameter and return-type:
  var r="";                //  Result-String, starting empty
  for(int b:s.getBytes())  //  Loop over the characters of the input-String:
    r+=                    //   Append to the result-String:
       (char)(             //    A character with codepoint:
              b==82?       //     If the character is 'R':
               80          //      Change it to 'P' (codepoint 80)
              :b==80?      //     Else-if the character is 'P':
               90          //      Change it to 'Z' (codepoint 90)
              :b==90?      //     Else-if the character is 'Z':
               82          //      Change it to 'R' (codepoint 82)
              :            //     Else:
               b);         //      Leave the character unchanged
  return r;}               //  Return the resulting String

When we're printing, it will do the following checks:
s.equals(a[0])?            // If the program equals the input:
 "tie"                     //  Print "tie"
:t(s).equals(a[0])?        // Else-if the program transliterated once equals the input:
 "lose"                    //  Print "lose"
:t(t(s)).equals(a[0])?     // Else-if the program transliterated twice equals the input:
 "win"                     //  Print "win"
:                          // Else:
 s                         //  Print the source code-String itself

05AB1E, 219 207 201 (three times 73 69 67) bytes
Rock program:
2"D34çý…·‡§ÍŽ°#sª¤¸YF¤₁DÀ‡ª}IQZ_ªÏ"D34çý…·‡§ÍŽ°#sª¤¸YF¤₁DÀ‡ª}IQZ_ªÏ

Paper program is similar, but with leading 5 instead of 2.
Scissor program is similar, but with leading 6 instead of 2.
Similar transliterate approach as my Java answer.
Rock program:
- Try it online with itself as input.
- Try it online with the Paper program as input.
- Try it online with the Scissor program as input.
- Try it online with rubbish input.
Paper program:
- Try it online with itself as input.
- Try it online with the Scissor program as input.
- Try it online with the Rock program as input.
- Try it online with rubbish input.
Scizzor program:
- Try it online with itself as input.
- Try it online with the Rock program as input.
- Try it online with the Paper program as input.
- Try it online with rubbish input.
Explanation:
General quine explanation:
Uses the default 14 bytes quine program of @OliverNi, since it's easy to modify (even though there is a shorter 05AB1E quine).
This quine will:
2               # Push a 2 (or 5 or 6 depending on the program used)
 "D34çý"        # Push the trailing part of the source-code as string
         D      # Duplicate this string on the stack
          34ç   # Push a 34 as ASCII character (a double quote '"')
             ý  # Join the three values on the stack by this
                # (and output the result implicitly)

Try it online.
Challenge part:
I've combined this with the following if-else construction:
…·‡§ÍŽ°         # Push dictionary string "tie lose win"
       #        # Split it on spaces: ["tie","lose","win"]
        sª      # Swap, and append the quine-string we created
¤               # Get the last item (the quine we added) of the list (without popping)
 ¸              # Wrap it into a list
  YF            # Loop 2 times (the default value of variable `Y` is 2):
    ¤           #  Get the last item of the list (without popping)
     ₁D         #  Push builtin 256 twice
       À        #  Rotate the digits once towards the left: 562
        ‡       #  Transliterate the 256 to 562 in the string
         ª      #  And append it to the list
  }IQ           # After the loop: check for each value if it's equal to the input
     Z          # Get the maximum (without popping) to check if any are truthy
      _         # Inverse this boolean (0 becomes 1; 1 becomes 0)
       ª        # Append it to the list of truthy/falsey values
        Ï       # Leave the strings of the earlier created list at the truthy positions

See this 05AB1E tip of mine (section How to use the dictionary?) to understand why …·‡§ÍŽ° is "tie lose win".

Python 3.8 (pre-release), 127 * 3 = 381 bytes
Rock :
x=0;exec(s:="a=';exec(s:=%r)'%s;i=input();print(a==i[3:]and'x=/'<i[:3]<'x=3'and['tie','win','lose'][x-int(i[2])]or'x=%d'%x+a)")

Try it online!
Paper :
x=1;exec(s:="a=';exec(s:=%r)'%s;i=input();print(a==i[3:]and'x=/'<i[:3]<'x=3'and['tie','win','lose'][x-int(i[2])]or'x=%d'%x+a)")

Try it online!
Scissors :
x=2;exec(s:="a=';exec(s:=%r)'%s;i=input();print(a==i[3:]and'x=/'<i[:3]<'x=3'and['tie','win','lose'][x-int(i[2])]or'x=%d'%x+a)")

Try it online!
How it works :
The structre of this quine is a variation of exec(s:="print('exec(s:=%r)'%s)")

x=0, x=1, x=2 defines the type of the program (rock, paper or scissors)
a=';exec(s:=%r)'%s stores the quine in a
i=input() stores the input in i
a==i[3:]and'x=/'<i[:3]<'x=3' verify that the input is any of rock, paper or scissors.
and['tie','win','lose'][x-int(i[2])] If the above is true, prints the corresponding result using as index the difference of the type of each code
or'x=%d'%x+a otherwise, prints the quine

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


text:
Clockwise matrix rotation
The title pretty much describes it all. Given as input a \$n \times m\$ matrix and an integer \$i\$ create a complete function/program that returns the matrix \$i\$ times clockwise rotated by \$90^\circ\$.
Rules:

as matrix you can use any convenient representation you like e.g. a list of lists etc...
matrix values can be positive and/or negative integer numbers
\$n\$ and \$m\$ are of course always positive integers between 1 and 10
\$i\$ can be any valid integer which belongs in the following range: \${0...10^5}\$
Standard code-golf rules & winning criteria apply but no "winning" answer will be chosen.

EDIT: I had to edit the initial question because for some programming languages it takes too long to compute the result for \$i\in\{0...10^7\}\$. There is a workaround to it but since it's a code-golf just make sure that it simply runs successfully for at least \$i\in\{0...10^5\}\$.
Some test cases:
==== example 1 ====
Input:
5
[[1, 3, 2, 30,],
 [4, 9, 7, 10,],
 [6, 8, 5, 25 ]]

Expected Output:
[[ 6  4  1],
 [ 8  9  3],
 [ 5  7  2],
 [25 10 30]]

==== example 2 ====
Input:
100
[[1]]

Expected Output:
[[1]]

==== example 3 ====
Input:
15
[[150,    3,  2],
 [  4, -940,  7],
 [  6, 8000,  5]]

Expected Output:
[[   2    7    5],
 [   3 -940 8000],
 [ 150    4    6]]

==== example 4 ====
Input:
40001
[[1, 3, 9]]

Expected Output:
[[1],
 [3],
 [9]]
```

APL (Dyalog Unicode), 7 bytes
⌽∘⍉⍣⎕⊢⎕

Try it online!
⎕ prompt for matrix expression from stdin
⊢ yield that
⎕ prompt for \$i\$ expression from stdin
⍣ do the following that many times
⍉ transpose
∘ and then
⌽ mirror

Nice, I really liked that it even works for $i$ of $10^7$. I had to lower that in the requirements because for some languages tio.run wouldn't terminate...

@game0ver Yeah, APL is generally quite fast when it comes to munging arrays. Even $10^8$ only takes about 20 seconds on TIO.

Wow, the character for transpose and mirror looks suitable

@justhalf Yes, APL is like that. Can you guess what flip-upside-down looks like?

Something like this ⦵?

@justhalf Basically. Unicode has many homoglyphs. APL prefers the Unicode APL range, so this is ⊖

Pyth, 7 6 bytes
uC_GQE

Try it online!
-1 Thanks to @FryAmTheEggman
Rotates the matrix by reversing the order of rows and taking the transpose. Takes and returns lists of lists.
How it works
uC_GQE
u    E - Reduce the second input
  _G   - By reversing the order of rows
 C     - And transposing
    Q  - An amount of times equal to the first input

J, 7 bytes
|:@|.^:

Try it online!
An adverb train. Right argument is the matrix, left argument is the repetition count.
How it works
|:@|.^:
     ^:  Repeat the function:
   |.      Reverse vertically
  @        and then
|:         Transpose
         Absent right argument to `^:`:
           bind to the left argument (repeat count)

Jelly, 4 bytes
Naive implementation. There might be a shorter way I'm not aware of.
ṚZ$¡

Try it online!

Nice, but the last test case fails since for both $i=40001$ and $i=40000$ it gives the same result.

@game0ver The output is actually different, but displayed the same way. I've added some code in the footer to format it.

yep you are correct! Thanks for editing :)

I think this is as short as you can get at present. Matrix rotation is already on my wish list of possible new Jelly links that I may get round to suggesting at some point

Haskell, 50 bytes
(!!).iterate(foldr(zipWith$flip(++).pure)e)
e=[]:e

Try it online!

Ruby, 39 bytes
->m,n{n.times{m=m.reverse.transpose};m}

Try it online!

K (oK), 6 bytes
(+|:)/

Try it online!

Japt -R, 2 bytes
zV

Try it
Rotate matrix by 90 degrees 2nd input times

OK, this one might be hard to beat.

@Adám agreed, Japt fits this challenge very well :p

@AZTECCO really impressive!!!

I knew this would be the solution just from the challenge title! I also knew someone would have beaten me to it!

I was there at the right time @Shaggy , couldn't miss it!

Python 2, 44 bytes
f=lambda A,i:i%4and f(zip(*A[::-1]),i-1)or A

Try it online!
Input/output is a list of tuples. (The %4 is a workaround for Python's recursion limit; could save a byte otherwise).

Nice! Yep that's the workaround (%4) I'm talking about in the description. A way to skip that would be using numpy but I really like the naive implementation. Also you could save 2 bytes by placing f= into Header in TIO!

@game0ver They can't actually do that to save bytes since this is a recursive function - it needs to be named so they can call it.

@FryAmTheEggman good catch! You are right!

05AB1E (legacy), 3 bytes
Føí

Takes \$i\$ as first input; matrix the second.
Try it online or verify all test cases.
Explanation:
F    # Loop the (implicit) input-integer amount of times:
 ø   #  Zip/transpose the matrix; swapping rows/columns
     #  (this will take the (implicit) input in the first iteration)
  í  #  Reverse each row
     # (after the loop, the resulting matrix is output implicitly)

NOTE: Uses the legacy version only because of performance. The last test case times out in the rewrite version. Both the legacy and rewrite versions would be the same, though.

Julia 1.0, 6 bytes
Kind of cheating, but Julia has a built in rotl90 function, that does exactly that.
rotl90

Try it online!

No, no cheat at all! It's also pretty fast with very large values of $i$ e.g. $i^{11}$ etc...

R, 64 bytes
r=function(x,i){o=x;n=0;while(n<i){o=t(apply(o,2,rev));n=n+1};o}

Try it online!
Not really efficient...
Uses rotation approach proposed by Matthew Lundberg

Hi there, and welcome to R golfing! I like this approach. There are still a bunch of golfs available, e.g., this for 48 bytes. Feel free to join the R golf chatroom to ask any golfing questions you might have, and read these tips. Happy golfing!

To speed it up, you can do something like i%%4 in the stop condition.

JavaScript (ES6), 58 bytes
Takes input as (i)(matrix).
i=>g=m=>i--?g(m[0].map((_,x)=>m.map(r=>r[x]).reverse())):m

Try it online!
Note: The last test case was edited to prevent a recursion error. We can obviously use i--&3 (60 bytes) to support much larger values.

Octave, 17 bytes
Unfortunately rot90 rotates the input counterclockwise.
@(x,i)rot90(x,-i)

Try it online!

MATL, 5 3 bytes
-2 bytes thanks to @LuisMendo!
_X!

Try it online!

Java 8, 141 138 131 130 bytes
(m,i)->{for(int t[][],a,b,j;i-->0;m=t)for(t=new int[b=m[0].length][a=m.length],j=a*b;j-->0;)t[j%b][j/b]=m[a-j/b-1][j%b];return m;}

-7 bytes thanks to @OlivierGrégoire.
Try it online.
Code explanation:
(m,i)->{                 // Method with int-matrix and int parameters and int-matrix return
  for(int t[][],         //  Temp int-matrix as replacement
          a,b,           //  Temp integers used for the dimensions
          j;             //  Temp integer for the inner loop
      i-->0;             //  Loop the input `i` amount of times:
      m=t)               //    After every iteration: replace the input-matrix `m` with `t`
    for(t=new int[b=m[0].length][a=m.length],
                         //   Create a new temp-matrix `t` with dimensions `b` by `a`,
                         //   where `b` & `a` are the amount of columns & rows of matrix `m`
        j=a*b;           //   Set `j` to the product of these dimensions
        j-->0;)          //   And inner loop in the range [`j`, 0):
      t                  //  Replace the value in `t` at position:
       [j%b]             //   `j%b` (let's call this row A),
            [j/b]        //   `j/b` (let's call this column B)
        =m               //  And replace it with the value in `m` at position:
          [a-j/b-1]      //   `a-j/b-1` (which is the reversed column B as row,
                         //     so it both transposes and reverses at the same time),
                   [j%b];//   `j%b` (which is row A as column)
  return m;}             //  And finally return the new int-matrix

To save bytes, the inner loop is a single loop and uses j/a and j%a as cell positions. So a loop like this:
for(r=a;r-->0;)for(c=b;c-->0;)t[c][r]=m[b-r-1][c];

Has been golfed to this:
for(j=a*b;j-->0;)t[j%b][j/b]=m[a-j/b-1][j%b];

to save 5 bytes.

131 bytes

Explanation of the above: I restarted it from scratch trying to use simply new int[m[0].length][m.length]. It seemed to have worked. The rest is basically your code. So in the end the golf came from moving the variable allocation where needed most.

@OlivierGrégoire I was quite proud of this one, but had the feeling it could still be golfed. ;) Btw, 1 more byte can be saved by removing that temp variable s and use a-j/b-1 instead of  a+~s again.

Indeed, that's a one more saved byte. I hadn't passed the code again under full review ;) But to be honest, you did the bigger job with your first answer.

I've removed that general explanation, since it's now the same as the code, haha. ;)

Husk, 7 bytes
~!→¡oT↔

Try it online! I've always found it odd that the only real way to iterate a function a set number of times in Husk is to index into the infinite list of that function's iterates.

Pari/GP, 37 bytes
f(m,n)=for(i=1,n,m=Mat(Vecrev(m~)));m

Try it online!

GolfScript, 10 bytes
~{-1%zip}*

Try it online!
~{      }*   # Repeat i times
  -1%        # Reverse the array
     zip     # Zip

When the program finishes, only the elements of the matrix are displayed. To see how it actually was outputted, use this.

Arn, 8 7 bytes
Ç├Úe↑Î(

Try it!
Explained
Unpacked: &.{.@@.<
ELABORATE HERE
&. Mutate N times
  { Block, key of `_`
        _ Implied variable
      .@ Transposed
    @ Binded map
      .< Reverse
  } End block; implied

Input is two lines, the first being an array and the second a number. &. supports both 2 separate inputs and one as an array, and as _ is automatically the STDIN separated on newlines and parsed, this code is valid.

Mathematica, 32 bytes
a = {{3, 4, 5}, {5, 6, 7}, {8, 9, 10}, {11, 12, 13}};

Nest[Reverse /@ Transpose[#] &, a, i]


text:
Simulate move left for 2048
I have a fixed length vector of 4 elements. The inputs of which are always 0 or 2^n for n = 1 to 15 (so n = 0 excluded i.e.  2^0 = 1 will not appear)
x = [32, 4, 4, 8]
the result should be
x = [32, 8, 8, 0]
The way it works is that values that are the same will get combined, but one it's combined it can not be combined with another value for another turn.
and we want to simulate the shortest code to make simulate 2048 move left on this one row.
The shortest code wins! It's fixed-size 4 vector. So it's not the same as the other problem. Also, you need to put zeros here.
Test cases:
[0,0,0,0] -> [0,0,0,0]
[0,0,0,2] -> [2,0,0,0]
[2,0,0,4] -> [2,4,0,0]
[8,0,0,8] -> [16,0,0,0]
[16,16,32,64] -> [32,32,64,0]
[16,16,8,8] -> [32,16,0,0]
[2,2,2,0] -> [4,2,0,0]

Suggested additional test case: [2,0,2,2]

May we take and give the vector as a four-character string of Unicode characters with those code points? E.g. [1024,1024,32,64] as "ЀЀ @".

hmm, dont think we should allow that. just straight integers numbers is fine

APL (Dyalog Unicode), 36 bytesSBCS
Anonymous tacit prefix function.
⎕UCS{4↑⍺⍺t⎕R(1⌽∪¨t←2/¨⍺⍺2*⍳16)⍺⍺⍵~0}

Try it online!
⎕UCS{…} derived function where ⍵ is the argument and ⍺⍺ converts to/from code points:
 ⍵~0 the argument without zeros
 ⍺⍺ convert to code points
 t⎕R(…) Replace the texts t (defined below) with the corresponding texts from:
  ⍳16 the indices from 1 to 16
  2* two raised to the power of those
  ⍺⍺ convert them to characters
  2/¨ make two of each
  t← assign to t
  ∪¨ get the unique element from each (i.e. deduplicate them)
  1⌽ cyclically rotate the first string to the end
 ⍺⍺ convert to code points
 4↑ take the first four elements, padding with zeros

You need to remove zeros before merging the numbers, and the grouping direction is also different.

@Bubbler OK, fixed now. Thanks for letting me know.

J, 31 bytes
4$!.0[:;_2([:<,`+@.=/)\ ::0-.&0

Try it online!

Julia 277 248 bytes
m(x)=begin
t=true
e=falses(3)
for i in 2:4
if x[i]!=0
d=!t
for j in i-1:-1:1
if x[j]!=0
if(x[j]!=x[i])|e[j]
p=x[i]
x[i]=0
x[j+1]=p
d=t
break
elseif x[j]==x[i]
x[j],x[i]=x[i]*2,0
e[j]=t
d=t
break
end
end
end
if !d
x[1],x[i]=x[i],0
end
end
end
x
end

Maybe this can help you?

Hey, check this out!

Although poorly golfed, this does appear to be a serious contender.


text:
Stack Exchange Answerer
Oof! You've been coding the whole day and you even had no time for Stack Exchange!
Now, you just want to rest and answer some questions. You have T minutes of free time. You enter the site and see N new questions. To write an answer for each you'll need ti minutes. Of course, as a dedicated reputation gatherer, you want to answer as many questions as you can.
Can you write a program to calculate which questions do you have to answer to write maximum posts in T minutes?
Input
First line of input consists T minutes you have for answering, and N, how many new questions are on the site.
The second line has N numbers: time you need to answer qi question.
Output
Write either an array or numbers split with space: indexes of questions(counting from 0 or 1 - what is better for you) you should answer in order to write as many answers as you can. If you can't answer any questions, write nothing or anything to express that it's impossible. If there are several variants, write any.
Examples
Inputs               Possible outputs
60 5
30 5 10 20 3    0 1 2 4, 0 1 3 4 or 1 2 3 4
10 5
1 9 5 7 2         0 2 4 or 0 3 4
5 5
1 1 1 1 1         0 1 2 3 4
60 5
48 15 20 40 3  1 2 4 or 1 3 4
5 1
10

1 0

And of course it's code-golf, so the shortest code in bytes wins.

Python 3.8, 81, 79, 75 bytes
Using the walrus operator :=:
lambda k,l:[i for j,i in sorted((v,k)for k,v in enumerate(l))if(k:=k-j)>=0]

Try it online!
-2 bytes thanks to @JoKing
-4 bytes thanks to @justhalf
Python 3, 158, 137, 136, 130, 127, 117, 103, 95 bytes
def f(k,l):
 q=[]
 for j,i in sorted((v,k)for k,v in enumerate(l)):k-=j;q+=[i]*(k>=0)
 print(q)

Try it online!
-21 bytes thanks to @79037662 by limiting indentation to 1-space.
-14 bytes thanks to @ mypetlion
-8 bytes thanks to @justhalf
Both solutions ignore N parameter.

One easy golf is to use only a single space for the indents: https://tio.run/##TYxNCsIwFIT3OcVbJvgoqaWKxZykZBFJgmmb9C9Ci3j2GrtQYYZhvoEZ1njvQ7Ft2liwtMWOVQRG9KKWyAnYfgKHDbgAcz9Fo@nTVc0/NuHhzaSioR17ZS4aP1OGrVlFp/xNK1iqpc7l5xb8QTQpnAV/FW01ZmoYTNDUMQLD5EKkI9ssPXGsC45QIuQpjsmFZMTS1Ooc4bJP57TstNzhT1/IJdve

Wouldn't that be -7 bytes?

@game0ver Oh, nvm...you originally had -1 total in the message. I only counted -1 byte per indent level instead of -3.

You can replace dict(enumerate(l)).items() with just enumerate(l) to save 14 bytes. You're converting a list of tuples to a dict, then iterating over the dict_items, and converting each one back to a tuple, which is pretty roundabout.

@mypetlion Good point, thanks!

@JoKing Thank you very much, that's better now!

In the Python 3 answer, why is the function only taking two arguments instead of 3?

@justhalf Simply because it doesn't need the 3rd parameter and as per the rules it can be omitted. Actually almost none of the answers provided use the 3rd parameter.

Cool, didn't know that. Here's -5 bytes for you by modifying the if into array multiplication :)

@justhalf Thanks! That's a cool trick!

Another -3 bytes by modifying k instead of m. This trick can be applied to the Python 3.8 solution, too. Reducing it by 4 bytes by removing m.

Python 3.8 75 bytes

@justhalf That's brilliant, never crossed my mind to modify k instead :) Thank you!

05AB1E, 9 13 12 bytes
ā<æʒ¹sèO@}éθ

Takes the inputs in the order: \$q_i\$, \$N\$ (which is mostly ignored, see explanation below), \$T\$.
Uses 0-based indexing.
+4 bytes as bug-fix for test case [1,1,1,1,1] resulting in [0,0,0,0,0] instead of [0,1,2,3,4] (and now switched from 0-based to 1-based indexing).
-1 byte thanks to @Grimmy (and back to 0-based indexing again).
Try it online or verify all test cases or get all possible outputs for the test cases instead of just one.
Explanation:
             # Take the (implicit) input-list qi
ā            # and push a list in the range [1, list-length] without popping the input itself
 <           # Decrease each by 1 to make it 0-based: [0, list-length)
  æ          # Get the powerset of this list of indices
             #  i.e. [0,1,2] → [[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]]
   ʒ         # Filter this list of lists by:
    ¹        #  Push the first input-list qi again
     s       #  Swap to put the current list of the filter at the top of the stack
      è      #  Index each into the list qi
       O     #  Sum these values
        @    #  Check if the (implicit) input-integer is >= this sum
             #  (The very first iteration it will use the second input, which is the length N;
             #   every other iteration it will use the third input, which is the total time T.
             #   Since the very first inner list of the powerset will be the empty list,
             #   this causes no problems; which is how we ignore the mandatory length N input)
         }é  # After the filter: sort all remaining inner lists by length
           θ # Pop and leave the last one, which is (one of) the list(s) with the most items
             # (after which the result is output implicitly)

You can go back to 0-based indexing by using .ā instead of āø.

Here's a 12

@Grimmy Thanks! And I had no idea we had the builtin .ā.

Japt,   22 21 16   15 bytes
ð à ñÊÔæÈxgU <V

Try it
ð à                 combinations of indexes of 1st input
    ñÊÔ             sorted by length and reversed
       æ            get first element returning true when passed throug...
        ÈxgU        elements of input at X indexes reduced by addition
               <V   less than 2nd input

Takes input as [times...], time , amount
Saved 1 stealing from @Shaggy ÈxgU

Well, damn! Wrote my solution up hours ago but got distracted by work and only now, after posting it, do I see this, which can be golfed down to my exact solution. Sorry. One of these days I'll learn to reload before posting!

Your sorting method can be golfed to ñÊ but isn't actually necessary as à sorts by descending length. And r+ can be just x.

I regolfed a bit by myself to 16.. You still beaten me @Shaggy, thanks for the tips!

@Shaggy it seems like à doesn't sort by length
https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LVE&code=8CDgIA&input=WzQ4LCAxNSwgMjAsIDQwLCAzXQo2MA

:o Crap! You're right! Where did I get the idea that it does?!

I supposed it too! But when I tested with [48, 15, 20, 40, 3]
60 ... I realized that was something wrong

Ah, I think I might have been thinking of ã, which sorts by ascending length.

@Embodiment of Ignorance it is valid too because we don't have to maximize the time, it was specified in the comments.

Not that it matters, but the length input $N$ is mandatory for all answers (even if you ignore it..). If I understand Japt correctly, you can just input it at the end and not use it, since you use $U$ and $V$ explicitly in Japt programs anyway, so it won't change the code in any way.

@Kevin Cruijssen you are right, sorry forgot to add 3rd input, anyway it won't change the code like you said, I fix now

dzaima/APL, 15 14 13 bytes
+\∘<⍛≤+/⍛↑⍋⍤⊣

Try it online!
+\∘<⍛≤+/⍛↑⍋⍤⊣  train; left arg = ⍺ = t, right arg = ⍵ = T
     ≤         ⍺ <= ⍵
    ⍛          with ⍺ modified to
   <             sorted
+\∘              and then, cumulative sum
               so, cumulativeSum(sort(q)) ≤ T

          ⍋    the indices required for sorting
           ⍤⊣  applied on ⍺
               so, the output, sorted by question time, if T=∞

         ↑     take first ⍺ elements from ⍵ (⍺ is `+\∘<⍛≤`, ⍵ is `⍋⍤⊣`)
      +/⍛        but summing ⍺ first

Jelly, 8 bytes
ṢÄ>¬TịỤ{

A dyadic Link accepting the question times on the left and the total time on the right which yields the 1-indexed indices.
Try it online! (footer calls the Link and prints a formatted version of its output.)
(If we must take the number of questions, this works as full program accepting: question times; total time; number of questions.)
How?
ṢÄ>¬TịỤ{ - Link: ts; T        e.g. [1, 9, 5, 7, 2]; 10
Ṣ        - sort ts                 [1, 2, 5, 7, 9]
 Ä       - cumulative sums         [1, 3, 8,15,24]
  >      - greater than (T)?       [0, 0, 0, 1, 1]
   ¬     - logical NOT             [1, 1, 1, 0, 0]
    T    - truthy indices          [1, 2, 3]
       { - use left argument:
      Ụ  -   indices by value      [1, 5, 3, 4, 2]   (i.e index 4 has 2nd largest value)
     ị   - index into              [1, 5, 3]

Alternative 8:
ỤṁṢÄ>Ðḟɗ - indices-by-value moulded-like (cumulative-sums of sorted(ts) if not greater than T)

Try it online!

Does Jelly have a single byte operator for <=, which would allow you to skip the NOT?

No it does not.

Shame. It looks like some solutions are assuming that the result must be strictly <T rather than <=T so it might be worth asking for clarification on that.

@tsh Ah yeah, that's a bug, I should use T not M (since if no cumulative sums are not greater than the right argument the zeros will be the maximal values. T will instead get truthy indices, so non-zeros). Thanks for spotting that. (FWIW the alternative 8 byte solution works as-is)

JavaScript (V8), 117 113 110 105 85 71 63 bytes
(-3 thanks to Ver Nick says Reinstate Monica)
(-20 thanks to Arnauld)
(-14 thanks to Shaggy)
(-8 thanks to tsh)
a=>g=t=>(a[y=a.indexOf(i=Math.min(...a))]=t)<i?[]:[y,...g(t-i)]

Try it online!
Could probably be golfed some more...a function which takes input in three arguments: time, number of questions (not actually used), and an array of question times.
It will repeatedly find the smallest element in the array, and set it to the time available, removing it from the possibilities for the next iteration. It puts the index of the value into the output array.
Thanks to everyone who's contributed to golfing this answer...54 bytes shorter than the original!

You can replace true with 1

@Arnauld Thanks! I forgot you could put variable assignments as arguments like that...

71 bytes. On my phone so can probably be golfed a bit further.

Maybe 63 bytes? I'm not sure if this is correct (since previous comments does not suggest this with no reason)

Good shout, @tsh, completely missed that.

R, 44 41 bytes
function(m,t)order(t)[cumsum(sort(t))<=m]

Try it online!
Takes input as Time, times.
Returns numeric() for empty output.
Order the times, take cumulative sum and then select the times where the cumulative sum is less than or equal to total time.
-1 in the end to get 0-index
-1 byte thanks to Giuseppe
-2 bytes since 0-index is no longer needed

The OP seems to indicate 0 or 1 indexing doesn’t matter.

43 bytes

Japt -h, 14 bytes
Assumes 0 is not a valid unit of time.
ð à ñÊfÈxgU §V

Try it
ð à ñÊfÈxgU §V     :Implicit input of array U=q and integer V=T
ð                  :0-based indices of U
  à                :Combinations, which, fortunately, includes the empty array, covering the last test case.
    ñ              :Sort by
     Ê             :  Length
      f            :Filter
       È           :By passing each throughout a function
        x          :  Reduce by addition
         gU        :    After indexing each back in to U
            §V     :  Less than or equal to V?
                   :Implicit output of last element

Or, if we have to take N as input (or 0 is a valid unit of time).
o à ñÊfÈxgV §W

Try it
Where U=N, V=q, W=T, o creates the range [0,U) and everything else is as above.

Ruby, 68 64 60 59  58 bytes
->t,q{q.map.with_index.sort.reject{|x,|0>t-=x}.map &:last}

Try it online!

Red, 133 bytes
func[t b][s: 0 sort collect[foreach n sort collect[repeat i length? b[keep/only
reduce[b/:i i]]][if(u: s + n/1)<= t[s: u keep n/2]]]]

Try it online!
1-indexed. Ignores N

JavaScript (ES10),  78  75 bytes
Saved 3 bytes thanks to @Neil
Takes input as (T)(list). Ignores N.
t=>a=>a.map((...x)=>x).sort(([a],[b])=>a-b).flatMap(([v,i])=>(t-=v)<0?[]:i)

Try it online!

+1 for outgolfing me by 27 bytes...never would have thought of anything like this!

-3 bytes: map((...x)=>x)

@Neil Nice one! Thanks.

Charcoal, 44 bytes
Ｎθ≔ＥＮ⟦Ｎι⟧ηＷ∧η¬‹θ§⌊η⁰«≔⌊ηι≧⁻§ι⁰θ≔Φη⁻⌕ηιλη⟦Ｉ⊟ι

Try it online! Link is to verbose version of code. Explanation:
Ｎθ

Input T.
ＥＮ⟦Ｎι⟧η

Input N and make a list of N questions with their original index.
Ｗ∧η¬‹θ§⌊η⁰«

Loop until there are no more questions that can be answered in the remaining time.
≔⌊ηι

Get the shortest question and its original index.
≧⁻§ι⁰θ

Subtract the question's time from the time remaining.
≔Φη⁻⌕ηιλη

Remove the question from the list of questions.
⟦Ｉ⊟ι

Print the question's original index.

You have 3000 posts by now, congrats :)

@VerNicksaysReinstateMonica wow, I'm actually first at something ;-)

Python 3, 72 bytes
recursive solution, generating line separated console output
def f(T,L):
 if L:M=min(L);I=L.index(M);L[I]=T;T<M or(print(I),f(T-M,L))

Try it online!
def f(T,L):
 if L:            # do nothing if input is empty
  M=min(L)
  I=L.index(M)
  L[I]=T          # set found list item to remaining time (item will be ignored next iteration)
  T<M or(print(I),f(T-M,L))   # if the found question can be answered in the given time output and find next

J, 16 bytes
(>:+/\@/:~)#/:@]

Try it online!
Attempt at an explanation:
>:                create mask of left arg greater than or equal to...
  +/\@/:~         cummulative sum of sorted right arg
         #        copy where true
          /:@]    from permutation that sorts right arg

any explanation?

@Varad Mahashabde: Here is an attempt. If you need more context please let me know.

C++11, 293 221 219 bytes
Here to decimate the competition I am not.
Notes :

g++ allows for variable-sized arrays. It saves bytes, so that what I did.
the range-based for loops needs a reference to write correctly?!

#include<iostream>
void f(int t,int c,int*a){int m,i;int y[c];for(int&b:y)b=0;for(;;){for(m=-1;y[++m]&m<c;);for(i=-1;++i<c;)if(a[m]>=a[i]&!y[i])m=i;if(t>=a[m]&!y[m]){y[m]=1;t-=a[m];}else break;}for(i=-1;++i<c;)if(y[i])std::cout<<i<<' ';}

Expanded version :
#include <iostream>

void AnswerMostOfTheQuestions(int time_left, int question_count, int answer_times[]) {
  int minimum_term;
  bool is_answered[question_count];
  for(bool& b : is_answered)
    b = 0 ; // No questions have been answered
  while (1) {
    // Find the first unanswered question
    for (minimum_term = 0; is_answered[minimum_term] and minimum_term < question_count; ++minimum_term);
    // Find unanswered question which takes least time to answer
    for (int i = 0; i < question_count; ++i)
      if(answer_times[minimum_term] >= answer_times[i] && ! is_answered[i])
        minimum_term = i;
    if (time_left >= answer_times[minimum_term] &&  not is_answered[minimum_term]) {
      // Answer question (which consumes time)
      is_answered[minimum_term] = true;
      time_left -= answer_times[minimum_term];
     }
    else break;
  }
  // Print index of every answered question
  // 'cause returning them is a waste of bytes to implement
  // Just echo it to a file or something
  for (int i = 0; i < question_count; ++i)
    if(is_answered[i])
      std::cout<<i<<' ';
}

int main(int c, char** v) {
  int question_count = atoi(v[2]), free_time = atoi(v[1]);
  int answer_times[question_count];
  for (int i = 0; i < question_count; ++i)
    answer_times[i] = atoi(v[i+3]);
  // Run solution
  AnswerMostOfTheQuestions(free_time, question_count, answer_times);
}

Try it online!

Welcome to CG&CC! I can't really help you golf this program, as I am not a C++ golfer, but I suggest you to look at tips for golfing in C++. Additionally, submissions don't have to be full programs, they can be functions taking input and outputting through their return value, which may or may not save bytes in this case.

Also, while(1) can be for(;;). I suggest adding a Try it Online! link for future submissions

for(i=3;i<c;++i) can be golfed to for(i=2;++i<c;) saving a byte.

if(t-atoi(v[m])>=0&&!y[i-3]) can be golfed to if(t>=atoi(v[m])&&!y[i-3]) saving 2 bytes.

@Noodle9 Thanks for the tip! the second one was obvious tho

@EmbodimentofIgnorance Thanks for the tips! i might actually contribute to the link

np :-) Also think you can golf bool y[c];for(bool&b:y)b=0; to int y[c];for(int&b:y)b=0; saving 2 bytes.

@Noodle9 Really torn between the neatness of bools vs the golf.Gotta go with the golf tho :-)

190 bytes

Husk, 9 bytes
↑#≤²∫O¹ηÖ

Try it online! Outputs an empty list if no solution is possible.