text:
Left Center Right (LCR) code golf
At a party, I was introduced to the game LCR. Now it's not a great game as there's no skill but only random chance. But it got me thinking, I could code this, and I made a quick program in R to model the game.
Rules of the game modified from Wikipedia to match how we played:

Each player receives at least 3 chips. Players take it in turn to roll
  three six-sided dice, each of which is marked with "L", "C", "R" on
  one side, and a single dot on the three remaining sides. For each "L"
  or "R" thrown, the player must pass one chip to the player to their
  left or right, respectively. A "C" indicates a chip to the center
  (pot). A dot has no effect.
If a player has fewer than three chips left, they are still in the
  game but their number of chips is the number of dice they roll on
  their turn, rather than rolling all three. When a player has zero
  chips, they pass the dice on their turn, but may receive chips from
  others and take their next turn accordingly. The winner is the last
  player to put chips into the center.

Contest: write a program in your language of choice that takes input for the number of players and the number of starting chips and simulates a game of LCR, showing the state of the game after each player has rolled.
For example, a game might be output as:
[[[3,3,3,3],0],[[1,4,3,4],0],[[1,4,3,4],0],[[1,4,1,4],2],[[1,4,1,2],4],
[[0,4,1,3],4],[[0,3,2,3],4],[[0,3,0,3],6],[[0,3,1,1],7],[[0,3,1,1],7],
[[2,0,1,1],8],[[2,0,0,1],9],[[2,0,0,0],10],[[0,1,0,0],11],
[[1,0,0,0],11],[[1,0,0,0],11],[[1,0,0,0],11],[[0,0,0,0],12]]

ht: JonathanAllan
The output doesn't have to look exactly like this, but it should be easy to discern the dice roll, how many chips each player has, and how many chips the centre has for each turn.
It's code golf so the shortest code wins.

Are we meant take # of participants and chips-per-participant and simulate an entire game?

Since it's golf, I imagine output format will be as minimal as one can get away with.

@JonathanAllan, yes to simulating entire game. And I've edited the output to be clearer, but yes to minimal clear output.

"it should be easy to discern the dice roll" - it's implicit (hence easy to discern) from the chip states, as is the player who rolled, since it's turn based. I'd argue that this example output has everything necessary: [[[3,3,3,3],0],[[1,4,3,4],0],[[1,4,3,4],0],[[1,4,1,4],2],[[1,4,1,2],4],[[0,4,1,3],4],[[0,3,2,3],4],[[0,3,0,3],6],[[0,3,1,1],7],[[0,3,1,1],7],[[2,0,1,1],8],[[2,0,0,1],9],[[2,0,0,0],10],[[0,1,0,0],11],[[1,0,0,0],11],[[1,0,0,0],11],[[1,0,0,0],11],[[0,0,0,0],12]] - is that the case?

@JonathanAllan, that works for me.

Could you please add some additional test cases?  It's not totally clear to me what's being asked.

@Jonah, edited question to hopefully clarify things.

Does last person to put chips in the center mean last person who still has chips right before all chips are in the center?

@EmbodimentofIgnorance Yes.

"When a player has zero chips, they pass the dice on their turn" Does this count as a turn we should output? Or should we output the turn of the next player in line that doesn't have 0 points?

@KevinCruijssen, good question, I guess I'll allow either way.

@CTHall In that case I've edited both my answers (Java and 05AB1E) and included both with and without. :)

@KevinCruijssen Wow, way above and beyond.

I almost want to do this on Runic where each instruction pointer acts as a given player. Not sure I can (even ignoring number of players input), but it'd be neat if I could.

Emacs Lisp, 279 bytes
(defmacro n(i)`(incf(nth ,i c)))
(defun f(p s)(g(let((a'(0)))(dotimes(i p)(push s a))(princ a))0 p))
(defun g(c v p)(dotimes(i(min(nth v c)3))(decf(nth v c))(case(random 6)(0(n(mod(1- v)p)))(1(n(mod(1+ v)p)))(2(n p))(t(n v))))(princ c)(or(eq(-sum c)(nth p c))(g c(mod(1+ v)p)p)))

Use this function as (f 4 3).
Better readable version:
(defmacro n (i) `(incf (nth ,i c)))

(defun f(p s)
  (g
   (let ((a '(0)))
     (dotimes (i p)
       (push s a))
     (princ a))
   0
   p))

(defun g (c v p)
  (dotimes (i (min (nth v c) 3))
    (decf (nth v c))
    (case (random 6)
      (0 (n (mod (1- v) p)))
      (1 (n (mod (1+ v) p)))
      (2 (n p))
      (t (n v))))
    (princ c)
    (or (eq (-sum c) (nth p c))
    (g c (mod (1+ v) p) p)))

Output example:
(3 3 3 3 0)(1 4 3 4 0)(2 2 4 4 0)(2 2 2 5 1)(4 2 2 3 1)(2 2 2 4 2)(2 1 3 4 2)(2 2 0 4 4)(2 2 0 4 4)(1 2 0 4 5)(2 1 0 4 5)(2 1 0 4 5)(2 1 1 3 5)(0 1 1 3 7)(1 0 1 3 7)(1 0 1 3 7)(1 0 3 1 7)(1 0 3 1 7)(1 0 3 1 7)(1 1 2 1 7)(1 1 3 0 7)(0 1 3 0 8)(1 0 3 0 8)(1 1 1 1 8)(1 1 2 0 8)(0 1 2 1 8)(0 1 2 1 8)(0 1 1 1 9)(0 1 1 1 9)(0 1 1 1 9)(0 1 1 1 9)(0 1 1 1 9)(0 1 1 0 10)(0 1 1 0 10)(0 0 1 0 11)(0 0 1 0 11)(0 0 1 0 11)(0 0 1 0 11)(0 0 1 0 11)(0 0 0 0 12)

Java 8, 281 277 275 274 253 bytes
Version which outputs the same state when a turn player has 0 chips left:
p->n->{java.util.Arrays A=null;int c[]=new int[p],i=0,t,r,s=1,u,f=9;for(A.fill(c,n);s>0;f=0,System.out.print(A.toString(c)))for(t=c[++i%p],t=t>3?3:t;t-->f;r*=Math.random(),c[i%p]-=1-r/3,s=c[u=(i+r-1+p)%p]+=1-r&1-r/4,c[u]=s<0?0:s,s=A.stream(c).sum())r=6;}

Starts with the third player in the array.
Try it online.
Version which skips players with 0 chips left (274 bytes):
p->n->{java.util.Arrays A=null;int c[]=new int[p],i=p,t,r,s=1,u,f=9;for(A.fill(c,n);s>0;f=0,System.out.print(A.toString(c))){for(t=c[i%p],t=t>3?3:t;t-->f;r*=Math.random(),c[i%p]-=1-r/3,s=c[u=(i+r-1+p)%p]+=1-r&1-r/4,c[u]=s<0?0:s)r=6;for(s=A.stream(c).sum();s>0&c[++i%p]<1;);}}

Starts at the first player in the array.
Try it online.
-7 bytes thanks to @OlivierGrégoire.
Explanation (of the second version):
p->n->{                      // Method with two integer parameters and no return-type
  java.util.Arrays A=null;   //  Create a static Arrays-object to save bytes
  int c[]=new int[p],        //  Integer-array with chips of each player (0 by default)
      i=p,                   //  Index integer, starting at the amount of players
      t,                     //  Temp integer to roll 3 dice
      r,                     //  Temp integer for the dice-result
      s=1,u,                 //  Temp integers (and `s` is also the total-sum integer)
      f=9;                   //  Flag integer, starting at a single digit above 3
  for(A.fill(c,n);           //  Give each player in the array the chips
      s>0                    //  Loop as long as the total-sum is not 0 yet
      ;                      //    After every iteration:
       f=0,                  //     Set the flag to 0
       System.out.print(A.toString(c))){
                             //     Print the current state
    for(t=c[i%p],            //   Set `t` to the current player's chips
        t=t>3?3:t;           //   If this is larger than 3: set it to 3 instead
        t-->f                //   Loop that many times (1, 2, or 3)
                             //   (the flag is used to skip this loop the first iteration,
                             //   so we can print the initial state)
        ;                    //     After every iteration:
         r*=Math.random(),   //      Roll the dice in the range [0,5]
         c[i%p]-=r<3?        //      If the dice-roll is 0, 1 or 2:
                  1          //       Remove a chip from this player
                 :0,         //      Else: Leave the chip-amount the same
         s=c[u=(i+r-1+p)%p]  //      If the dice-roll is 0, go to the player left
                             //      If the dice-roll is 2, go to the player right
             +=1-r&1-r/4,    //       And add a chip to this player
         c[u]=s<0?0:s)       //      Change negative amount of chips to 0
      r=6;                   //    Reset the dice-roll to 6 so we can roll again
    for(s=A.stream(c).sum(); //   Calculate the total sum of the chips of the players
        s>0&                 //   If this sum is larger than 0:
         c[++i%p]<1;);}}     //    Determine the next player in line with at least 1 chip

Could leave my upvote without a (tiny) golf :D s=0;for(int C:c)s+=C; (21 bytes) can be replaced by s=A.stream(c).sum(); (20 bytes)

Also, not sure if entirely ok: c[i%p]-=r<3?1:0 → c[i%p]-=1-r/3. This would save 2 bytes.

@OlivierGrégoire Ah, smart way of re-using the A from java.util.Arrays. :D And by putting it in the loop to save on the semi-colon it's -2 bytes. And 1-r/3 is indeed correct (see here). Thanks.

Nice trick with the loop comparison decrementing.  I might steal that.

Ignore my previous deleted comment: my truth table was off. This is the fixed one: s=c[u=(i+r-1+p)%p]+=1-r&1-r/4 (saves 2 bytes, compared to s=c[u=(i+r%2*2-1+p)%p]+=r<2?1:0)

@OlivierGrégoire Nice one. And I almost wanted to replace the &1 for %2 out of personal preference, but then I realized the & uses the (1-r/4) in total due to - having operator precedence over & (but not %).. So thanks for the -2 bytes and wake-up call about &1 vs %2. ;)

Yes, indeed, they're not the same: this one is carefully crafted for this very specific use-case ;)

The previous bit hack can be shortened to ~r&1-r/4, for one more saved byte.

@OlivierGrégoire Was just editing something else when I saw your comment. :) Thanks again.

Python 2, 159 148 bytes
from random import*
n,c=input()
g=[c]*n;i=0
while sum(g):exec"r=randrange(6);g[i]-=1;g[i-[0,1,~-n][max(0,r-3)]]+=r>0;"*min(3,g[i]);i=(i+1)%n;print g

Try it online!
Prints all players chips after every roll

Good attempt, but the code doesn't show the amount of chips in the centre.

@CTHall The chips in the center is always equal to n*c - sum(players). If I need to explicitly write it out, I will

that's true. I'll allow it.

Jelly, 39 bytes
+2 to fix repetition behaviour (¡ must be preceded by a nilad so «3Ḣ$ -> ⁸FḢ«3)

If we can define the output lists to be rotated to have the chips belonging to the player who acted previously at the left we can do away with the right-most 6 bytes for 33 bytes (however, in my opinion, it is somewhat awkward to read that).

ẋµ’1¦‘.,2ŻX¤¦$¹Ø.X¤?⁸FḢ«3¤¡ṙ1µSÐ¿ṙ"JC$$

A dyadic Link accepting chips-per-player on the left and number-of-players on the right which yields a list of players chip counts as at the start of the game and after each turn (including turns where 0 chips forces a pass).
Try it online!
How?
Each player in turn, up to three times, depending on their chip count, flips a coin. When a player flips heads they do nothing but if they flip tails they then roll a three sided die losing a chip to L, C or R. (Note that 0 flips when a player has 0 chips is equivalent to passing.)
This is repeated until the sum of the players chips is 0.
The implementation rotates the players left by one place each turn and then rotates the resulting states back to all be aligned as if they were not.
ẋµ’1¦‘.,2ŻX¤¦$¹Ø.X¤?⁸«3Ḣ¤¡ṙ1µSÐ¿ṙ"JC$$ - Link: chipsPerPlayer, C; numberOfPlayers, P
ẋ                                      - repeat C P times (making a list of P Cs)
                              Ð¿       - collect up results in a list while...
                             S         - ...Ð¿ condition: sum (while players have chips)
 µ                          µ          - ...Ð¿ do: the monadic chain:
                         ¡             -   repeat...
                        ¤              -   ...¡ number of times: nilad and link(s) as a nilad:
                    ⁸                  -     chain's left argument (the chip list)
                     «3                -     minimum with three (vectorises)
                       Ḣ               -     head -- i.e. min(left-most player's chips, 3)
                   ?                   -   ...¡ action: if...
                  ¤                    -     ...? clause: nilad and link(s) as a nilad:
               Ø.                      -       the list [0,1]
                 X                     -       random choice (0 is falsey while 1 is truthy)
             $                         -     ...? then: last two links as a monad:
    ¦                                  -       sparsely apply...
   1                                   -       ...¦ to indices: one (the left-most)
  ’                                    -       ...¦ action: decrement (player lost a chip)
            ¦                          -       sparsely apply...
           ¤                           -       ...¦ to indices: nilad and link(s) as a nilad:
      .,2                              -         literal pair of literals .5 and two = [.5,2]
         Ż                             -         prepend a zero = [0,0.5,2]
          X                            -         random choice
                                       -         -- Note application to index .5 is a no-op
                                       -                 index 0 is the right-most entry (L)
                                       -                 index 2 is the second entry (R)
                          ṙ1           -   rotate the list left by one for the next Ð¿ loop
                                     $ - last two links as a monad:
                                    $  -   last two links as a monad:
                                  J    -     range of length -- i.e. [1,2,3,...,turns+1]
                                   C   -     complement = 1-x        [0,-1,-2,...,-turns]
                                 "     -   zipped-appliction of:
                                ṙ      -     rotate left by
                                       -   -- i.e. rotate 1st left by 0, 2nd left by -1, ...)

I'm a bit impressed as to how people code in these languages that look like line noise. :) But then I only know a couple of languages kinda, so maybe with more experience it'll come.

You could check out the tutorial at the wiki, it's pretty good. Once I post the code breakdown you will hopefully follow what I've done...

...this is subtly incorrect behavior, though?  Per spec, you need to roll all three dice, not just one coin flip.  Unless the description is in error and the code is fine.

@Stackstuck - the description overview is slightly misleading, the coin is flipped each time; I shall fix it - thanks. FWIW the code breakdown description is right - the coin flip branching, Ø.X¤?, is nested inside the repeat-up-to-3-times instruction, ⁸«3Ḣ¤¡.

Ah, okay.  Glad I could help.

On a few runs at TIO link it results in negative chips for players toward the end of the game.

@CTHall Ah, I introduced a different bug when fixing the repetition behaviour, I've now fixed that.

@JonathanAllan It's a bit hard to describe, but it appears that one rolling a die it's moving all the chips of all the players leftward or rightward. It's easiest to see what I mean in the end game.

@CTHall there is certainly something wrong, I shall have to revisit later...

@CTHall - finally came back and fixed it - I was zipping with the wrong thing to undo the rotatations at the end, just needed an extra trailing $.

C#, 356?+13? Bytes
Requires using System; for a total of +13 bytes to the code shown below, if I'm required to count that.  Otherwise just plonk it in any class and call L(players, starting chips);.
static int i,j,k,l;public static void L(int p,int s){var r=new Random();var x=new int[p];for(i=0;i<p;i++)x[i]=s;
for(i=0;i<s*p;){for(j=0;j<p;j++){for(l=0;l<x[j]&l<3;l++){k=r.Next(-1,5);if(k<2){if(k==0){x[j]--;i++;}else{x[(p+j+k)%p]++;x[j]--;}}}Console.Write(a(x)+i);}}}public static string a(int[] x){var n="|";for(l=0;l<x.Length;)n+=x[l++]+" ";
return n;}

Sample output for a 2,2 game:
|1 3 0|2 2 0|1 3 0|1 3 0|0 4 0|0 3 1|0 3 1|2 1 1|1 2 1|1 2 1|0 3 1|0 3 1|0 3 1|1 1 2|1 1 2|1 1 2|0 2 2|1 1 2|0 1 3|1 0 3|0 1 3|0 1 3|0 1 3|1 0 3|1 0 3|1 0 3|0 1 3|1 0 3|0 1 3|0 0 4

Less golfed version:
using System;
//class omitted.
static int i,j,k,l;
public static void LCR(int pl, int sc){
var r=new Random();
var state = new int[pl];
for(i=0;i<pl;i++)state[i]=sc;
for(i=0;i<sc*pl;){
    for(j=0;j<pl;j++){
        for(l=0;l<state[j] && l<3;l++){
            k=r.Next(-1,5);
            if(k<2){
                if(k==0){state[j]--;i++;}else{state[(pl+j+k)%pl]++;state[j]--;}
            }
        }
        Console.Write(a(state)+i);
    }
}
}
public static string a(int[] x){
    var n="|";
    for(l=0;l<x.Length;)n+=x[l++]+" ";
    return n;
}

Well, this is my first answer here ever.  Please don't eat me.

Ah, drat.  I got my array printing behavior confused with Java.  I'll just be...right back with a revision.

Okay, that's fixed, output should definitely work.

...oh, nope, there's one more error.

People saying modulo when the behavior is actually remainder should...not do that.  There, I'm 90% sure this works now.

okay, it is definitely working for real this time.  Praise be to repl.it.  @CT Hall does it matter if there are empty turns on the end?

I think the second function can be golfed to a lambda...

Can't, actually.  I need System for Random, too.  So it comes out 14 bytes for 13 bytes, instead of 7.

You only use the function a once, you can include it to your main function. You can also convert your main function, that's valid. Also, you can omit the using System if you switch your compiler to the Visual Interactive one. Lastly, you have extra brackets around the if, for, and else clauses

I believe I require a nonzero amount of those brackets or otherwise the loops won't work, as it is my understanding that you can only loop one statement without brackets and in several places I have two.

and similarly for the if/else.

Also I believe I tried including a in my main function and it simply did not work.  If you can pull it off though, you're welcome to steal it.

05AB1E, 58 50 49 52 49 bytes
Version which outputs the same state when a turn player has 0 chips left (50 49 52 49 bytes):
и[=ÐO_#¾è3‚Ws\F5ÝΩ©3‹iε¾¹%NQ-}®≠iε®<¾+¹%NQ+}}}}D0›*¼

Try it online.
Version which skips players with 0 chips left (58 57 60 57 bytes):
и[=DO_#[D¾èDĀ#\¼}3‚Ws\F5ÝΩ©3‹iε¾¹%NQ-}®≠iε®<¾+¹%NQ+}}}}D0›*¼

Try it online.
The first input is the amount of players, second input the amount of chips per player.
Explanation (of the second version):
и                    # Create a list with a size of the (first) implicit input,
                     # filled with the second (implicit) input
[                    # Start an infinite loop:
 =                   #  Print the list with trailing newline, without popping the list
 DO_#                #  If the total amount of chips is 0: stop the infinite loop
 [                   #  Start an inner infinite loop:
  D¾è                #   Get the chips of the I'th player (I is 0 by default)
     D               #   Duplicate this
      Ā#             #   If it is NOT 0: stop the inner infinite loop
        \            #   Remove the duplicated chips for the next iteration
         ¼           #   And increase I by 1
 }                   #  After the inner infinite loop:
 3‚ß                 #  If the amount of chips is larger than 3: use 3 instead
    F                #  Loop that many times:
     5ÝΩ             #   Roll a random dice in the range [0,5]
     ©3‹i            #   If the dice-roll is 0, 1, or 2:
         ε¾¹%NQ-}    #    Remove a chip from the I'th player
         ®≠i         #    If the dice-roll is NOT 1:
            ε®<¾+    #     Go to the player left if 0; or right if 2
            ¹%NQ+}   #     And increase that player's chips by 1
    }}}              #  Close both if-statements and the loop
       Dd*           #  Make any negative amount of chips 0
          ¼          #  Increase I by 1

I'm not sure it is working correctly. It seems players can gain chips on their turn which shouldn't happen.

@CTHall Are you sure? In which of the four TIO versions did you see this? I only checked the last (legacy version which skips players with 0 chips), but the only time it increases a player is when another player is at turn. Here is that last one with added debug-line so you can see which (0-indexed) player is at turn.

The legacy ones seem to be correct, but the nonlegacy seems to have the error I mentioned.

@CTHall Ah, you're indeed right. I see a line [2, 3, 3, 3] followed by [2, 2, 2, 6].. :S I'll see if I can find the cause and fix it. If not, I can always delete it and only use the legacy, since it outputs a lot more anyway.. The new version is pretty slow with complex loops for some reason.. >.>

@CTHall I've been able to pinpoint the issue, but unable to fix it. For some reason the order of the list get changed right after increasing the global counter_variable.. I tried to reproduce the issue in a simpler example, but am unable to. It has something to do with the nested if-statements and maps inside the infinite loop, but it's definitely weird.. Anyway, I've removed that version and now only the legacy (and faster) version remains, which works as intended.

C# (Visual C# Interactive Compiler), 201 199 bytes
n=>m=>{var r=new Random();var j=Enumerable.Repeat(n,m).ToList();for(int i=0;j.Any(c=>c>0);i++,Print(j))for(int k=0,x=r.Next(6);k++<Math.Min(j[i%m],3);j[((x<1?-1:1)+i+m)%m]+=x<2?1:0,j[i%m]-=x<3?1:0);}

Try it online!
startingChips=>playerNum=>{
//Instantiate a new random number generator
var rng = new Random();
//Create a list of chips
var players = Enumerable.Repeat(startingChips, playerNum ).ToList();
//Loop as long any player still has chips
for(int turnNum = 0;players.Any(c=>c>0);
//And print the result every iteration
i++,Print(j))
//Get a random number within the range of 0-5 and loop for...
for(int k = 0,randomNum = rng.Next(6);
//either 3 or the amount of chips we have, whichever is smaller
k++<Math.Min(players[turnNum % playerNum ],3);
//Increment either the right player if the random number is 1, else increment the right player if it is 0
players[((randomNum<1?-1:1)+ turnNum + playerNum ) % playerNum ]+=x<2?1:0,
//Decrement current player if the die roll is under 3
players[ turnNum % playerNum ]-=x<3?1:0);}

Charcoal, 61 bytes
≔⁰ηＷΣθ«≔Ｅθ⭆⌊⟦κ×³⁼λη⟧‽⁶ιＵＭθ⁻⁺⁺κ№§ι⊕λ3№§ι⊖λ5ＬΦ§ιλ›μ2≔﹪⊕ηＬθη⟦⪫θ,

Try it online! Link is to verbose version of code. Alternates between outputting the dice rolls and chips left (neither the initial number of chips nor the number of chips in the centre are included in the output). Explanation:
≔⁰η

Start with the first player.
ＷΣθ«

Repeat until nobody has any chips left.
≔Ｅθ⭆⌊⟦κ×³⁼λη⟧‽⁶ι

Roll up to three dice for the current player. These dice are labelled 0-5, where 0-2 represent the dot, 3 is pass to left, 4 is to centre, 5 is to right.
ＵＭθ⁻⁺⁺κ№§ι⊕λ3№§ι⊖λ5ＬΦ§ιλ›μ2

Add the number of chips the player on the right passed left and the number of chips the player on the left passed right, but subtract the number of chips the player themselves passed on.
≔﹪⊕ηＬθη

Advance to the next player.
⟦⪫θ,

Output the the new numbers of chips held by the players.
It's actually simpler for everyone to roll their dice simultaneously, which can be done in 50 bytes, including printing the dice rolls as well as the chips left:
ＷΣθ«≔Ｅθ⭆⌊⟦κ³⟧‽⁶ιＵＭθ⁻⁺⁺κ№§ι⊕λ3№§ι⊖λ5ＬΦ§ιλ›μ2⟦⪫ι,⪫θ,

Try it online! Link is to verbose version of code.

I'm not sure, but it doesn't seem as if it accounts for the number of chips held after each role, not each round.

@CTHall Oh, you mean each player rolls individually, and then the numbers of chips are updated? Sorry, I overlooked that. I'll update my answer as soon as I have the time.


text:
What have we got?
Inspired by, and in memory of, our beloved genius,

R.I.P.
He invented and implemented dfns — his magnum opus and the subject of the challenge.
For the interested: latest full dfns documentation and videos with John.
Task
Given an ASCII source code, answer in which of the following four categories it belongs:

Dyadic dop

Monadic dop

Dfn

Other

You may return any four consistent values, but please state your mapping if it isn't obvious.
Details
You may assume that the source code always begins with an opening curly brace { and ends with a closing curly brace }.
Recursively nested braces can occur (e.g. {{{}}}), but categories 1–3 can never have brace nesting depth go below 1 (so {}{} is "Other") and all braces must be balanced (so {{} is "Other").
Characters in the following contexts on a line are ignored:

To the right of # (a comment): significant#ignored

Enclosed in single quotes '…' (i.e. in a string): significant'ignored'significant (This applies to # too: '#'significant)

To the right of an unpaired quote ' (pairing quotes from the left): significant'ignored

In curly brace level one (i.e. excluding nested braces):

Dyadic dops contain the uninterrupted phrase ww

Monadic dops do not contain ww, but do contain aa

Dfns contain neither ww nor aa

Test cases
Dyadic dops
{ww}

{
    www
}

{
''ww'
}

{aa

ww}

{'#''#'ww?aa}

Monadic dops
{aa}

{aaaa}

{aa{ww}'ww'}

{w#w'
aa'
}

{aaw*w}

{w'\'aa\''}

Dfns
{}

{a a}

{aA}

{
{aa}
}

{w
w''w#
w}

{{
}}

{w\'aa\'}

Other
{}{}

{{}

{}}

{ww}}

{}
{}

{ww}{}

{#}

{'
'}

@LuisfelipeDejesusMunoz Dfn. If you see a reason to think otherwise, please let me know.

Can string quotes be escaped, and if so do we need to handle them? (eg: {'#\'ww?aa'} -> other?)

@Οurous No, the spec is as stated: Anything in quotes is insignificant. (Indeed, APL strings have no escape mechanism.) I'll add a case.

Hm, may we assume that strings will not contain '' (apostrophe in string, can also be parsed as two adjacent strings for this challenge)?

@EriktheOutgolfer It may occur. I'll add a case, but as you say, it doesn't matter whether 'abc''def' is parsed as one or two strings for this challenge.

JavaScript (ES6),  145 ... 138  136 bytes
Returns \$0\$ for dyadic dops, \$1\$ for monadic dops, \$2\$ for dfns and \$3\$ for other.
s=>[...s].map(c=>s=(n=`
aw}{#'`.indexOf(c))?n>5?i^=2:i?0:n>4?i=1:n>3?d++:n>2?x+=!d--:(o|=n<0|d|s!=c?0:n,c):i=0,o=i=0,x=d=-1)|x|~d?3:2>>o

Try it online!
Alternate versions

131 bytes by taking an array of characters as input
132 bytes by using Buffer() (Node.js)

How?
The input string is parsed character by character.
Translation of characters into codes
Each character \$c\$ is translated into a code \$n\$ according to the following table:
 character | code | triggered operation
-----------+------+---------------------------------------------------------
    \n     |   0  | i = 0
     a     |   1* | o |= n < 0 | d | s != c ? 0 : n
     w     |   2* | o |= n < 0 | d | s != c ? 0 : n
     }     |   3* | x += !d--
     {     |   4* | d++
     #     |   5* | i = 1
     '     |   6  | i ^= 2
   other   |  -1* | same as 'a' or 'w', but always fails because of 'n < 0'

Codes marked with a '\$*\$' have no effect when \$i\neq 0\$.
Variables describing the parser state
The following variables are used during the parsing:

\$o\$: a bitmask keeping track of encountered phrases

bit 0: a valid phrase aa has been encountered
bit 1: a valid phrase ww has been encountered

\$i\$: a bitmask telling whether some characters should be ignored

bit 0: we're currently located inside a comment
bit 1: we're currently located inside a string (this bit is still updated within a comment, but this is harmless)

\$s\$: the result of the previous iteration

\$d\$: the current depth of nested braces (starting at \$-1\$)

\$x\$: the number of times we went from depth \$0\$ to depth \$-1\$, minus \$1\$

Final result
We output \$3\$ if \$x\$ is not equal to \$0\$ or \$d\$ is not equal to \$-1\$. Otherwise, we output \$0\$, \$1\$ or \$2\$ according to the value held in \$o\$.

Jelly,  50 48 46  45 bytes
Ỵµṣ”'m2Kṣ”#Ḣ)KµċⱮƤØ{IF©<-oµ⁾waż¤ẇ€‘Ḅ«5×®¬Ḅ⁼1¤

A monadic Link accepting a list of characters which yields:
5 - Dyadic dop
4 - Monadic dop
3 - Dfn
0 - Other

Try it online! Or see a test-suite.
uses Python quoting to avoid the possibility of evaluating input as a Python set or dictionary
How?
Ỵµṣ”'m2Kṣ”#Ḣ)KµċⱮƤØ{IF©<-oµ⁾waż¤ẇ€‘Ḅ«5×®¬Ḅ⁼1¤ - Link: list of characters
                                              - breaking long Link up...
Ỵµṣ”'m2Kṣ”#Ḣ)K      - Replace any strings or comments with (single) spaces
Ỵ                   - split at newline characters
 µ          )       - monadic chain for each:
  ṣ”'               -   split at apostrophe characters
     m2             -   modulo 2 slice (i.e. every other part starting with the first
                    -   - that is, non-string code. Will remove strings from within comments)
       K            -   join with spaces
        ṣ”#         -   split at octothorp characters
           Ḣ        -   head (i.e. non-comment code)
             K      - join with spaces

µċⱮƤØ{IF©<-oµ       - Replace characters of code at depth > 1 with the integer 1
µ           µ       - monadic chain, call previous result A:
    Ø{              -   literal ['{','}']
   Ƥ                -   for prefixes of A:
  Ɱ                 -     map across right argument with:
 ċ                  -       count
      I             -   deltas (i.e. [count('}') - count('{')] for each prefix)
       F            -   flatten (i.e. count('}') - count('{') for each prefix)
                    -   -- i.e -1*depth of each character of A; closing braces at depth+1
        ©           -   (copy this list of depths to the register for later use)
         <-         -   less than -1? (vectorises)
           o        -   logical OR with A (vectorises, replacing deep code with 1s)

⁾waż¤ẇ€‘Ḅ«5×®¬Ḅ⁼1¤ - Categorise the result, R
    ¤              - nilad followed by link(s) as a nilad:
⁾wa                -   literal ['w', 'a']
   ż               -   zip with itself = [['w','w'],['a','a']]
     ẇ€            - for €ach: is a sublist of R?  i.e. one of: [0,0] [1,0] [0,1] [1,1]
       ‘           - increment (vectorises)                     [1,1] [2,1] [1,2] [2,2]
        Ḅ          - unbinary                                     3     5     4     6
         «5        - minimum with five                            3     5     4     5
                 ¤ - nilad followed by link(s) as a nilad:
            ®      -   recall depths from the register
             ¬     -   logical NOT (vectorises) (0->1, other depths->0)
              Ḅ    -   unbinary
               ⁼1  -   equal one -- i.e. depths ends with a 0 and contains no other zero
           ×       - multiply

Clean, 309 293 284 bytes
We can get away with only using 3 variable names at a time, so we'll call them a, p, and l.
import StdEnv,Text,Data.List
a=isInfixOf o zip2[2,2]
@ =['\'']
$p#p=join@[foldl((\[a:p]_|p>[]=a++[';':join@(tl p)]=split['#']a!!0)o split@)l l\\l<-mklines p]
#l=[(?a- ?l,p)\\a<-inits p&[p:l]<-tails p]
|{p\\(a,p)<-l|a<2}<>"{}"=0|a['ww']l=1|a['aa']l=2=3
?l=sum[1\\'{'<-l]-sum[1\\'}'<-l]

Try it online!
Defines the function $ :: [Char] -> Int and some helpers, giving the mapping:

0: Other
1: Dyadic dop
2: Monadic dop
3: Dfn

Expanded (first version), and with more than 3 variable names:
$ s
    # s // remove strings and comments
        = join [';'] [ // join the second argument with semicolons
            limit ( // take the first repeated element of
                iterate // an infinite list of applications of the first argument
                    (
                        (
                            \(p, q) = p ++ case q of // join the first half with a modified second half
                                ['\'\'': q] = [';': q] // replace two quotes with a semicolon
                                [c, _: q] = [c: q] // drop the character after a quote or hash
                                _ = [] // leave unmatched strings unchanged
                        ) o span // split the string on the first occurrence of
                            \c = c <> '\'' && c <> '#' // a quote or hash
                    ) l // applied to l
                )
            \\ l <- mklines s // for line l in s split at newlines
        ]
    # b // generate a map of nesting levels
        = [
            ( // the pair of
                ?i - ?t, // the nesting level
                c // the character c
            )
            \\ i <- inits s // for init i of s
            & // synchronously iterated with
                [c: t] <- tails s // character c at the start of tail [c:t] of s
        ]
    // determine what the code is
    | {c \\(n, c) <- b | n < 2} // if the string made of characters with nesting level of less than 2
        <> "{}" // is not the same as the paired braces at the beginning and end
        = 0 // return zero
    | m ['ww'] b // if there are two consecutive 'w's at nesting level 2
        = 1 // return 1
    | m ['aa'] b // if there are two consecutive 'a's at nesting level 2
        = 2 // return 2
    = 3 // otherwise return 3

Retina 0.8.2, 91 bytes
m`'.*?('|$)|#.*
¶
s(+`(?!^)\{[^{}]*\}(?!$)
¶
^(?!\{[^{}]*\}$).+
3
^.+ww.+
2
^.+aa.+
1
..+
0

Try it online! Link includes test suite. Explanation:
m`'.*?('|$)|#.*
¶

Remove strings and comments.
s(+`(?!^)\{[^{}]*\}(?!$)
¶

Remove matched brackets, working out from the innermost, but leave the first and last brackets.
^(?!\{[^{}]*\}$).+
3

If we don't have matched brackets then this is Other.
^.+ww.+
2

Otherwise if we have ww then this is Dyadic Dop.
^.+aa.+
1

Otherwise if we have aa then this is Monadic Dop.
..+
0

Otherwise if this is anything not covered above then this is Dfn.

source: Stack Exchange

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

sort: votes


text:
Python code to produce C++14 hex integer literal with ticks

tl;dr? See bottom for The Competition

Integer literals
While programming, the 64-bit hexadecimal literal 0x123456789abcdefL is difficult to gauge the size of. I find myself mentally grouping digits from the right by fours to see that it's 15 digits' worth.
Python PEP 515 allows you to express the above literal, inside code, as 0x123_4567_89ab_cdefL. If you prefer binary, then it's even more invaluable: 0b1_0010_0011_0100_0101_0110_0111_1000_1001_1010_1011_1100_1101_1110_1111L
String representations
Python can also convert an integer into strings with spacing characters, as follows:
'{:#_b}'.format(81985529216486895L)
'{:#_x}'.format(81985529216486895L)
'{:,}'.format(81985529216486895L)

The first two produce what's shown above (although without the L suffix), while the last will produce
"81,985,529,216,486,895"

Although with PEP 515, they would be better expressed as:
'{:#_b}'.format(81_985_529_216_486_895L)
'{:#_x}'.format(81_985_529_216_486_895L)
'{:,}'.format(81_985_529_216_486_895L)

Note, though, the following:

'_' is only legal for binary and hexadecimal strings - and Python will insert them every four characters (from the right);
',' is only legal for decimal strings - and Python will insert them every three characters (from the right);
No other separator characters are allowed.

Enough with the Python syntax lesson; on to C++!
C++14 also allows separators inside an integer literal to allow grouping, much like the above. Only (of course) it's a different character: the tick (single quote '). So the above literals would be:
0b1'0010'0011'0100'0101'0110'0111'1000'1001'1010'1011'1100'1101'1110'1111uL
0x123'4567'89ab'cdefuL
81'985'529'216'486'895uL

Python is often used to machine-generate C/C++ code, because it's so easy to do! But there's no native Python way to generate these new 'tick'-based identifiers - .format() can only use _. So, here's some code that I wrote to do it:
# Hex function with tick marks
def HexTicks(num) :
  # Convert to hex (without leading 0x - yet)
  s = '{:x}'.format(num)
  # Insert tick marks
  for i in range(len(s)-4, 0, -4) :
    s = s[:i] + "'" + s[i:]
  # Return the result
  return "0x" + s + "uLL"

The Competition

 Sorry @ASCII-only !

Write a Python 2.7.3 expression or lambda, smaller than the above function (not including whitespace or comments), that:

Takes any non-negative integer;
Produces the correct hexadecimal string for that integer;
With a leading 0x and trailing uLL;
No leading zeroes as part of the hex number;
With tick marks (') every four digits, counting backwards from the right;
No tick mark straight after the 0x.

ILLEGAL
0x0uLL       # If integer was anything other than zero (2.)
12'3456      # No 0x or uLL (3.)
0x0'1234uLL  # Leading zero (4.)
0x12'345uLL  # Not grouped by four (5.)
0x'1234uLL   # Tick mark before hex number (6.)

Bonuses
A. Can be easily modified to produce capital hex letters - but not the 0x or uLL parts;

Note that .format() allows '{:_X}' to capitalise the hex characters - but '{:#_X}' will capitalise the 0X too

B. An extra digits parameter that will add leading zeros to that number of digits (not resultant characters; just hex digits) - unless it's already got that many.

For example: HexTick(0x1234,6) would produce "0x00'1234uLL"

I'd advise against restricting the language here, and imposing a maximum size limit for that matter. Also, bonuses are very, very frowned because there is no objective best way to score them - in fact, in your case they provide no bonus and therefore will never be done in a seriously competing answer.

Also, if you do stick with this, please specify Python version...

What are the bonuses worth? Please give them a value.

Hi and welcome to PPCG! You seem to have put a lot of effort into understanding the quality and precision we demand from challenge writers, and for that I'd like to say thank you. However, this challenge is rather out of "culture" for this site. There are quite a few points of contention that I think the community will have, so I'd like to direct you to the sandbox where you could receive feedback before posting to the main site. Good luck :)

39 bytes :P

both bonuses, 55

@ASCII-only I really liked the (d*5-1)//4 - that's using your math! But D'oh! I fully intended on specifying Python version - and it slipped my mind while I was dreaming up potential loopholes. (Simply "0x0uLL" would have passed two minutes before I hit "Submit"!)

Oops, deleted my comment when you were writing a reply :/

wip, 73

@ASCII-only Why not post as answers?

@tsh The first two are in the wrong language, the third is WIP :P

Why is it limited to Python? Can you change the requirement so that we can provide answers in other languages?

Python 2, 68 65 bytes
-3 bytes for both thanks to tsh
lambda n:"0x"+re.sub("(?!^)(?=(....)+u)","'","%xuLL"%n)
import re

Try it online!
Eligible for both bonuses, 76 73 bytes
lambda x,d:"0x"+re.sub("(?!^)(?=(....)+u)","'","%%0%dxuLL"%d%x)
import re

Try it online!

Use import re and re.sub would save bytes.

Alternative for the same cost: lambda n:re.sub("(?<!x)(?=([^x]{4})+u)","'","%#xuLL"%n)

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


text:
Build ASCII Podiums
In sporting competitions, it often happens that winners are presented on podiums, with the first-place person on the highest in the middle, the second-place person on the middle height to the left, and the third-place person on the lowest and to the right. We're going to recreate that here with some special tweaks.
The podiums are presented below:
     @---@
     | @ |
@---@| | |
| @ || | |
| | || | |@---@
| | || | || @ |

This will form the basis for this challenge. The next step is to make the podiums wide enough to fit the people (printable ASCII strings) that are on them. However, we want to ensure aesthetic beauty (because this is a fantastic photo opportunity), so each podium needs to be the same width, and the width must be odd. Additionally, the people will (obviously) want to stand in the center of the podium, so the strings must be centered as best as possible. (You can align to either the left or the right, and it doesn't need to be consistent.) The above podiums are the minimum size, and are considered 3 wide.
For example, given the input ["Tom", "Ann", "Sue"] representing first-, second-, and third-place respectively, output the following podiums:
      Tom
     @---@
 Ann | @ |
@---@| | |
| @ || | | Sue
| | || | |@---@
| | || | || @ |

However, if we have Anne instead of Ann, we'll need to go up to the next size, 5, and center the strings as best as possible. Here, I'm aligning so the "extra" letter of Anne is to the left of center, but you can choose which side to align to.
         Tom
       @-----@
 Anne  |  @  |
@-----@|  |  |
|  @  ||  |  |  Sue
|  |  ||  |  |@-----@
|  |  ||  |  ||  @  |

Let's go for some longer names. How about ["William", "Brad", "Eugene"]:
          William
         @-------@
  Brad   |   @   |
@-------@|   |   |
|   @   ||   |   | Eugene
|   |   ||   |   |@-------@
|   |   ||   |   ||   @   |

Here we can see that Brad has a lot of whitespace, Eugene less so, and William fits just right.
For a longer test case, how about ["A", "BC", "DEFGHIJKLMNOPQRSTUVWXYZ"]:
                                     A
                         @-----------------------@
           BC            |           @           |
@-----------------------@|           |           |
|           @           ||           |           | DEFGHIJKLMNOPQRSTUVWXYZ
|           |           ||           |           |@-----------------------@
|           |           ||           |           ||           @           |

Finally, we have the smallest possible input, something like ["A", "B", "C"]:
       A
     @---@
  B  | @ |
@---@| | |
| @ || | |  C
| | || | |@---@
| | || | || @ |

Input and output can be given by any convenient method.
The input is guaranteed non-empty (i.e., you'll never receive "" as a name).
You can print it to STDOUT or return it as a function result.
Either a full program or a function are acceptable.
Any amount of extraneous whitespace is acceptable, so long as the characters line up appropriately.
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Do all even-length names have to be aligned in the same direction?

Why do the podiums in the last example output have length 3 instead of length 1?

@bruderjakob he states at the beginning "the podiums above are the minimum size and are considered 3 wide"

JavaScript (ES8), 196 bytes
a=>`141
101
521
031
236
330
332`.replace(/./g,n=>[...`@-@   |@||||`.substr(n*3,3)].join(' -'[+!+n].repeat(m/2))||a[n-=4].padStart(m+l[n]+3>>1).padEnd(m+3),m=Math.max(2,...l=a.map(s=>s.length))&~1)

Try it online!

Groovy, 187, 176, 156, 150 bytes
f={n->m=n*.size().max()|1;h=' '*(m/2);'30734715746756276647665'*.toLong().sum{(n*.center(m+2)+[' '*(m+2),"@${'-'*m}@","|$h@$h|","|$h|$h|",'\n'])[it]}}

Try it online!
(note: the tio groovy interpreter could not handle indexing Lists using Long values even though groovy 2.5.6 can. Thus the tio answer is using *.toShort() instead of *.toLong() which adds a byte)
Defines a closure f which can be called via:
println(f(['tom','ann','sue']))

where f returns a string.
Explanation:
Unobfuscating the code, we have:
f={n->
  m=n*.size().max()|1
  h=' '*(m/2)
  a=n*.center(m+2)+[' '*(m+2),"@${'-'*m}@","|$h@$h|","|$h|$h|",'\n']
  '30734715746756276647665'*.toLong().sum{a[it]}
}

f={n-> - define closure f with one in-param n
m=n*.size().max()|1 - find max name len, binary-or to odd number
h=' '*(m/2) - h will contain floor(m/2) spaces, used later
a=...- creates an encoding list with elements:

indexes 0,1,2 - names, centered to max len
index 3 - m+2 spaces
index 4 - @---@ pattern, padded to len
index 5 - | @ | pattern, padded to len
index 6 - | | | pattern, padded to len
index 7 - newline

'307...'*.toLong().sum{a[it]}- use indicies into the encoding list to build the result. .sum uses the fact that string + string in groovy is valid.
note that the expression '3073...'*.toLong() uses the *. spread operator to call toLong() on each character, returning a list of numbers.
note in the answer the variable a has been inlined,nelines removed etc.

Canvas, 45 bytes
ｒ３５１⁰｛|＊@；∔；Ｊ└ｌ２Ｍ２％±├ ××ｌ⇵╷-×└＋-α∔ｋ＋│∔⇵；｝┐＋＋⇵

Try it here!
Explanation:
r    Center the input, preferring left. Converts to an ASCII-art object
     which pads everything with spaces. This is the bulk of the magic.

 251⁰{ .... }            for each number in [2, 5, 1]:
      |*                 repeat "|" vertically that many times
        @;∔              prepend an "@" - a vertical bar for later
           ;             swap top 2 stack items - put the centered art on top
            J            push the 1st line of it (removing it from the art)
             └           order the stack to [remaining, "@¶|¶|..", currentLine]
              l          get the length of the current line
               2M        max of that and 2
                 2%      that % 2
                   ±├    (-that) + 2
                      ×× prepend (-max(len,2)%2) + 2 spaces
l                 get the length of the new string
 ⇵╷               ceil(len / 2) -1
   -×             repeat "-" that many times - half of the podiums top
     └            order stack to [art, currLine, "@¶|¶|..", "----"]
      +           append the dashes to the vertical bar = "@-----¶|¶|.."
       -α∔        vertically add "-" and the original vertical bar - "-¶@¶|¶|.."
          k       remove the last line of that to make up for the middles shortness
           +      and append that horizontally - half of the podium without the name
            │     palindromize the podium
             ∔    and prepend the name
              ⇵   reverse vertically so the outputs could be aligned to the bottom
               ;  and get the rest of the centered input on top
Finally,
┐     remove the useless now-empty input
 ++   join the 3 podium parts together
   ⇵  and undo the reversing

Abuses "and it doesn't need to be consistent", making it pretty unintelligible.

Umm...any chance of an explanation?

@MatiasBjarland though it's mostly stack manipulation and the rest i barely understand, there.

Python 2, 197 190 bytes
n=input()
w=max([3]+map(len,n))
w+=~w%2;W=w+2
S=('{:^%d}'%w).format
x,y,s='@| '
a,b,c=map(S,n);A,B,C=x+'-'*w+x,y+S(x)+y,y+S(y)+y
for l in-~W*s+a,s*W+A,s+b+s+B,A+C,B+C+s+c,C+C+A,C+C+B:print l

Try it online!
-6 bytes, thanks to Andrew Dunai

You can save 6 bytes by replacing line 5 to x,y,p='@| ' and using p instead of ' '

@andrewdunai thanks :)

Python 2, 157 bytes
a=input()
i=7
while i:print''.join(([a[k/2]]+list('-@||||    '))[7-i-k].center(max(map(len,a))|1,'- '[i+k!=6]).join('@ |'[cmp(i+k,6)]*2)for k in(2,0,4));i-=1

Try it online!

Charcoal, 63 bytes
≔÷⌈ＥθＬι²ηＦ³«Ｊ×ι⁺³⊗η⊗﹪⁻¹ι³⟦◧§θι⁺⊕η⊘⊕Ｌ§θι⟧≔⁻⁷ⅉιＰ↓ι@ηＰ↓ιＰ↓@@¹ηＰ↓ι@

Try it online! Link is to verbose version of code. Explanation:
≔÷⌈ＥθＬι²η

Calculate the number of spaces in each half of a podium.
Ｆ³«

Loop over each place. Note that input is expected to be in the order 2nd, 1st, 3rd.
Ｊ×ι⁺³⊗η⊗﹪⁻¹ι³

Position to the start of the line that will have the text.
⟦◧§θι⁺⊕η⊘⊕Ｌ§θι⟧

Output the text with enough left padding to centre it.
≔⁻⁷ⅉι

Get the height of the podium.
Ｐ↓ι@ηＰ↓ιＰ↓@@¹ηＰ↓ι@

Draw the podium.
Alternative approach, also 63 bytes:
≔÷⌈ＥθＬι²ηＦ³«Ｊ×ι⁺³⊗η⊗﹪⁻¹ι³⟦◧§θι⁺⊕η⊘⊕Ｌ§θι⪫@-@×-η⟧Ｅ⁻⁷ⅉ⪫⪫||§|@¬κ× η

Try it online! Link is to verbose version of code. Explanation:
≔÷⌈ＥθＬι²η

Calculate the number of spaces in each half of a podium.
Ｆ³«

Loop over each place. Note that input is expected to be in the order 2nd, 1st, 3rd.
Ｊ×ι⁺³⊗η⊗﹪⁻¹ι³

Position to the start of the line that will have the text.
⟦◧§θι⁺⊕η⊘⊕Ｌ§θι

Output the text with enough left padding to centre it.
⪫@-@×-η⟧

Also output the top of the podium by inserting -s between the characters of the string @-@ to reach the correct width.
Ｅ⁻⁷ⅉ⪫⪫||§|@¬κ× η

Print the remainder of the podium by spacing the |s appropriately, except that the middle character is a @ on the first row.

R 308 302 299
-6 bytes thanks to @JAD
-3 bytes thanks to @Guiseppe, now I'm under 300
function(a){i=max(1,nchar(a)%/%2)
e=2*i+1
`~`=rep
g=' '
s=g~e+2
b='@'
p='|'
t=c(b,'-'~e,b)
x=c(p,g~i,b,g~i,p)
h=sub(b,p,x)
a=lapply(a,function(q){r=nchar(q);l=(e-r)/2+1;if(r%%2<1)c(g~l,q,g~l+1)else c(g~l,q,g~l)})
cat(s,a[[1]],s,s,t,s,a[[2]],x,s,t,h,s,x,h,a[[3]],h,h,t,h,h,x,fill=length(t)*3,sep='')}

There's probably a better way to create the layout; I should try what options I have for data frames.
Try it online

304 bytes

hats off to ya for doing a variable [tag:ascii-art] challenge in R...never fun to do. You can save 3 bytes by using i=max(1,nchar(a)%/%2). Generating a matrix and using write might be shorter (rather than a data.frame). I suggest using format with j="c" to auto-justify things, and strrep is a helpful one in this case as well. Maybe try the golfR chatroom to bounce ideas off?

Yeah, I didn't realize how hard it would be going into it. I learned a bit tho, mostly I should learn Python better, or start learning Perl :). I'd forgotten about strrep; I'll have to look into that.

PHP, 147 bytes
golfed 93 bytes off my initial idea, a straight forward <?=:
for(;~$v=_616606256046543440445[++$i];)echo$b="@   || "[$v],str_pad(($v&4?"|@":$argv)[$v&3],max(array_map(strlen,$argv))," -"[!$v],2),$b,"
"[$i%3];

takes names from command line arguments. Run with -nr or try it online.
Requires PHP 7; yields warnings in PHP 7.2 (and later, presumably). See the TiO for a +5 byte fix.
mapping:
0:@---@     = top border
1,2,3       = $argv with spaces
4: "| | |"  = default
5: "| @ |"  = below top
6: "     "  = empty

breakdown:
for(;~$v=_616606256046543440445[++$i];)echo # loop through map:
    $b="@   || "[$v],                       # print left border
    str_pad(                                # print padded string:
        ($v&4?"|@":$argv)[$v&3],                # string to be padded
        max(array_map(strlen,$argv)),           # pad length = max argument length
        " -"[!$v],                              # pad with: dashes if top border, spaces else
        2                                       # option: center text (pad on both sides)
    ),
    $b,                                     # print right border
    "\n"[$i%3]                              # add linebreak every three items
;

The pre-increment for $i saves me from any tricks for the newlines.
The blank for 6 can also be empty; so I did that.
But using $argv[0] for the top border string - was the nicest golf ever. (and saved 9 bytes!)

Clean, 209 bytes
import StdEnv,Data.List
k=[' @|||||']
$l#m=max(maxList(map length l))3/2*2+1
=flatlines(transpose[(spaces(n*2)++g)%(0,6)\\n<-[1,0,2],g<-[k:[[c,'-':tl if(i==m/2)k['  '..]]\\c<-cjustify m(l!!n)&i<-[0..]]]++[k]])

Try it online!

Python 2, 188 bytes
a,b,c=l=input()
s=max(map(len,l))/2or 1
A='@'+'--'*s+'-@'
D=(' '*s).join
C=D('|@|')
D=D('|||')
d=str.center
S=s*2+3
for l in' '*S+d(a,S),' '*S+A,d(b,S)+C,A+D,C+D+d(c,S),D+D+A,D+D+C:print l

Try it online!
-5 thanks to TFeld.

Go, 436 bytes
Go is terrible for golf. But:
package main;import ("fmt";"os");func main(){;z:=os.Args;f:=3;for i:=1;i<4;i++{;if len(z[i])>f{;f=len(z[i]);};};f+=1-f%2;p:=(f-1)/2+1;b:="@";for j:=0;j<f;j++{;b+="-";};b+="@";x:=fmt.Sprintf("|%*v%*v",p,"@",p,"|");y:=fmt.Sprintf("|%*v%[1]*v",p,"|");fmt.Printf("%*v%*v\n%*v%v\n%*v%*v\n%v%v\n%v%v%*v\n%v%v%v\n%v%v%v",f+2,"",p+1+len(z[1])/2,z[1],f+2,"",b,p+1+len(z[2])/2,z[2],2*f+3-p-len(z[2])/2,x,b,y,x,y,p+1+len(z[3])/2,z[3],y,y,b,y,y,x)}

Broken down:
package main
import (
  "fmt"
  "os"
)
func main() {
  z:=os.Args
  f:=3
  for i:=1;i<4;i++{
    if len(z[i])>f{
      f=len(z[i])
    }
  }
  f+=1-f%2
  p:=(f-1)/2+1
  b:="@"
  for j:=0;j<f;j++{
    b+="-"
  }
  b+="@"
  x:=fmt.Sprintf("|%*v%*v",p,"@",p,"|")
  y:=fmt.Sprintf("|%*v%[1]*v",p,"|")

  fmt.Printf("%*v%*v\n%*v%v\n%*v%*v\n%v%v\n%v%v%*v\n%v%v%v\n%v%v%v",
  f+2,"",p+1+len(z[1])/2,z[1],
  f+2,"",b,
  p+1+len(z[2])/2,z[2],2*f+3-p-len(z[2])/2,x,
  b,y,
  x,y,p+1+len(z[3])/2,z[3],
  y,y,b,y,y,x)
}

Java 8, 399 394 373 Bytes
This solution is probably way too long, but it is a solution :)

static String r(String[]p){String s="";int l[]=new int[]{p[0].length(),p[1].length(),p[2].length()},m=Math.max(l[0],Math.max(l[1],l[2]))+2,i,q,j,a,k,t;if(m%2==0)m++;if(m==3)m=5;for(i=0;i<7;i++){for(q=0;q<3;q++)for(j=0;j<m;j++){a=(2*q+1)%3;k=2*a;t=(m-l[a])/2;s+=i==k?j>=t&j<t+l[a]?p[a].charAt(j-t):" ":i==k+1?j%(m-1)==0?"@":"-":i>=k+2?j%(m-1)==0?"|":j==m/2?i==k+2?"@":"|":" ":" ";}s+="\n";}return s;}

Saved 5 Bytes by directly iterating in order (a=1,0,2 instead of q=0,1,2; a=f(q))

static String r(String[]p){String s="";int l[]=new int[]{p[0].length(),p[1].length(),p[2].length()},m=Math.max(l[0],Math.max(l[1],l[2]))+2,i,j,a,k,t;if(m%2==0)m++;if(m==3)m=5;for(i=0;i<7;i++){for(a=1;a<4;a=a==1?0:a+2)for(j=0;j<m;j++){k=2*a;t=(m-l[a])/2;s+=i==k?j>=t&j<t+l[a]?p[a].charAt(j-t):" ":i==k+1?j%(m-1)==0?"@":"-":i>=k+2?j%(m-1)==0?"|":j==m/2?i==k+2?"@":"|":" ":" ";}s+="\n";}return s;}

Saved 21 Bytes thanks to @KevinCruijssen:
static String r(String[]p){String s="";int l[]=new int[3],m=0,i,j,a,k,t;for(String x:p)l[m++]=x.length();m=Math.max(l[0],Math.max(l[1],l[2]))+2;m+=m%2<1?1:m==3?2:0;for(i=0;i<7;i++,s+="\n")for(a=1;a<4;a=a==1?0:a+2)for(j=0,k=2*a,t=(m-l[a])/2;j<m;j++)s+=i==k?j>=t&j<t+l[a]?p[a].charAt(j-t):" ":i==k+1?j%~-m<1?"@":"-":i>=k+2?j%~-m<1?"|":j==m/2?i==k+2?"@":"|":" ":" ";return s;}

As @KevinCruijssen suggested, one could also use var instead of String in Java 10+ and save some extra Bytes. I don't do this for the simple reason that I don't have Java 10 yet :D also, lambdas could be used. But this would only reduce the amount of bytes if we would leave out assigning it to a Function<String[],String> variable.
In expanded form:
static String r(String[]p){
    String s=""; //The string that will be returned
    int l[]=new int[3], //An array containing the lengths of our three names
            m=0, //tmp variable for filling l
            i,j,a,k,t; //some declarations to save a few bytes lateron
    for(String x:p) l[m++]=x.length();
    m=Math.max(l[0],Math.max(l[1],l[2]))+2;
    m+=m%2<1? //ensure odd length of the podests
        1
        :m==3?2:0; //ensure the length is at least 3 (in my code, m is the length of the podests + 2)
    for(i=0;i<7;i++,s+="\n") //iterate by row
        for(a=1;a<4;a=a==1?0:a+2) //iterate by place: a=1,0,2
            for(j=0,k=2*a,t=(m-l[a])/2;j<m;j++) //iterate by column
                //k is the row number from top in which the a-th name goes
                //t is the column at which the name starts
                //now, append the right char:
                s+=i==k? //write the name
                    j>=t&j<t+l[a]?
                        p[a].charAt(j-t)
                        :" "
                    :i==k+1? //write the top of the podest ("@---@")
                        j%~-m<1?
                            "@"
                            :"-"
                    :i>=k+2? //write the bottom of the podest ("|  |@  |")
                        j%~-m<1? //the left and right edge of the podest
                            "|"
                            :j==m/2? //the center of the podest
                                i==k+2? //are we at the first row of the bottom?
                                    "@" //the case where we have to write "| @ |"
                                    :"|" //the case "| | |"
                                :" "
                        :" "
                ;
    return s;
}

The input has to be given as String-array of length 3. An example looks like this:
public static void main(String[] args){
    System.out.print(r(new String[]{"Anthony", "Bertram", "Carlos"}));
}

Output:
          Anthony
         @-------@
 Bertram |   @   |
@-------@|   |   |
|   @   ||   |   | Carlos
|   |   ||   |   |@-------@
|   |   ||   |   ||   @   |

Nice answer, and welcome to PPCG! +1 from me! Here some basic things to golf to make it 342 bytes: Java 8+ lambda instead of regular method; Java 10+ var instead of String; filled the length-array with a for-each loop; changed if(m%2==0)m++;if(m==3)m=5; to m+=m%2<1?m==2?3:1:0 for the same effect; changed all %nr==0 to %nr<1; changed the %(m-1) to %~-m; put everything inside the loop itself so the brackets {} can be removed.

If you haven't seen it yet, Tips for golfing in Java and Tips for golfing in  might both be interesting to read through. Enjoy your stay!

@KevinCruijssen alright, thank you very much! I'll update the post!

Suggest m-l[a]>>1 instead of (m-l[a])/2 and i<k+2?" ":j%~-m<1?"|":j==m/2?i==k+2?"@":"|" instead of i>=k+2?j%~-m<1?"|":j==m/2?i==k+2?"@":"|":" "

C(GCC) 302 293 292 289 287 bytes
-6 byte thanks to ceilingcat
#define P(h,n)r=w+2-L[n];i/h?printf("%*s%*s%*s",-~r/2,D,L[n],i>h?D:N[n],r/2,D):printf(~i/h?"@%s@":"|%*s%c%*s|",~i/h?D+1:w/2,D,i>h-3?64:'|',w/2,D);
f(int**N){char L[3],w=3,i=3,r,D[99]={};for(;i--;)w=w<(L[i]=strlen(N[i]))?L[i]|1:w;memset(D+1,45,w);for(i=7;i--;puts(D)){P(4,1)P(6,0)P(2,2)}}

Run it here
Ungolfed and explained (technically you can't have comments after back slashes in macros, so this won't run)
#define P(h,n)\
    r=w+2-L[n];\ //get leftover width
    i/h?\ //if i >= h
        printf("%*s%*s%*s",-~r/2,D,L[n],i>h?D:N[n],r/2,D):\//if too high print all spaces, otherwise center the name
        printf(~i/h?"@%s@":"|%*s%c%*s|",~i/h?D+1:w/2,D,i>h-3?64:'|',w/2,D);
//if (i == h - 1) print top row using D calculated if row right below top, else print '@'(64) in center, otherwise '|'
f(int**N){
    char
        L[3],//lengths of each string
        w=3,//width (init to minimum)
        i=3,//index, used in for loops
        l,//left padding
        r,//right padding
        D[99]={};//string of '-' of correct length (max 99) but first char is null for empty string
    for(;i--;)//i was set to 3 before, i will be {2,1,0}
        w=w<(L[i]=strlen(N[i]))?//set length to str len and compare to longest width so far
            L[i]|1://set it to length if longer, but make sure it is odd
            w;//do not replace
    memset(D+1,45,w); //set the first w bits of D to '-', leaves a null terminator
    for(i=7;i--;puts(D)){//i will be {6...0}
        P(4,1)//print second place, 4 high
        P(6,0)//print first place, 6 high
        P(2,2)//print thrid place, 2 high
    }
}

Here is the calling code
int main()
{
  char* N[3] = {"Tom", "Anne", "Sue"} ;
  f(N);
}

and output
         Tom
       @-----@
  Anne |  @  |
@-----@|  |  |
|  @  ||  |  |  Sue
|  |  ||  |  |@-----@
|  |  ||  |  ||  @  |

Suggest for(;i--;memset(D+1,45,w))w=w<(L[i]=strlen(N[i]))?L[i]|1:w; instead of for(;i--;)w=w<(L[i]=strlen(N[i]))?L[i]|1:w;memset(D+1,45,w);

PowerShell for Windows, 231 223 bytes
param($a)$w=($a|% le*|sort)[-1]
if(3-gt$w){$w=3}$w+=1-$w%2
0..6|%{$r=$_
-join($a|%{$m=' -'[5-eq($o=$r+2*(++$i%3))]
$e='     @|||||'[$o]
$x=(,''*4+$_,'','@'+,'|'*4)[$o]
"$e$($x|% *ft(($x.Length+$w)/2-.1)$m|% *ht $w $m)$e"})}

Try it online!
Input is array @('second','first','third'). Unrolled version:
param($arr)
$width=($arr|% length|sort)[-1]
if(3-gt$width){$width=3}
$width+=1-$width%2

0..6|%{ $row=$_                         # 7 rows
    -join($arr|%{                       # 3 joined columns. Each column array contains 11 lines.
        $offset = $row+2*(++$i%3)       # (2,4,0) -> offset in column array #   0:
        $middle = ' -'[5-eq$offset]                                         #   1:
        $edge   = '     @|||||'[$offset]                                    #   2:
        $center = ('','','','',$_,'','@','|','|','|','|')[$offset]          #   3:
                                                                            #   4:  name
        # pad $x to a center                                                #   5: @---@
        $center = $center|% PadLeft (($center.Length+$width)/2-.1) $middle  #   6: | @ |
        $center = $center|% PadRight $width $middle                         #   7: | | |
                                                                            #   8: | | |
        # add the $edge                                                     #   9: | | |
        "$edge$center$edge"                                                 #  10: | | |
    })
}

Stax, 43 bytes
¿⌐cF◄àë+±√¼∙]╔5B\d☺↨m█ewτ─º╞═ó○♣zG-█K↨ÄV┐§x

Run and debug it


text:
Exploding Numbers
sandbox (deleted)
Lets define a matrix of 9s as:
$$ N = \begin{bmatrix} 9&9&9\\9&9&9\\9&9&9 \end{bmatrix} $$
Lets define an exploding number as a number at position \$(x,y)\$ that can be decomposed into equal integers between all its adjacent neighbors (including itself) and the absolute value of each portion is greater than 0.
From the previous matrix, lets explode the number at position \$(1,1)\$ (0 indexed)
$$ N = \begin{bmatrix} 9&9&9\\9&\color{red}9&9\\9&9&9 \end{bmatrix} $$
$$ N = \begin{bmatrix} 9+\color{red}1&9+\color{red}1&9+\color{red}1\\9+\color{red}1&\color{blue}0+\color{red}1&9+\color{red}1\\9+\color{red}1&9+\color{red}1&9+\color{red}1 \end{bmatrix} $$
$$ N = \begin{bmatrix} 10&10&10\\10&\color{red}1&10\\10&10&10 \end{bmatrix} $$
Sometimes, decomposing result into a rational number greater than 1. This is something we need to avoid when exploding numbers. In this cases the remainder will be assigned to the exploded number.
To demonstrate it, lets continue working with our previous matrix. This time we will explode the number at position \$(0,0)\$
$$ N = \begin{bmatrix} \color{red}{10}&10&10\\10&1&10\\10&10&10 \end{bmatrix} $$
Here we have 3 neightbors and the number itself. Here the equation is something like \$10/4\$ which give us 2 for each and 2 as remainder.
$$ N = \begin{bmatrix} \color{blue}2+\color{red}{2}&\color{red}{10+2}&10\\\color{red}{10+2}&\color{red}{1+2}&10\\10&10&10 \end{bmatrix} $$
$$ N = \begin{bmatrix} \color{red}{4}&12&10\\12&3&10\\10&10&10 \end{bmatrix} $$
As well, sometimes a number wont be big enough to be decomposed in equal parts (where the abs is greater than 0) between his neighbors (|rational number| < 1). In this cases we need to "borrow" from the exploded number in order to maintain the "greater than 0" condition. Lets continue with our previous example and explode the number at position \$(1,1)\$.
$$ N = \begin{bmatrix} 4&12&10\\12&\color{red}3&10\\10&10&10 \end{bmatrix} $$
$$ N = \begin{bmatrix} 4+\color{red}1&12+\color{red}1&10+\color{red}1\\12+\color{red}1&\color{blue}0+\color{red}{1}-\color{green}6&10+\color{red}1\\10+\color{red}1&10+\color{red}1&10+\color{red}1 \end{bmatrix} $$
$$ N = \begin{bmatrix} 5&13&11\\13&\color{red}{-5}&11\\11&11&11 \end{bmatrix} $$

The challenge is, given a list of \$(x,y)\$ positions and an finite non-empty array of natural numbers, return the exploded form after each number from the positions list has been exploded.

Test cases
Input: initial matrix: [[3, 3, 3], [3, 3, 3], [3, 3, 3]], numbers: [[0,0],[0,1],[0,2]]
Output: [[1, 0, 1], [5, 6, 5], [3, 3, 3]]

Input: Initial matrix: [[9, 8, 7], [8, 9, 7], [8, 7, 9]], numbers: [[0,0],[1,1],[2,2]]
Output: [[4, 11, 8],[11, 5, 10],[9, 10, 4]]

Input: Initial matrix: [[0, 0], [0, 0]], numbers: [[0,0],[0,0],[0,0]]
Output: [[-9, 3],[3, 3]]

Input: Initial Matrix: [[10, 20, 30],[30, 20, 10],[40, 50, 60]], numbers: [[0,2],[2,0],[1,1],[1,0]]
Output: [[21, 38, 13], [9, 12, 21], [21, 71, 64]]

Input: Initial Matrix: [[1]], numbers: [[0,0]]
Output: [[1]]

Input: Initial Matrix: [[1, 2, 3]], numbers: [[0,0], [0, 1]]
Output: [[1, 1, 4]]

Notes

Input/Output rules apply
You can assume input matrix will never be empty
You can assume coordinates are always going to be valid
Input coord in test cases is given as (row, column). If you need it to be (x, y) you can swap the values. If so, please state that in your answer

new to code golf; what format is the sample allowed to take these matrices in? Any format that exists in the language? String form exactly as written?

I suggest adding a test case for non-square matricies.

@Ourous uh oh, I had been writing my program assuming they were guaranteed to be square, back to the drawing board I guess

Can we assume the matrix-size is at least 2 by 2? Or can a 1 by 1 matrix be input as well?

@rtpax Any format unless the question states otherwise, yes

C(GCC) 220 216 214 212 bytes
credit to @ceilingcat for 2 bytes
#define L(v)for(int v=2;~v--;)
#define P l/C+r<0|l/C+r>=R|l%C+c<0|l%C+c>=C
f(int R,int C,int*m){for(int*i=m+R*C;~*i;) {int*M,l=*i+++C**i++,a=0,b;L(r)L(c)P?:++a;M=m+l;b=*M/a;b+=!b;*M- =b*a;L(r)L(c)M[r*C+c]+=P?0:b;}}

Run it here
a slightly less golfed version
#define L(v)for(int v=2;~v--;)
#define P l/C+r<0|l/C+r>=R|l%C+c<0|l%C+c>=C
f(int R, int C, int*m) {
    for(int*i=m+R*C;~*i;) {
        int*M,l=*i+++C**i++,a=0,b;
        L(r)
            L(c)
                P?:++a;
        M=m+l;
        b=*M/a;
        b+=!b;
        *M-=b*a;
        L(r)
            L(c)
                M[r*C+c]+=P?0:b;
    }
}

The calling code with an example
int main()
{
  int matrix[] = {3,3,3,3,3,3,3,3,3,0,0,0,1,0,2,-1};
  int rows = 3;
  int columns = 3;
  f(rows,columns,matrix);
  for(int r = 0; r < rows; ++r) {
    for(int c = 0; c < columns; ++c) {
      printf("%03d,",matrix[r*columns + c]);
    }
    printf("\n");
  }
}

and the output
001,005,003,
000,006,003,
001,005,003,

Welcome to PPCG :)

198 bytes

JavaScript (ES7),  126 125 123  121 bytes
Saved 2 bytes thanks to @Shaggy
Takes input as (matrix)(list). Outputs by modifying the matrix.
m=>a=>a.map(([Y,X])=>(g=n=>m[m.map((r,y)=>r.map((_,x)=>(x-X)**2+(y-Y)**2<3&&r[n++,x]++)),(m[Y][X]+=~n)<n||g``,Y][X]++)``)

Try it online!
How?
If we were to strictly follow the algorithm described in the challenge, we'd have to perform the following operations for each position pair \$(x,y)\$:

walk through the matrix to compute the number of neighbors \$n\$
compute \$\lfloor m(x,y) / n\rfloor\$ and deduce the quantity \$q\$ that needs to be added to each neighbor
walk through the matrix again to update each neighbor
update \$m(x,y)\$

Instead of that, we use a recursive function which executes a simpler flow of operations, repeated as many times as needed:

for each neighbor and for the reference cell itself: increment the cell and increment a counter \$n\$ (initialized to \$0\$)
subtract \$n+1\$ from the reference cell
if the above result is greater than or equal to \$n\$, do a recursive call
increment the reference cell (all steps of this kind are executed in succession when the last recursive call has completed)

The main benefit is that we only need one loop over the matrix. The second benefit is that we don't have to compute any quotient at all.
Example
$$M=\begin{pmatrix}
0&0&0\\
0&26&0\\
0&0&0
\end{pmatrix}\text{ and }(x,y)=(1,1)$$
After step 1 of the first iteration, we have:
$$M=\begin{pmatrix}
1&1&1\\
1&27&1\\
1&1&1
\end{pmatrix}\text{ and }n=9$$
And after step 2 of the first iteration:
$$M=\begin{pmatrix}
1&1&1\\
1&17&1\\
1&1&1
\end{pmatrix}$$
The key point here is that the reference cell is updated by taking only the cost (\$-9\$) into account without the gain (\$+1\$), so that we know how much we can still draw from it.
Consequently, the sum of the cells is no longer equal to \$26\$ at this point. But this will be corrected at the end of the process, where all gains on the reference cell are accounted at once.
Step 3 of the first iteration: because \$17\$ is greater than \$9\$, we do a recursive call.
After step 1 of the second iteration, we have:
$$M=\begin{pmatrix}
2&2&2\\
2&18&2\\
2&2&2
\end{pmatrix}\text{ and }n=9$$
And after step 2 of the second iteration:
$$M=\begin{pmatrix}
2&2&2\\
2&8&2\\
2&2&2
\end{pmatrix}$$
Step 3 of the second iteration: this time, we have \$8<9\$, so we stop there.
We now increment the reference cell twice (step 4 of both iterations), leading to the final result:
$$M=\begin{pmatrix}
2&2&2\\
2&10&2\\
2&2&2
\end{pmatrix}$$
Commented
m => a =>                     // m[] = input matrix, a[] = list of positions
  a.map(([Y, X]) => (         // for each pair (X, Y) in a[]:
    g = n =>                  //   g = recursive function expecting n = 0
      m[                      //
        m.map((r, y) =>       //     for each row r[] at position y in m[]:
          r.map((_, x) =>     //       for each value at position x in r[]:
            (x - X) ** 2 +    //         if the quadrance between (x, y)
            (y - Y) ** 2 < 3  //         and (X, Y) is less than 3:
            && r[n++, x]++    //           increment n and increment r[x]
          )                   //       end
        ),                    //     end
        (m[Y][X] += ~n)       //     subtract n + 1 from m[Y][X]
        < n                   //     if the result is greater than or equal to n:
        || g``,               //       do a recursive call
        Y                     //
      ][X]++                  //     increment m[Y][X]
    )``                       //   initial call to g
  )                           // end

You can save a couple of bytes by replacing both occurrences of (0) with 2 backticks.

R, 163 162 161 159 155 146 bytes
function(m,l){for(e in l){v=m[i<-e[1],j<-e[2]];s=m[x<--1:(i<dim(m))+i,y<--1:(j<ncol(m))+j];z=sum(1|s);d=max(1,v%/%z);m[x,y]=s+d;m[i,j]=v+d-d*z};m}

Try it online!
Explanation
(Corresponds to a previous version of the code)
function(m,l) {          # Take input as matrix m and 1-indexed list of explosion points l
  for(e in l) {          # Loop over the list of explosion points
    i=e[1]; j=e[2]       # Assign current coordinates to (i,j) for brevity
    x=-1:1+i             # Assign the ranges of neighboring cells: (i-1) to (i+1),
    y=-1:1+j             # and (j-1) to (j+1)
    s=                   # Take the submatrix s=m[x,y]
      m[x<-x[x<=dim(m)]  # But first trim x and y from above to prevent out of bounds errors,
     ,y<-y[y<=ncol(m)]]  # trimming from below isn't necessary, as R tolerates index 0
    z=sum(1|s)           # Count the neighbors
    d=max(1,m[i,j]%/%z)  # Estimate, how much we'll distribute to each neighbor
    m[x,y]=s+d           # Add the distributed amount to each cell of the submatrix
    m[i,j]=m[i,j]-d*z    # Subtract the total amount from the exploded cell
  }
  m                      # Return the modified matrix
}

Clean, 181 167 bytes
import StdEnv;

foldl\m(x,y)={{if(d>2)0b+e-if(d>0)0b*n\\e<-:l&v<-[0..],let{b=max m.[y,x]n/n;$a b=2+sign a-(a+1)/size b;n= $x l* $y m;d=(v-x)^2+(u-y)^2}}\\l<-:m&u<-[0..]}

Try it online!
In the form of a partially-applied function literal.
Expanded (first version):
f // functinon f on {{Int}} and [(Int,Int)]
    = foldl \m (x, y) // fold :: (a -> b -> a) a [b] -> a with first argument \ {{Int}} (Int,Int) -> {{Int}} giving \ {{Int}} [(Int,Int)] -> {{Int}}
        = {                     // an array of
            {                   // arrays of
                if(d > 2) 0 b   // the amount we give to the neighbors
                + e             // plus the current entry
                - if(d > 0) 0 b // minus the amount taken from the target entry
                * n             // times the number of neighbors, if we're on the target
            \\                  // for each
                e <-: l         // element of row l
                & v <- [0..]    // and x-index v
                , let           // local definitions:
                    b           // the amount given to the neighbors
                        = max   // we need at least 1 each, so take the largest of
                            m.[y, x] // the target entry
                            n   // or the number of neighbors
                        / n     // divide it by the number of neighbors
                    n           // the number of neighbors
                        = (     // sum of
                            1   // one
                            + s x // if x is at the left edge = 0 else 1
                            + s ( // if x is at the right edge = 0 else 1
                                size l
                                - x
                                - 1
                            )
                        ) * (   // times the sum of
                            1   // one
                            + s y // if y is at the top edge = 0 else 1
                            + s ( // if y is at the bottom edge = 0 else 1
                                size m
                                - y
                                - 1
                            )
                        )
                    d           // distance from the target point
                        = (v - x)^2
                        + (u - y)^2
            }
        \\                      // for each
            l <-: m             // row l in matrix m
            & u <- [0..]        // and y-index u
        }

Rust - 295 bytes
fn explode(p:(i8,i8),v:&mut Vec<Vec<i8>>){let x=v[p.0 as usize][p.1 as usize];let q=|x,y|x*x+y*y;loop{let mut t=0;for i in 0..v.len(){for j in 0..v[i].len(){if q(i as i8-p.0,j as i8-p.1)<3{v[i][j]+=1;v[p.0 as usize][p.1 as usize]-=1;t+=1;}}}if v[p.0 as usize][p.1 as usize]<=(x/t+x%t){break;}}}

This is pretty long due to Rust requiring unsigned integer indexing of vectors, but requiring signed integers to do subtraction resulting in negatives. However I believe my algorithm is the "shortest algorithm" so far. There is actually no need to deal with detecting edges, bottom, etc.
Notice three things: One, the sum of all cells is always constant. Two, this is a division / remainder situation, so we can apply Bresenham-algorithm style thinking. Three, the question always adds the same number to all cells within a certain distance of the special position cell, before dealing with the "extra" stuff in the special position.
Algorithm:
Store original value of cell at position P into M.
Begin Loop:
Iterate over each cell I in the matrix. If the position of cell I is within 3 Quadrance (squared distance) of the position P, then subtract 1 from cell P and add 1 to the cell I. Count how many times this is done in one iteration through the matrix.
If the value leftover in the cell at position P is less than or equal to M / Count + M modulo Count, then break the loop. Otherwise perform the loop again.
The resulting matrix will be the exploded version. Count is basically a way to count neighbors without dealing with edges. Looping is a way to break down the division/addition stuff into a repeated single addition/subtraction of one. The modulo check ensures we will have appropriate remainder left at position P to deal with 'explosions' that are not evenly divisible amongst neighbors. The do/while loop structure allows P<0 to work properly.
Ungolfed version on the Rust Playground

Such a long function name isn't necessary, any 1-byter such as f would do. But you could probably save even more bytes, by using an anonymous function: |p:(i8,i8),v:&mut Vec<Vec<i8>>|{...}

Java 10, 194 193 191 190 184 182 171 bytes
M->C->{for(var q:C){int n,X=q[0],Y=q[1],x,y,c=0;do{c++;x=n=0;for(var r:M){y=0;for(int $:r)r[y]+=Math.hypot(x-X,y++-Y)<2?++n/n:0;x++;}}while((M[X][Y]+=~n)>=n);M[X][Y]+=c;}}

Iterative port of @Arnauld's JavaScript answer.
-17 bytes thanks to @Arnauld.
Modifies the input-matrix instead of returning a new one to save bytes.
Try it online.
Explanation:
M->C->{                      // Method with two integer-matrix parameters and no return-type
  for(var q:C){              //  Loop over the coordinates:
    int n,                   //   Count integer
        X=q[0],Y=q[1],       //   The current X,Y coordinate
        x,y,                 //   Temp x,y coordinates
        c=0;                 //   Counter, starting at 0
    do{                      //   Do-while:
      c++;                   //    Increase the counter `c` by 1
      x=n=0;                 //    (Re)set both `x` and the count `n` to 0
      for(var r:M)           //    Loop over the rows `r`:
        y=0;                 //     (Re)set `y` to 0
        for(int $:r)         //     Loop over the cells of the current row:
          r[y]+=             //      Increase the value at x,y by:
            Math.hypot(      //       If the hypot (builtin for `sqrt(a*a, b*b)`) of:
              x-X,           //        the difference between `x` and `X`,
                  y++-Y)     //        and difference between `y` and `Y`
                             //        (and increase `y` by 1 afterwards with `y++`)
              <2?            //       Is smaller than 2:
                 ++n/n       //        Increase count `n` and the value at x,y both by 1
                :            //       Else:
                 0;          //        Leave the value at x,y the same by increasing by 0
       x++;}}                //     Increase `x` by 1
    while((M[X][Y]+=~n)      //    Decrease the value at X,Y by n+1
          >=n);              //    Continue the do-while if this new value is still larger
                             //    than or equal to count `n`
    M[X][Y]+=c;}}            //   Increase the value at X,Y with counter `c`

m[y] with $y$ out of bounds is OK in JS (yielding undefined), but m[y][x] with $y$ out of bounds would crash as well.

@Arnauld Ah ok. I indeed remembered out of bounds usually isn't an issue in JS, but I can understand why undefined[x] would fail. Anyway, your (x-X)**2+(y-Y)**2<3 check is pretty smart. Need to remember that when I ever want to check values in a matrix in a 3x3 block (and within bounds) around it. I think I actually have a few answers like that, where I now use a try-catch, and in one case try-finally.. Will look at those when I have some time.

171 bytes with enhanced for loops.

@Arnauld Oh nice. Now that I see it I cannot believe I hadn't thought about that when I created a port from your answer, since you do the same.. >.> ;)

Common Lisp, 498 bytes
(defmacro s(l c x)`(incf(aref m,l,c),x))
(defmacro w(a &rest f)`(if(,a(or(= l 0)(= l(d 0)))(or(= c 0)(= c(d 1)))),@f))
(defmacro d(n)`(1-(array-dimension m,n)))
(defmacro p(i l m &rest f)`(loop for,i from(1-,l)to(1+,l)when(and(>=,i 0)(<=,i,m))do,@f))
(defmacro g()`(or(p i l(d 0)(p j c(d 1)(s i j 1)))(s l c(- v))))
(defun f(m l c)(let((v(w and 4(w or 6 9))))(if (<(/(s l c 0)v)1)(g)(loop for i to(1-(/(s l c 0)v))do(g)))))
(defun c(m n)(dotimes(i(length n))(f m(nth 0(nth i n))(nth 1(nth i n))))m)

Try it online!
Use this function as (print (c #2A((3 3 3) (3 3 3) (3 3 3)) '((0 0)(0 1)(0 2))))
Better readable version:
(defmacro s (l c x)
  `(incf (aref m ,l ,c) ,x))

(defmacro w (a &rest f)
  `(if (,a (or (= l 0)
           (= l (d 0)))
       (or (= c 0)
           (= c (d 1))))
       ,@f))

(defmacro d (n)
  `(1- (array-dimension m ,n)))

(defmacro p (i l m &rest f)
  `(loop for ,i from (1- ,l) to (1+ ,l)
     when (and (>= ,i 0) (<= ,i ,m))
     do ,@f))

(defmacro g ()
  `(or(p i l (d 0)
     (p j c (d 1)
        (s i j 1)))
      (s l c (- v))))

(defun f (m l c)
  (let ((v (w and 4 (w or 6 9))))
    (if (< (/ (s l c 0) v) 1)
    (g)
      (loop for i to (1- (/ (s l c 0) v))
        do (g)))))

(defun c (m n)
  (dotimes (i (length n))
    (f m (nth 0 (nth i n))
       (nth 1 (nth i n))))
  m)

Output example:
(print (c #2A((3 3 3) (3 3 3) (3 3 3) (3 3 3) (3 3 3) (3 3 3)) '((5 0)(4 1)(0 2))))
;; #2A((3 4 0) (3 4 4) (3 3 3) (4 4 4) (5 -4 4) (1 5 4))

(print (c #2A((3 3 3) (3 3 3) (3 3 3)) '((0 0)(0 1)(0 2))))
; #2A((1 0 1) (5 6 5) (3 3 3))  => #2A((1 0 1) (5 6 5) (3 3 3))

(print (c #2A((9 8 7) (8 9 7) (8 7 9)) '((0 0)(1 1)(2 2))))
;; #2A((4 11 8) (11 5 10) (9 10 4))  => #2A((4 11 8) (11 5 10) (9 10 4))

(print (c #2A((0 0) (0 0)) '((0 0)(0 0)(0 0))))
;; #2A((-9 3) (3 3))  => #2A((-9 3) (3 3))

(print (c #2A((10 20 30)(30 20 10)(40 50 60)) '((0 2)(2 0)(1 1)(1 0))))
;; #2A((21 38 13) (9 12 21) (21 71 64))  => #2A((21 38 13) (9 12 21) (21 71 64))

Python 2, 171 bytes
M,p=input()
l=len
for i,j in p:
 y=[(i+y,j+x)for x in-1,0,1for y in-1,0,1if l(M)>j+x>-1<i+y<l(M[0])];x=max(M[i][j]/l(y),1);M[i][j]-=x*l(y)
 for i,j in y:M[i][j]+=x
print M

Try it online!


text:
Can this container hold this much liquid?
Can this container hold this much liquid?
Challenge Synopsis
As you most likely know, liquids have an indefinite shape and a definite volume. As such, they always take the shape of their container. They cannot, however, expand to fill their container.
Your job today is to determine whether or not a certain amount of liquid (represented by a certain number of L characters or numbers representing the volume of the part, as per suggestion) can fit into a container of a certain size (represented by a matrix of C characters) with some amount of empty space (represented by space characters) within it. The container will always have C characters all the way around the perimeter.
Your program will return a truthy/falsey value based on whether the liquid will fit into the container. It will only fit if there is an area of connected empty space (made up of spaces adjacent to one another horizontally, diagonally, or vertically) within the container for each part of the liquid that is separated from the rest (either by a space or by two newline characters).
Test Cases
LLL
L
-----    True
CCCCC
C  CC
C  CC
CCCCC

LLL
 LL
------   True
CCCCCC
C C  C
C  CCC
CCCCCC

L L
LLL
-----    False (Not enough space)
CCCCC
CCCCC
C  CC
CCCCC

LL
------   False (Spaces are not connected but liquid is)
CCCCCC
CCCC C
C CCCC
CCCCCC

L L
------   True
CCCCCC
CCCC C
C CCCC
CCCCCC

L L
------   True (There is a pocket of empty space which holds both parts of the liquid)
CCCCCC
CCC  C
CCCCCC
CCCCCC

L

L
------   True (There is a pocket of empty space for each part of the liquid)
CCCCCC
CCCC C
C CCCC
CCCCCC

L L L LL
------   True
CCCCCCCCC
CCCC  C C
C CCCCCCC
CCCCCC CC
CCCCCCCCC

L
L
-----    True
CCCCC
CCCCC
C  CC
CCCCC

Feel free to suggest test cases!
Rules

This is code-golf, so the shortest answer in bytes wins.
Standard loopholes are disallowed.

As I'm re-reading this challenge now, I can see another little flaw: "each amount of liquid" isn't defined. Can L L fit in a container with just one connected space of area 2? Also, I take it that "each amount" means each part of the liquid that is connected that isn't also part of a strictly larger connected part of it.

In the second example is there 1 pocket or 2 (i.e. are diagonally adjacent spaces connected)?

@JonathanAllan Yes.

@JonathanAllan Yes, 1 pocket. Sorry, that was unclear.

I'd suggest adding a test case like L\n\nL, CCCCC\nCCCCC\nC..CC\nCCCCC (. represents a space, \n represents a newline).

May we take the L text as a list of volumes (i.e. a list of the number of Ls in each amount)? Since parsing for spaces and double newlines seems unrelated to the core of the challenge. Also may we take the C text as a matrix of two distinct values instead for the same reason?

Suggested test case 3 L and one LL with spaces of size 3 and 2 (an algorithm only filling smallest spaces first with smallest pieces of liquid still to use will yield Falsey). Maybe the same but with 2 L and one LLL too, to cater for the other direction.

Thanks everyone for the suggestion! I will update it when I'm in my computer.

This question seems to be 3 distinct questions to me. The first one is parsing input L to a list of integer. The second one is parsing input C matrix to a list of integer. And the third one is a determine question for given integer bag A and B, if there is a partition in A, when sum all integers in each partition to get a bag A', every n-th greatest number in A' is smaller (<=) than n-th greatest number in B'.

@JonathanAllan I would allow you to take the L text as a list of volumes, but there is already an answer and I don't think it would be fair to change the question now.

I believe that the character form would be a prefered input format for Snails anyway. Generally loose IO requirements are preferred at PPCG, but it is certainly up to you.

Snails, 58 bytes
Input is taken exactly as in the examples.
t\ t\L{t\L?t\ z!.o=(\ ,\C},!(tz(\L!.!~|\ !.o=(\ ,\C},!(t\L

A 4 bytes longer version is fast enough to instantly complete the test cases (Try this version online):
?^
t\ t\L{t\L`?t\ z!.o=(\ ,\C},!(tz(\L!.!~|\ !.o=(\ ,\C},!(t\L

An indented formatting of the latter:
?^
    t\
    t\L
    {
        t\L`?
        t\
        z!.
        o=(\ ,\C
    },
    !(tz(
         \L!.!~
         |
         \ !.o=(\ ,\C
},
!(t\L

Could you add an explanation to the indented version? Or are you still golfing it further before adding one?

Clean, 313 bytes
import StdEnv,Data.List
?v=nub[v:[[sum s:k]\\s<-subsequences v|s>[],k<- ?(difference v s)]]
$v m#p=[[(x,y)]\\x<-[0..]&l<-m,y<-[0..]&' '<-l]
=or[and(zipWith(>=)(s++[0,0..])r)\\r<- ?v,s<-permutations(map length(foldl(\p _=nub[sort(nub(e++[(x,y)\\(u,v)<-e,x<-[u-1,u,u+1],y<-[v-1,v,v+1]|(m!!x)!!y<'C']))\\e<-p])p p))]

Try it online!
Defines the function $ :: [Int] [[Char]] -> Bool. TIO link includes a wrapper around STDIN.
? :: [Int] -> [[Int]] is a helper to generate the different ways the volumes can be combined.
Expanded:
$ v m // in function $ of v and m
    # p // define p as
        = [ // a list of
            [(x, y)]    // lists of pairs (x, y)
        \\              // for each
            x <- [0..]  // index x
            & l <- m    // at list l in m
        ,               // for each
            y <- [0..]  // index y
            & ' ' <- l  // at spaces in l
        ]
    = or [ // true if any of the list of
        and (               // true if all of
            zipWith         // element-wise application of
                (>=)            // greater than or equal to
                (s ++ [0, 0..]) // permutation s padded with zeroes
                v               // list v of volumes
        )
    \\                      // for each
        s <- permutations ( // permutation s of
            map length (    // the lengths of
                foldl       // a left-fold of
                    (\p _   // function on p discarding second argument
                        = nub [ // the unique elements of the list of
                            sort (          // sorted versions of
                                nub (       // unique lists composed of
                                    e       // list e of points in a region
                                    ++ [    // prepended to the list of
                                        (x, y)      // pairs (x, y)
                                    \\              // for each
                                        (u, v) <- e // pair (u, v) in list e
                                    ,               // for each
                                        x <- [u-1, u, u+1] // x-coordinate adjacent to u
                                    ,               // for each
                                        y <- [v-1, v, v+1] // y-coordinate adjacent to v
                                    |               // where
                                        (m!!x)!!y < 'C' // the character in m at (x, y) is a space
                                    ]
                                )
                            )
                        \\          // for each
                            e <- p  // region e in p
                        ]
                    )
                    p // applied to a starting argument of p
                    p // recursively, for each element in p
            )
        )
    ]


text:
Invert your code
Challenge
Return the full contents of your program, but inverted. How do your invert something? Well,
Letters: Take the position of the letter in the alphabet, subtract from 26, and use the letter at that position and flip the case of the letter. E.g A becomes z, and p becomes J.
Digits: Subtract from 9. E.g 6 becomes 3 and 5 becomes 4
Brackets: The brackets (){}[]<> become their corresponding closing/opening bracket. E.g [ becomes ] and > becomes <
Other

& and | swap.
' ' [space] and '\n' [newline] swap.
£ and $ swap, as do € and ¥
¢ and % swap
_ and - swap
" and ' swap
? and ! swap
: and ; swap
/ and \ swap
@ and # swap
~ and ` swap
, and . swap
© and ® swap

All other characters become their Unicode inverse (subtract from 137,374). However, if the result is specified above, you must replace it again with the replacement provided. You only need to run a maximum of two replacements on each character, so no infinite loops.
Rules

Standard loopholes are disallowed

Good luck!

"the final product cannot be inverted any more" - but if you have one of the defined replacements (e.g. a letter) you can always invert it? So what do you really mean

Also, I'd highly recommend against that arbitrary "at least 4 characters in length" restriction

Sorry, that was an oversight on my part. Fixed.

The restriction on characters is just to avoid esoteric answers.

Sure... but I highly doubt there is (or ever will be) a language that can do this in 4 bytes, and even if so, the solution wouldn't be very interesting so it's not really a problem. 4 characters... maybe, if you count combining marks on the same character as a single character, but that doesn't matter since we count in bytes here

Removed char restrictions

Would have been much better if it were a little simpler, with fewer rules of inversion. But that's just my opinion (which I am not supposed to have).

Why did you accept my answer?.. :S It's way too soon, and it's not even the shortest..

150 bytes but can't answer because on hold

R, 190 bytes; can't answer because on hold, but would like to see this challenge reopened.

bash +tr, 104 bytes

Hi there! I see that this and your previous challenge have lots of comments beneath them asking for clarification or other improvements. Since you're rather new here, I would like to point out that we have a place for challenges to get refined before they get posted here. We call it The Sandbox. I've liked both of your challenges so far, so I hope you continue to stay on PPCG and enjoy all the time you spend here. :-)

Thanks for the help @Giuseppe. I've heard of/seen the sandbox before, but wasn't sure how to use it. Thanks though - I understand now.

Hi, I've edited your question to be a bit clearer. If there is anything I've done that you feel is not what you want, please correct me. In particular, I've removed the restrictions Any reasonable language is fine, unless the \ is part of a control character, the whole thing with the monkey emoji and the [tag:kolmogorov-complexity] tag. Hopefully this can be reopened and the solutions in the comments can be posted :)

05AB1E, 147 bytes
0"D34çýεÐ.ïi9αëÐáQižiDyk52αèë']Qiº¦ë34ç39ç«UX„,.VYJćDŠåiXÂ‡YÂ‡ëÇ•2S¹•αçJ]J"D34çýεÐ.ïi9αëÐáQižiDyk52αèë']Qiº¦ë34ç39ç«UX„,.VYJćDŠåiXÂ‡YÂ‡ëÇ•2S¹•αçJ]J

Outputs:
9'x65,S0kSSxCQ47"[kS6560gd.,fcrxSdc7ir[r'x65,S0kSSxCQ47"[kS6560gd.,fcrxSdc7ir[r

Try it online.
If this can be done in 4 bytes without creating a new language doing this specific task I'd love to see it.. >.> Also, based on the characters to invert I almost have the feeling it's deliberately targeting 05AB1E.. xD Probably not the case, but almost all those characters are pretty frequently used builtins in 05AB1E..
Explanation:
quine-part:
The shortest quine for 05AB1E is this one: 0"D34çý"D34çý (14 bytes) provided by @OliverNi. My answer uses a modified version of that quine by adding at the ... here: 0"D34çý..."D34çý.... A short explanation of this quine:
0                 # Push a 0 to the stack (can be any digit)
 "D34çý"          # Push the string "D34çý" to the stack
        D         # Duplicate this string
         34ç      # Push 34 converted to an ASCII character to the stack: '"'
            ý     # Join everything on the stack (the 0 and both strings) by '"'
                  # (output the result implicitly)

Challenge part:
ε                 # Map each character in the string to:
 Ð.ïi             #  If it's an integer:
     9α           #   Get it's absolute difference with 9
 ëÐáQi            #  Else-if it's a regular letter ([A-Za-z]):
      žiD         #   Push "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" twice
         yk       #   Get the index of the current character
           52α    #   Get the absolute difference with 52
              è   #   And index it into the string again
 ë']Qi           '#  Else-if it's a "]":
      º           #   Mirror it to "]["
       ¦          #   And remove the first character so just "[" remains
  34ç             #  Push '"'
     39ç          #  Push "'"
        «         #  Merge them together: `"'`
         UX       #  Save it in variable `X`
  „,.             #  Push ",."
     VY           #  Save it in variable `Y`
       J          #  Join the character, `"'` and ",." together
        ć         #  Extract the head (the character)
         DŠ       #  Duplicate and triple-swap, so the stack becomes char, `"',.`, char
 ë         åi     #  Else-if the character is in this string:
             XÂ   #   Push variable `X` and its reverse
               ‡  #   Transliterate the character
             YÂ   #   Push variable `Y` and its reverse
               ‡  #   Transliterate the character
 ë                #  Else:
  Ç               #   Convert the character to its unicode value
   •2S¹•          #   Push compressed integer 137374
        α         #   Take the absolute difference between the two
         ç        #   Convert it to a character again
          J       #   Join (workaround because very high unicode characters are wrapped
                  #         in a list for some reason)
]                 # Close all if-else statements and map
 J                # Join every mapped character together to a single string
                  # (and output the result implicitly)

See this 05AB1E tip of mine (section How to compress large integers? to understand why •2S¹• is 137374.

Perl 6, 142 bytes
<my@a='a'..'z',@("<(|;~'@./£-".comb);my@b=@('Z'...'A'),@(Q'>)&:`"#,\=$_'.comb);"<$_>~~.EVAL".trans(pair((|@a,|@b),(|@b,|@a))).say>~~.EVAL

Try it online!
Avoids using most of the annoying to represent characters. I think this could be shorter