text:
Doubling cascade
First, a mathematical interlude, short, and worth your while:
If 0 < a < 4, the logistic function f(x) = ax(1-x) maps the interval [0,1] inside itself. This means that one can play the iteration game; for instance, if a=2, the initial value 0.3 becomes 0.42, then 0.4872, etc.
As the parameter a increases, the quadratic function f becomes more complicated in the following sense:

0 < a < 1 all initial values iterate toward 0.
1 < a < 3 0 becomes repelling, but there is a new fixed point (a-1)/a that attracts all iterations.
3 < a < 1+sqrt(6) the new fixed point becomes repelling, but a cycle of 2 attracting points appears.
3.44949... < a < 3.54409... the 2-cycle becomes repelling, but a cycle of 4 attracting points appears.
etc.

Feigenbaum noticed that the lengths of these parameter intervals decrease at a rate that gets closer and closer to 4.6692..., the Feigenbaum constant. The wonderful discovery is that this period 2 bifurcation sequence is a general phenomenon shared by any function that (like the quadratic parabola) is increasing, then decreasing. This was one of the first reports on the universality of chaos.
Now for the challenge! Write the shortest possible code that computes the Feigenbaum constant to an accuracy of your choice. The point here is not to cheat the system by encoding a number that you googled, but to actually have the computer find the value. For reference, here is the constant to 30 digits:
4.669201609102990671853203821578

I'm surprised we don't already have a challenge to compute this constant, a nice idea that we've missed. Closest seems to be to plot the logistic attractor. I'd suggest having the code take in a maximum error or number of digits and produce the constant to within that accuracy (ignoring machine limits past some point). Or maybe to compute that ratio between the i'th and (i+1)st doubling intervals, as would converge to the constant. The golfer choosing an accuracy is too vague and not hardcoding is unenforceable.

I thought hard on how to phrase the challenge. The issue is that this is a notoriously hard thing to compute accurately, so I figured people would have more fun focusing on implementing a slick method, rather than getting that extra digit by brute force. If people feel differently, I will change the rules.

What are you looking for as a slick method or avoiding brute force? Note that by default for code golfs we don't require any bounds on run-time or space, so answers tend to be very inefficient when optimized for being short. Maybe you're looking to make a fastest code or restricted complexity challenge?

Javascript, 141 138 135 131 bytes, 8 digits
It's something I guess. It should be improveable quite a bit. If anyone needs a start: how to calculate Feigenbaum. And if you rather want to know how to do it code-wise, check out this.
Copy paste the following code in your console. Calculates 4.669201668823243 (so not really precise).
b=1;c=0;e=3.2;for(i=2;i<13;i++){z=b-c;a=b+z/e;j=4;while(j--){x=y=0;k=2**i;while(k--){y=1-2*y*x;x=a-x*x;}a-=x/y}e=z/(a-b);c=b;b=a;e}

b=1;c=0;e=3.2;for(i=2;i<13;i++){z=b-c;a=b+z/e;j=4;while(j--){x=y=0;k=2**i;while(k--){y=1-2*y*x;x=a-x*x;}a-=x/y}e=z/(a-b);c=b;b=a;e}
console.log(e)

APL (Dyalog Unicode), 79 bytes
⊃⊃{⌽u,a,c÷u←b-⍨a←⍺{⍵-÷/⍵{(⍺-×⍨⊃⍵),1-2××/⍵}⍣⍺⊢0}⍣≡b+c÷⊃e b c←⍵}/(⌽2*1+⍳17),⊂*3↑1

Try it online!
Outputs 4.669201609074452565738237725929176 (10 digits). You can increase the number 17 near the end to get more correct digits; the largest number that fits within 1 minute of TIO is 22, which gives 4.669201609102976931847851885076037 (14 digits).
Dyalog APL has 128-bit floating point numbers, which gives more precision needed to get closer to the constant. Otherwise, the number simply diverges after certain number of iterations.
The algorithm itself is the same as this Python sample code, which was already referenced in Thomas W's JS answer and others.
Ungolfed with comments
func←{
  i←⍺      ⍝ Input: ⍺ ← iterations of inner-inner loop
  e b c←⍵  ⍝ Input: ⍵ ← d, a_1, a_1-a_2
  a←b+c÷e  ⍝ Initial value of a ← a_1+(a_1-a_2)÷d
  g←{      ⍝ One iteration of a:
    x y←0     ⍝ Initialize x, y to 0
    h←{       ⍝ One iteration of x,y:
      x y←⍵      ⍝ Extract x,y
      y←1-2×x×y  ⍝ Next value of y
      x←⍺-x×x    ⍝ Next value of x (here ⍺ is outer a)
      x,y        ⍝ Return x,y
    }
    x y←⍵ h⍣⍺⊢x y  ⍝ Iterate h ⍺ times (here ⍺ is outer i)
    ⍵-x÷y          ⍝ Return next value of a
  }
  a←i g⍣≡ a      ⍝ Iterate g until a does not significantly change
  (c÷a-b),a,a-b  ⍝ Return next value of d, a_1, a_1-a_2
}
⍝ Reduce from right over iteration counts starting with (2.7,1,1) and
⍝ extract the value of d
⊃⊃ func/ (⌽2*1+⍳17),⊂*3↑1

Python, 127 bytes
c,b,e=0,1,2
for i in range(2,13):a=b+(b-c)/e;exec(("x=y=0;"+"y,x=1-2*y*x,a-x*x;"*2**i+"a=a-x/y;")*17);d,c,b=(b-c)/(a-b),b,a;e=d

Credit goes for @ThomasW with his javascript answer.
Add print(d) to output 4.669201673141983. Takes a few seconds, due to the long strings being calculated before execution.

Charcoal, 84 bytes
Ａ¹βＡ⁰εＡ³·²δＦ…²¦¹³«Ａ⁺β∕⁻βεδαＦχ«Ａ⁰ξＡ⁰ψＦＸ²ι«Ａ⁻¹××ψ²ξψＡ⁻α×ξξξ»Ａ⁻α∕ξψα»Ａ∕⁻βε⁻αβδＡβεＡαβ»Ｉδ

Try it online! Link to verbose code for explanation.
Uses algorithm from here.
Prints 4.669200975097843 (6 digits)


text:
Dungeon of botdom
– of crisis and martyrdom
(that's the subtitle because subtitles are cool)
In this king-of-the-hill challenge in python (yup; you need go no farther to know you may not submit in java), you need to create a bot that plays a game very similar to welcome to the dungeon
Game Rules
(note that this is not the original game)
There is a deck, an item set, and some reward cards and death cards. Base HP is 3.
The deck consists of 13 monster cards numbered 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 9 to denote their strengths.
Item List

Demonic pact: Defeat the demon (strength 7 monster), and the monster below it on the dungeon pile.
    - (just defeats the demon if the demon was the last in the dungeon)
Health potion: When you fall to 0 HP, defeat the monster and return to 3 HP.
Holy grail: Defeat monsters of even-numbered strength (in the game, these are undead). If an even-numbered monster occurs after the demonic pact has been used, that acts first, and you will not get an extra-pact kill after this monster.
Vorpal dagger: Choose one monster before entering the dungeon; this type of monster is defeated. If the targeted monster occurs after the demonic pact has been used, that acts first, and you will not get an extra-pact kill after this monster.
Shield: Add 3 to total HP before spelunking. This does not affect usage of health potion, which will always return health to 3.
Armour: Add 5 to total HP before spelunking. This does not affect usage of health potion, which will always return health to 3.

Reward cards are used to keep track of who has succeeded in the dungeon. Death cards track who has failed in the dungeon.
Drawing Phase
Before the drawing phase begins all monster cards are returned to the deck, both players are restored to 3 HP, and all discarded items are restored such that there is one of each.
The first player decides whether to draw a card from the deck, hiding it from the other player. If so, they must choose to either place it on top of the dungeon pile or discard it along with an item of their choice. Discarded items and cards will be unavailable to either player until the next round.
After player one takes their turn, player two does the same. The players alternately decide whether to draw and what to do with the drawn card, until someone decides not to draw or a player takes the last card from the deck.
If a player decides not to draw, or draws the last card, the drawing phase ends and the other player now has to enter the dungeon and begin spelunking.
Spelunking Phase
If the Vorpal dagger has not been discarded, the spelunking player must now decide which card to apply it to. There are no active decisions to be made for the rest of this phase.
The first player takes the top card; that is, the last card placed in the dungeon, and see its strength number. If demonic pact is active from the previous turn, the drawn card is discarded. Otherwise, the player's items will be checked in the order 'demonic pact', 'holy grail', 'Vorpal dagger'. The first un-discarded item capable of defeating the drawn card will then be used, and the card discarded. If demonic pact is used, it will now be active for the next card. The used item is not discarded.
If there is no applicable item available, the strength of the card is subtracted from the player's health. If their health is no longer positive they will be restored to 3 HP and the potion discarded if available, otherwise the dungeon crawl ends and they take a death card.
While the player is not defeated and there are cards remaining in the dungeon, this process of drawing the top card is repeated. Upon successfully defeating all cards in the dungeon the dungeon crawl ends and the spelunking player collects a reward card.
Full Game Description
A game consists of a series of rounds, each having a drawing phase and then a spelunking phase. At the end of each round one player will have collected either a death card or a reward card; once a player accumulates 5 of either type the game ends. If they have 5 death cards they lose the game. If they have 5 reward cards, they win. Either way, the other player receives the opposite result. If neither player has 5 cards of one type, play progresses to the next round and the player who went second in the previous round now goes first and vice versa.
KOTH details
Each bot will play 400 games against every other bot according to the rules described above. Which bot is player one (and so goes first in the first round) alternates each game, and all state is reset between games.
Here are the items again:

Demonic pact: Defeat the demon (strength 7 monster), and the monster below it on the dungeon pile.
    - (just defeats the demon if the demon was the last in the dungeon)
Health potion: When you fall to 0 HP, defeat the monster and return to 3 HP.
Holy grail: Defeat monsters of even-numbered strength (in the game, these are undead). If an even-numbered monster occurs after the demonic pact has been used, that acts first, and you will not get an extra-pact kill after this monster.
Vorpal dagger: Choose one monster before entering the dungeon; this type of monster is defeated. If the targeted monster occurs after the demonic pact has been used, that acts first, and you will not get an extra-pact kill after this monster.
Shield: Add 3 to total HP before spelunking. This does not affect usage of health potion, which will always return health to 3.
Armour: Add 5 to total HP before spelunking. This does not affect usage of health potion, which will always return health to 3.

and the deck: 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 9.
You must implement a bot class that does not use class variables, deriving from the following base class:
class BasePlayer:
    def start_turn(self, last_turn):
        raise NotImplementedError

    def play(self, card):
        raise NotImplementedError

    def vorpal_choice(self, last_turn):
        raise NotImplementedError

    def result(self, bot, result, dungeon, vorped):
        raise NotImplementedError

This base class shows methods your class needs to implement, and the number of arguments taken by each.
Method Argument Descriptions

last_turn in vorpal_choice and start_turn is an integer or a None value. A value of 0 to 5 indicates that the enemy discarded the drawn card along with the item indicated by that value (see the list of items above). A value of 6 indicates that the enemy placed the card in the dungeon. A None value indicates that the bot is playing first in this round (not possible for vorpal_choice). In vorpal_choice last_turn is likely to be 7, indicating that they passed that turn. The only circumstance in which it is not 7 is when the enemy drew the last card.
card is a number representing the strength of one of the cards from the deck as enumerated above.

Now, the arguments for result are a little bit more complex:

bot indicates the bot which entered the dungeon. 0 indicates entering the dungeon, and 1 indicates that the enemy entered the dungeon.
result indicates the success of the trip. False indicates the spelunking bot succeeded, while True indicates they failed.
dungeon is a list of cards/ints representing the cards that were in the dungeon. The dungeon is ordered by order placed; the first card placed in the dungeon is first in the list, and the last card placed in is at the end. You will not receive any info about discarded cards; they are secret from the other bot.
vorped is an integer representing the vorpal_choice made by the spelunking bot. If bot==0, you already know this, but if bot==1, this can be useful information.

I'll be honest, I don't entirely recall why I made winning result False, but I think it was a good idea at the time.
Return Values

start_turn: Return 1 to draw a card, or 0 to pass.
play: Return 0 to 5 to discard the corresponding item and the drawn card, or 6 to place the card in the dungeon (consistent with last_turn input, except for passing, which is done during start_turn).
vorpal_choice: Return the number of the card you wish to eliminate with the Vorpal dagger (1 to eliminate 1s, 5 to eliminate 5s). Picking a non-existent card kills you (8 is illegal, 10 is illegal, 0 is illegal).
result: You may return anything, because this is an informing function to update the bot's data.

You can check out the controller here
Additional clarifications, or just repeating some small details you might have skipped past and might want to know quickly:
Bots play 400 games with each other bot.
No class variables
No targeting specific other bots
No propping up other bots
No reflection things like modifying the random module or other bots.
6 bots maximum (per person), unless it is obvious that all bots are worth including in the KOTH (but still probably don't make a bunch of bots please)

There is no specific end time for this KOTH, except the end of the bounty for what that is worth. Just try to be winning at each time.
Results so far (sorry for being rather lazy with these guys :P)
1 GrailThief 2732 0.98
2 Steve 2399 0.86
3 DevilWorshipper 1854 0.66
4 RunAway 1336 0.48
5 BoringPlayer 1190 0.42
6 SlapAndFlap 783 0.28
7 DareDevilDumDum 750 0.27
8 RandomMandom 156 0.06

Grailthief "steals" the bounty. not really, because it earned it. Good work, Sleafar!

I've actually played this game once or twice. Pretty challenging sometimes.

Nice challenge, but would you mind including the controller.  I wouldn't mind doing some testing before submitting a bot.  Additionally, if I were you, I'd put a limit on the number of bots.  Finally, the no random module rule is kinda weird.  So our bots must do the same thing every time, with no random responses?

(there is a link down the bottom. do I need to make it big and obvious?)

@gryphon wait when did I write that wtf how did I miss that in my review EDIT: oh I was just being unclear. I meant editing the random module to exploit it

OK, thanks for fixing those.  :)

YOu might want to say that the bot limit is per person (if that's what you mean), because people might take this to mean 8 bots total.  Also, I would decrease it if it is per person.  If you get 40+ bots, this will take FOREVER to run.

ehhh, tbh I doubt it will be that popular :P

2. place the item in the dungeon. The item goes in the dungeon (duh) appears to be a typo; there isn't an item mentioned at that point (you just drew a card from the monster deck). The rules should probably be clarified a bit.

@ais523 or any information known only to one player. am i being unclear again? the dungeon is only revealed at the end, so cards drawn by a bot is known only to one bot. as a bonus, cards discarded are not revealed ever. if you think "oh well then there is a probabilistic best strategy", opponent prediction is still greatly important so this is also invalid

Ah, it's currently unclear from the rules that you don't know the current contents of the dungeon (only the influence that you've personally had on it). That should almost certainly be clarified.

@myself ("ehhh, tbh I doubt it will be that popular :P") I HATE BEING RIGHT

It's likely not popular because the game is complicated. There's no clear strategies to attempt due to the "hunch" nature of the gameplay. For example, in Battleships (because that was posted recently, but I'm too lazy to write up a bot) I found the ultimate strategy (years ago): start a diagonal, hit every square on that diagonal. Then move over 4 spaces and do that diagonal. Repeat until you have to fill in like a chess board. You will, guaranteed, locate every ship before you finish.

@Draco18s this is specifically why I made it 5 games to win or lose; if your enemy tends to go lightly on the dungeon, you can try to win with that knowledge

Oh sure. I just meant that is difficult to formulate a strategy compared to other ai writing challenges. Not that it might be tough to win.

I'm really willing to create a bot for this game but I really don't understand the rules completely. Would it be possible to clarify the game a little bit? Or am I too dense?

@AlbertMasclans I think tonight I will rewrite the post, with this format: Description of original game, description of bot building, description of i/o in game

@AlbertMasclans updated if you care to answer now

@DestructibleLemon thanks a lot! I'll try indeed. I only have one last question. The cards of the dungeon will be kept in the same order as put into the dungeon? or will be shuffled? If it's the first case, it will be FIFO (queue) or FILO (stack)?

LIFO (stack). edit made

@DestructibleLemon Are you sure this line is correct: elif (not card % 2 == 0 and items[self.GRAIL]) and (card is not vorped):? If I'm not missing something, this should be actually elif (not card % 2 == 0 or not items[self.GRAIL]) and (card is not vorped):.

No, I am not. @sleafar

Are we allowed to implement part of our submission in another language?

@user1502040 I'd rather not have to run stuff in a different language, and using subprocess.Popen tends to slow things down. if you are able to have an interpreter in that program that works reasonably fast, I guess you could

GrailThief
An old and experienced dungeon crawler. He knows that most of the others hope, that the holy grail saves them, therefore he makes sure it disappears.
from base import BasePlayer
import copy

class GrailThief(BasePlayer):
    class Stats:
        def __init__(self):
            self.deck = [1, 2, 3, 4, 5] * 2 + [6, 7, 9]
            self.items = {0, 1, 2, 3, 4, 5}
            self.dungeon_known = []
            self.dungeon_unknown = 0
            self.monsters_safe = {2, 4, 6, 7}
            self.update()

        def update(self):
            self.dungeon_total = len(self.dungeon_known) + self.dungeon_unknown
            deck_factor = float(self.dungeon_unknown) / len(self.deck) if len(self.deck) > 0 else 1.0
            self.dungeon_weighted = [(i, 0.0 if i in self.monsters_safe else 1.0) for i in self.dungeon_known] + [(i, 0.0 if i in self.monsters_safe else deck_factor) for i in self.deck]
            dungeon_weighted_sums = dict.fromkeys(self.dungeon_known + self.deck, 0.0)
            for i in self.dungeon_weighted:
                dungeon_weighted_sums[i[0]] += i[0] * i[1]
            self.vorpal = max(dungeon_weighted_sums, key = dungeon_weighted_sums.get)
            if 3 in self.items:
                self.dungeon_weighted = [(i[0], 0.0 if i[0] == self.vorpal else i[1]) for i in self.dungeon_weighted]

        def discard_item(self, item, card):
            new = copy.copy(self)
            new.items = {i for i in new.items if i != item}
            if item == 0:
                new.monsters_safe = {i for i in new.monsters_safe if i != 7}
            elif item == 2:
                new.monsters_safe = {i for i in new.monsters_safe if i not in {2, 4, 6}}
            if card is not None:
                new.deck = list(new.deck)
                new.deck.remove(card)
            new.update()
            return new

        def to_dungeon(self, card):
            new = copy.copy(self)
            if card is None:
                new.dungeon_unknown += 1
            else:
                new.deck = list(new.deck)
                new.deck.remove(card)
                new.dungeon_known = list(new.dungeon_known)
                new.dungeon_known.append(card)
            new.update()
            return new

        def effective_hp(self):
            hp = 3.0
            if 1 in self.items:
                hp += 3.0
                if self.dungeon_total > 0:
                    hp += sum([(i[0] - 1) * i[1] for i in self.dungeon_weighted]) / self.dungeon_total
            if 4 in self.items:
                hp += 3.0
            if 5 in self.items:
                hp += 5.0
            return hp

        def effective_damage(self):
            damage = sum([i[0] * i[1] for i in self.dungeon_weighted])
            if 0 in self.items:
                if self.dungeon_total > 1:
                    damage -= damage / (self.dungeon_total - 1)
            return damage

    def __init__(self):
        self.stats = self.Stats()

    def process_last_turn(self, last_turn):
        if last_turn in [0, 1, 2, 3, 4, 5]:
            self.stats = self.stats.discard_item(last_turn, None)
        elif last_turn == 6:
            self.stats = self.stats.to_dungeon(None)

    def start_turn(self, last_turn):
        self.process_last_turn(last_turn)
        if self.stats.effective_hp() > self.stats.effective_damage() + 1.5:
            return 1
        else:
            return 0

    def play(self, card):
        if 2 in self.stats.items:
            self.stats = self.stats.discard_item(2, card)
            return 2
        else:
            self.stats = self.stats.to_dungeon(card)
            return 6

    def vorpal_choice(self, last_turn):
        self.process_last_turn(last_turn)
        return self.stats.vorpal

    def result(self, bot, result, dungeon, vorped):
        self.stats = self.Stats()

Results on my box.

I must say, good work! thank you for joining this koth

DevilWorshipper
My first attempt at a KOTH challenge:
from base import BasePlayer
#from random import randint

class DevilWorshipper(BasePlayer):
    def reset(self):
        self.items = [0, 1, 2, 3, 4, 5]
        self.turns = 0
        self.demon = False
        self.dragon = False

    def __init__(self):
        self.reset()

    def start_turn(self, last_turn):
        if last_turn in self.items:
            self.items.remove(last_turn)

        if last_turn is not None:
            #self.demon = True if randint(1, 13 - self.turns) <= 2 else False
            self.turns += 1

        if (((self.demon == True and not (0 in self.items)) or (self.dragon == True)) and not (3 in self.items)):
            return 0
        if (len(self.items) <= 1):
            return 0
        return 1

    def play(self, card):
        self.turns += 1

        if (card == 9):
            self.dragon = True
            return 6

        if (card == 7):
            self.demon = True
            return 6

        for i in [3, 0, 2, 1, 5, 4]:
            if (i in self.items):
                self.items.remove(i)
                return i

        return 6

    def vorpal_choice(self, last_turn):
        return 5 #If it works for others maybe it will work for us

    def result(self, bot, result, dungeon, vorped):
        self.reset()

Essentially, we get rid of the pact and the vorpal dagger, wait for the demon to get into the deck, and pass. Every round the opponent may have drawn the demon, it has the % chance that the last card the opponent drew was a demon to just assume they played the demon already.
Let me know if there's anything I did wrong; I haven't messed with python in a while, this is my first KOTH, and it's 2 am, so there's bound to be something.
EDITS:
Taking out the randomness turns out to help it a lot. With the randomness in it is very dumb. Also, as said in the comments below, it tries to summon the demon or dragon.
Steve
from base import BasePlayer
from random import choice

class Steve(BasePlayer):

    def reset(self):
        self.items = [0, 1, 2, 3, 4, 5]
        self.turns = 0
        self.dungeon = []
        self.possibledungeon = [1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 9]
        self.lastDied = 0

    def __init__(self):
        self.TRIALS = 10 #How many dungeon runs to do each turn
        self.PASS = 8    #How many dungeon runs have to have died to pass
        self.SMASHITEMS = 4 #If less dungeon runs died, smash items.
        self.reset()

    def start_turn(self, last_turn):
        if (last_turn is not None):
            self.turns += 1

            if (last_turn in self.items):
                self.items.remove(last_turn)
            else:
                self.dungeon.append(-1)

        #Check if the dungeon is lethal
        died = 0
        total_hp = 3
        if (5 in self.items):
            total_hp += 5
        if (3 in self.items):
            total_hp += 3
        vorpal = self.vorpal_choice(None)
        for i in range(self.TRIALS):
            hp = total_hp
            temppossible = self.possibledungeon.copy()
            usedpotion = False
            killedDemon = False
            #Going for a crawl
            for j in self.dungeon[::-1]:
                if (killedDemon == True): #If last round we killed the Demon
                    killedDemon = False
                    j = 0
                if (j == -1): #If we don't know what this card is
                    j = choice(temppossible)
                    temppossible.remove(j)
                if (j == 7 and 0 in self.items): #If we kill demon with the pact
                    j = 0
                    killedDemon = True
                if (j % 2 == 0 and 2 in self.items) or (j == vorpal): #If we vorpal or grail
                    j = 0

                hp -= j

                if (hp <= 0):
                    if (not usedpotion and 1 in self.items):
                        hp = 3
                        usedpotion = True
                    else:
                        died += 1
                        break

        if (died >= self.PASS):
            return 0

        died = self.lastDied
        return 1

    def play(self, card):
        self.possibledungeon.remove(card)

        if (self.lastDied < self.SMASHITEMS):
            if (7 in self.dungeon) and (0 in self.items):
                self.items.remove(0)
                return 0
            if ( (9 in self.dungeon) or (5 in self.dungeon) ) and (3 in self.items):
                self.items.remove(3)
                return 3
            for i in [2, 1, 5, 4, 3, 0]:
                if (i in self.items):
                    self.items.remove(i)
                    return i

        self.dungeon.append(card)
        return 6

    def vorpal_choice(self, last_turn):
        if (last_turn is not None):
            self.turns += 1

            if (last_turn in self.items):
                self.items.remove(last_turn)
            else:
                self.dungeon.append(-1)

        if (self.dungeon.count(5) == 2):
            return 5
        if (9 in self.dungeon):
            return 9
        if (self.dungeon.count(4) == 2 and not 2 in self.items):
            return 4
        if (7 in self.dungeon and not 0 in self.items):
            return 7
        for i in range(6)[::-1]:
            if (i+1 in self.dungeon):
                return i+1
        return 5

    def result(self, bot, result, dungeon, vorped):
        self.reset()

Steve tries to guess whether or not the dungeon is lethal. If he thinks it is, he passes. Other than that, I tried to make him get rid of items smartly. He used to adjust his PASS threshold depending on if he died in the dungeon or the opponent lived, but it ended up making him a lot dumber so I got rid of it.
He still doesn't beat GrailThief on my machine, but at least comes closer.

you know that 9 is the dragon, not the demon?

...oh. I hadn't realised that. Well, this code seems to be doing fine as is at least

I've changed the code to attempt to summon the demon or dragon.

I would like to say: nice job and also thanks for joining the koth

I will attempt to execute this some time in the future, but I currently don't have my preferred computer so it may be hard... maybe I'll ask someone else nicely to execute it for me?

Results on my machine

SlapAndFlap
First time in KOTH, so slap me hard for mistakes.
This one simpleton is always trying to remove all good items with low-strength monsters, while keep powerful ones and then just forces opponent to play.
It beats RunAway and DumDum at least :D
My other bot in deleted answer for some time, I need to fix him by tommorow
from base import BasePlayer

class SlapAndFlap(BasePlayer):

    def reset(self):
        # Monsters that you pushed in
        self.know_monster = list(self.deck)

        # Items still in game
        self.items_in_game = [True, True, True, True, True, True]

        # List of items, sorted by value
        self.valuables = [3,1,5,0,2,4]

        # Counter
        self.cards = 13

    def __init__(self):
        # Deck
        self.deck = (1,1,2,2,3,3,4,4,5,5,6,7,9)
        # Indexes of item cards
        self.items = (0, 1, 2, 3, 4, 5)

        self.reset()

    def start_turn(self, last_turn):
        if last_turn is not None:
            self.cards -= 1

        # Sneak peak at items removed by opponent
        if last_turn is not None and  last_turn < 6:
            self.items_in_game[last_turn] = False
            self.valuables.remove(last_turn)

        # Flap!
        if self.cards < 6:
            return 0
        return 1

    def play(self, card):
        if card < 6 and any(self.items_in_game):
            self.know_monster.remove(card)
            to_return = self.valuables[0]   # remove the best of the rest
            self.valuables = self.valuables[1:]
            self.items_in_game[to_return] = False
            return to_return
        else:
            return 6

    def vorpal_choice(self, last_turn):
        # We can just guess what monster will be there
        # But we know ones, we removed

        # If we have pact, no need to remove demon
        if self.items_in_game[0]:
            self.know_monster.remove(7)
        # If we have grail, no need to remove even monsters (kinda)
        if self.items_in_game[2]:
            self.know_monster = [i for i in self.know_monster if i%2]

        # Find what threatens us the most, counting its strength multiplied by number
        weight = [i * self.know_monster.count(i) for i in self.know_monster]
        return weight.index(max(weight)) + 1

    def result(self, bot, result, dungeon, vorped):
        self.reset()  # we live for the thrill, not the result!

Well, the first thing I'm going to slap you hard for is that it is  KOTH, not KOHL.

@Gryphon That one hurts :(

RandomMandom
The obligatory random bot.  Appropriately, he loses hard to the default bots, which is good, because it means that the game has at least some strategy.
from base import BasePlayer
from random import randint
from random import choice
class RandomMandom(BasePlayer):
    def __init__(self):
        self.items = [0,1,2,3,4,5]

    def start_turn(self, last_turn):
        if last_turn in self.items:
            self.items.remove(last_turn)
        if len(self.items) > 0:
            return randint(0,1)
        return 1

    def play(self, card):
        if len(self.items) > 0:
            if randint(0,1) == 1:
                selection = choice(self.items)
                self.items.remove(selection)
                return selection
        return 6

    def vorpal_choice(self, last_turn):
        return choice([1,2,3,4,5,6,7,9])

    def result(self, bot, result, dungeon, vorped):
        # Never learns
        pass

I'm confused... why does the bot always keep drawing when all items are gone? also you might want to weight it, otherwise it has a 50/50 chance of not placing anything in the dungeon and then you just look silly. PS nice name of bot

(when I said not placing anything I meant not playing any turns)

I didn't analyze the controller very closely, because I assumed that it wouldn't present me with a choice if none existed.  Also, it's a super-naive bot, because I wanted to get at least one entry in before my real entry.  I will use your feedback in the next bot.

I think you confused the deck with items. you can have no items but still have a deck and have another turn. it is unlikely given how bots will probably play to not be stupid.

also you have 75% chance of winning the bounty at this point if you do make that new bot so that'll probably be fun for you (mostly because of people not answering)

DareDevilDumDum
kinda clear. never backs down. the only way you can (consistently; RunAway loses sometimes but it still beats this most of the time) lose to this bot is if you don't remove any items or are a super coward. think of this bot as a reminder to remove items, otherwise even this can win.
from base import BasePlayer

class DareDevilDumDum(BasePlayer):
    def start_turn(self, last_turn):
        return 1  # damn squiggles. Draw a card

    def play(self, card):
        return 6+card*0  # put the card in the dungeon, and use card to avoid squiggles :P

    def vorpal_choice(self, last_turn):
        return 9+last_turn*0  # dragon

    def result(self, bot, result, dungeon, vorped):
        pass  # we live for the thrill, not the result!

And
RunAway
pretty much they remove armour and then run away some time before the end. as daredevildumdum, it doesn't remember anything, except for the number of cards in the deck (which tbh wouldn't be remembered in the actual game (you'd just check)) and whether someone removed the armour (mostly same as before).
from base import BasePlayer

class RunAway(BasePlayer):

    def __init__(self):
        self.cards = 13
        self.armoured = True

    def start_turn(self, last_turn):
        if last_turn is not None:
            self.cards -= 1  # opponents play
        if last_turn is 5:
            self.armoured = False

        if self.cards < 4:
            return 0 * last_turn  # avoid the ---noid--- squiggles
        else:
            return 1

    def play(self, card):
        if self.cards > 11 and self.armoured:  # if it is the first turn and armour has not been removed
            choice = 5  # remove armour
        else:
            choice = 6  # put the card in the dungeon
        self.cards -= 1  # this play
        return choice

    def vorpal_choice(self, last_turn):
        return 5  # without using more memory, this is the best choice statistically

    def result(self, bot, result, dungeon, vorped):
        self.cards = 13
        self.armoured = True

Also because I am special challenge poster, these bots do not count toward my bot count, because they are example bots that are dumb

Fixed the second code snippet (the beginning of it)

BoringPlayer
The opposite of RandomMandom, BoringPlayer always makes the same choices.  The problem is that it appears that it is too successful for such a simple bot.  It scores 3800+ in my local test.
from base import BasePlayer

class BoringPlayer(BasePlayer):
    def start_turn(self, last_turn):
        return 1

    def play(self, card):
        return 6

    def vorpal_choice(self, last_turn):
        return 5

    def result(self, bot, result, dungeon, vorped):
        # Never learns
        pass

This is almost identical to Daredevil except it chooses the golem for its vorpal sword. weird that you get 3800+. this seems like an obscure bug

ok, it seems like picking 5 over nine is actually a really big advantage... O_o. I guess that this is not a bug

I think that 5 over 9 is significant against runaway (because 9 was overkill anyway), and the other bots kind of need more fine tuning with their numbers anyway

I didn't intend for it to be that close to DareDevil.  I was actually working on a more sophisticated bot that tracked the cards more closely, and this was just the stub values.  However, since it outperformed everything else, I decided I should submit it anyway.  I will try to get my more sophisticated bot working to see if I can come up with a better bot.

Note to people seeing this: This bot does not mean that this simplistic strategy will dominate; the other bots are also very simple and this is why this bot wins

Yeah, come at me, bot!

even if noone else answers, can you please make a better bot so I don't have to award the bounty to this? :P

I'm trying to, but I just spent over an hour on two new bots with more complicated strategies, and they perform terribly.

source: Stack Exchange

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

sort: votes


text:
How Persistent am I?
Your Task:
Write a program or function that, when given a number, outputs its persistence.  The persistence of a number is the number of times you can add its digits before arriving at a one-digit number.  All one digit numbers have a persistence of 0.  Note that this is different from questions about finding the digital root, as those questions ask for the end result of this process, whereas this question wants the number of steps required to get there.
Input:
An integer.
Output:
The persistence of the inputted integer.
Examples:
1-->0 (1=1)
12-->1 (1+2=3)
99-->2  (9+9=18, 1+8=9)
9999-->2 (9+9+9+9=36, 3+6=9)

Scoring:
This is  code-golf, lowest score in bytes wins.

Relevant OEIS entry

Highest score in bytes wins?

Thanks, I don't know how neither I nor the sandbox caught that.

Looks like a duplicate of this.

@Emigna That was posted in 2011. It also requires a stricter IO format.

@Okx: The 2 challenges are exactly the same. The only difference is that you could check the persistence of more than 1 number at once in the other challenge. It may be better to close that challenge as a duplicate, but I would argue that they are the same.

I do agree that they are the same, but I didn't catch that when checking for dupes, and neither did anyone in the sandbox.  That one is rather old, and this one already has 7 answers, so I would say close the old one, but if you want to close this one, feel free.

@FelipeNardiBatista, I'm feeling generous, so sure.

Any language using 64 bit ints or less will only ever output 0, 1, 2, or 3. I believe the first 4 is at 19999999999999999999999 (one followed by twenty-two nines).

No, you can't dup an old question to a new question. That would set an awful precedent

Sorry - I used my dup hammer.  But if ever there were an open-and-shut dup case, this is it, IMO

@DigitalTrauma: You definitely can dupe backwards, typically in cases when there's something seriously wrong with the old challenge and the new challenge covers the same space better. It's probably inadvisable unless the old challenge is broken, though.

@ais523 Agreed - there are special cases when it is OK, but I don't think this is one of them

Jelly, 7 bytes
DS$ÐĿL’

Try it online!
How it works
DS$ÐĿL’
DS$      digital sum
   ÐĿ    apply until results not unique, collect all intermediate results
     L   length of the collection
      ’  minus 1

Python 2, 50 39 bytes
-10 thanks to @JonathanAllan
f=lambda x:x>9and-~f(sum(map(int,`x`)))

Try it online!

Brachylog, 10 bytes
;.{ẹ+}ⁱ⁾Ḋ∧

Try it online!
Explanation
;.{  }ⁱ⁾     Iterate Output times on the Input…
        Ḋ∧   …so that the result is a single digit:
   ẹ+          Sum the elements

10/10 declarative much.

Prolog (SWI), 91 90 bytes
s(A,B):-A=0,B=0;divmod(A,10,Q,R),s(Q,T),B is T+R.
p(A,B):-A<10,B=0;s(A,S),p(S,T),B is T+1.

Try it online!

C (gcc), 58 bytes
1 byte thanks to Felipe Nardi Batista and Kritixi Lithos who discovered the same golf independently.
a,m;f(n){for(m=n,a=0;m;m/=10)a+=m%10;return n>9?1+f(a):0;}

Try it online!

n>9?1+f(a):0; for 1 byte

On gcc, a,m;f(n){for(m=n,a=0;m;m/=10)a+=m%10;n=n>9?1+f(a):0;} works.

@Steadybox No, you can't convince me to write a function without the return statement.

@LeakyNun I guess your persistence fits the spirit of the challenge.

Mathematica, 48 bytes
(n=#;t=0;While[n>9,n=Tr@IntegerDigits@n;t++];t)&

but alephalpha golfed it down to...
Mathematica, 41 bytes
(t=-1;#//.n_:>Tr[t++;IntegerDigits@n];t)&

(t=-1;#//.n_:>Tr[t++;IntegerDigits@n];t)&

very nice. posted!

Javascript, 47 bytes
f=x=>x>9?f([...x+""].reduce((a,b)=>+a+ +b))+1:0

f=x=>x>9?f([...x+""].reduce((a,b)=>+a+ +b))+1:0

console.log('1 -> ' + f(1));
console.log('12 -> ' + f(12));
console.log('99 -> ' + f(99));
console.log('9999 -> ' + f(9999));

Java 8, 67 bytes
n->{int r=0,s;for(;n>9;n=s,r++)for(s=0;n>0;n/=10)s+=n%10;return r;}

Explanation:
Try it here.
n->{            // Method with integer parameter and integer return-type
  int r=0,      //  Result-count
      s;        //  Digit-sum
  for(;n>9      //  Loop as long as `n` contains more than 1 digit
      ;         //    After every iteration:
      n=s,      //     Replace the `n` with the sum of digits
      r++)      //     and increase the result-count
    for(s=0;    //   Reset the sum to 0
        n>0;    //    Inner loop (2) as long as n is larger than 0
        n/=10)  //     Divide n by 10 every iteration
      s+=n%10;  //    And increase the sum with the trailing digit
                //   End of inner loop (2) (implicit / single-line body)
                //  End of loop (1) (implicit / single-line body)
  return r;     //  Return the result-count
}               // End of method

Lua 125
function r(n,c,t,m)n=tostring(n)t,c=0,c or 0;for m=1,#n do t=t+n:sub(m,m)end return #n==1 and(print(c)or true)or r(t, c+1)end

you call it simply using r({yourNumber})

why the 3rd and 4th parameters?

print(c)or true to not print(c)

MATL, 13 bytes
t:"tFYAs]v9>s

Try it online!
Explanation
t        % Implicit input. Duplicate
:"       % Do the following that many times
  t      %   Duplicate
  FYA    %   Convert to base 10: array of decimal digits
  s      %   Sum of array
]        % End
v        % Concatenate stack vertically
9>       % Greater than 9? element-wise
s        % Sum. Implicit display

Perl 5, 32 bytes
31 bytes of code + -p flag.
$_=eval,$\++while 1<s/./+$&/g}{

Try it online!
Short explanations:
s/./+$&/g adds a + before each digit and returns the number of digits. While this number is greater  than 1, we set $_ to the value of the evaluation of this string, and increment the number of set ($\++). At the end, $\ is implicitly printed thanks to -p and }{.

05AB1E, 9 bytes
[DgiNq}SO

Explanation:
[          Start infinite loop
 D         Duplicate
  g        Length
   i       If equal to one:
    N        Push iteration number
     q       Terminate program
      }    Else:
       S     Get the characters
        O    Sum

Try it online!

Haskell, 46 45 bytes
g n|m<-sum$read.pure<$>show n,m<n=1+g m|1<3=0

Try it online!
read.pure<$>show n converts an integer n to a list of digits, applying sum to this list yields the digital sum m. If m is smaller than n then n was not yet a single digit, so we recursively call g m and add one. Otherwise 0 is returned.

Clojure, 88 bytes
#(loop[v(str %)i 0](if(=(count v)1)i(recur(str(apply +(for[c v](-(int c)48))))(inc i))))

Oddly long...

Dyalog APL, 27 bytes
{⍵≤9:0⋄1+∇+/⍵⊤⍨10⍴⍨⌈10⍟1+⍵}

Lua, 82 80 bytes
x=~~...c=0while x>9 do
c=c+1z=0while x>0 do
z=z+x%10x=x//10
end
x=z
end
print(c)

Try it online!

Braingolf, 28 bytes
V0R1>[dl2-?<1+M&+vm1+R>:v_|]

Try it online!
Explanation
V0R1>[dl2-?<1+M&+vm1+R>:v_|]  Implicit input of commandline args
V0R                           Create stack2, push 0, return to stack1
   1>                         Push 1 to bottom of stack1
     [.....................]  While loop, will run while bottom item on stack1 is not 0
      d                       Split top of stack into digits
       l2-?                   If length of stack <= 2..
           <1+                ..Move BoS to stop and increment
              M               ..Move item to stack2
               &+             ..Sum entire stack
                 vm           ..Move item back from stack2
                   1+         ..Increment top item on stack2
                     R>       ..Return to stack1 and move ToS to bottom
                       :      Else
                        v_    ..Switch to stack2 and print last item
                          |   Endif

Retina, 26 bytes
1`\d.
#$&
\d
$*
}`1+
$.&
#

Try it online! Explanation: The first stage counts the persistence: if there are at least two digits, the persistence (represented here by # signs) is incremented. The second stage converts each digit individually to unary, effectively adding them, while the third stage converts back to decimal, looping until a single digit is obtained. It then remains to count the # signs.

PHP, 58 bytes
for(;9<$a=&$argn;$a=array_sum(str_split($a)))$p++;echo+$p;

Try it online!

Swift 4, 89 bytes
func p(i:Int)->Int{return"\(i)".count==1 ?i :p(i:"\(i)".map{Int("\($0)")!}.reduce(0,+))}

Swift 4 is still in beta, so you can't run it online. If you have Xcode 9 Beta, it will work.
Un-golfed:
func p(i: Int) -> Int {
    return "\(i)".count==1 ? i : p(i: "\(i)".map{Int("\($0)")!}.reduce(0,+))
}

Here we check to see how many digits are in the number. If it is only one, we return the number. If not, we turn it into a string, change each character back into an int, get the total sum of all the digits, and run that back through the original function.

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


text:
In The Jailhouse Now
Challenge
Given an integer n (where 4<=n<=10**6) as input create an ASCII art "prison door"* measuring n-1 characters wide and n characters high, using the symbols from the example below.

Example
╔╦╗
╠╬╣
╠╬╣
╚╩╝

The characters used are as follows:
┌───────────────┬─────────┬───────┐
│ Position      │ Symbol  │ Char  │
├───────────────┼─────────┼───────┤
│ Top Left      │    ╔    │ 9556  │
├───────────────┼─────────┼───────┤
│ Top           │    ╦    │ 9574  │
├───────────────┼─────────┼───────┤
│ Top Right     │    ╗    │ 9559  │
├───────────────┼─────────┼───────┤
│ Right         │    ╣    │ 9571  │
├───────────────┼─────────┼───────┤
│ Bottom Right  │    ╝    │ 9565  │
├───────────────┼─────────┼───────┤
│ Bottom        │    ╩    │ 9577  │
├───────────────┼─────────┼───────┤
│ Bottom Left   │    ╚    │ 9562  │
├───────────────┼─────────┼───────┤
│ Left          │    ╠    │ 9568  │
├───────────────┼─────────┼───────┤
│ Inner         │    ╬    │ 9580  │
└───────────────┴─────────┴───────┘

Rules

You may take input by any reasonable, convenient means as long as it's permitted by standard I/O rules.
For the purposes of this challenge, in languages where the symbols used to build the "door" are multi-byte characters, they may be counted towards your score as a single byte each.
All other characters (single- or multi-byte) should be counted as normal.
Output may not contain any trailing spaces but a trailing newline is permitted if absolutely necessary.
This is code-golf so lowest byte count wins.

Test Cases
Input: 4
Output:
╔╦╗
╠╬╣
╠╬╣
╚╩╝

Input: 8
Output:
╔╦╦╦╦╦╗
╠╬╬╬╬╬╣
╠╬╬╬╬╬╣
╠╬╬╬╬╬╣
╠╬╬╬╬╬╣
╠╬╬╬╬╬╣
╠╬╬╬╬╬╣
╚╩╩╩╩╩╝

Input: 20
Output:
╔╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╦╗
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╠╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╣
╚╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╩╝

* Yes, I'm aware that the bigger it gets the less it looks like a prison door! :D

This would have been good if you could input both x and y dimensions

It was in the Sandbox more than long enough for you to suggest that.

Can my program contain ╬ even trough ╬ isn't in its codepage? If not, then is "'Z“ζ permitted as one byte cost (or 2)? (push 9580, convert to unicode)?

@dzaima For the purposes of this challenge, in languages where the symbols used for the "door" take multiple bytes, they may be counted towards your score as a single byte each.

@Okx  ╬ - not represetable in any byte amount, "'Z“ζ equaling one byte would be like in javascript "╬" costing 1 byte

@dzaima, unless an overwhelming case is made otherwise, the allowance applies only to those characters used in the challenge.

@Shaggy so to compete I need to count the representation of the characters as 5 bytes each?

I wish the height and width didn't differ by an odd number...

@Downvoter: feedback would be appreciated.

@Shaggy "unless an overwhelming case is made otherwise, the allowance applies only to those characters used in the challenge" So to clarify, the string of +s representing ╬ in Brainfuck would count as 9,580 bytes, not 1? :-)

How about allowing FT7, E#3, LWJ? The prison door might look a little weird; but that would resolve all codepage and counting issues.

@Titus I find the result more readable with rT7 E+3 LiJ

Java 11, 156 151 148 118 89 bytes
n->"╔"+"╦".repeat(n-=3)+"╗\n"+("╠"+"╬".repeat(n)+"╣\n").repeat(n+1)+"╚"+"╩".repeat(n)+"╝"

Try it online.
Old 118 bytes answer in Java 8:
n->{String a="╔",b="╠",c="╚";for(int i=n;i-->3;a+="╦",b+="╬")c+="╩";a+="╗\n";for(b+="╣\n";n-->2;)a+=b;return a+c+"╝";}

-30 bytes by creating a port of @raznagul C# (.NET Core) answer, after I golfed 5 bytes.
Try it here.
Explanation:
n->                    // Method with integer parameter and String return-type
  "╔"                  //  The top-left corner
  +"╦"                 //  Appended with the top edge
      .repeat(n-=3)    //  Repeated input-3 times (-2 for the corners, -1 for width)
  +"╗\n"               //  Appended with the top-right corner and a newline
  +("╠"                //   The left edge
    +"╬"               //   Appended with the middle part
        .repeat(n)     //   Repeated input-3 times (-2 for edges, -1 for width)
    +"╣\n"             //   Appended with the right edge and a newline
          ).repeat(n+1)//  And repeat this entire line n-2 times (-2 for first/last rows)
  +"╚"                 //  Appended with the bottom-left corner
  +"╩"                 //  Appended with the bottom edge
      .repeat(n)       //  Repeated input-3 times
  +"╝"                 //  Appended with the bottom-right corners

Can you save any bytes with escape/char codes instead of hardcoding them?

@TheLethalCoder Perhaps, but since the challenge rule state we can count the symbols as 1 byte each, it's probably shorter like this (hence the 156 byte-count instead of the actual 176). But feel free to try some things to make it shorter with the char-codes.

Ah I missed that part of the rules.

+1 for the goes to (-->) operator.

If you use i-->3, i-->2 and j-->3´ you can save 5 bytes by removing the n-=3andn+1`.

Charcoal, 34 - 5 = 29 bytes
Ａ⁻Ｎ³γＵＢ╬↓×╠γ╠¶╚×╩γ‖ＢＯγ‖ＢＯ↑⁺γ

Try it online! Link is to verbose version of code. 5 byte reduction is for box drawing characters.
ReflectOverlapOverlap(0) should be equivalent to ReflectMirror() but instead Charcoal just does a ReflectTransform() instead, otherwise this solution would also work for n=3. Here's a workaround which shows what would happen for n=3 for 38 - 5 = 33 bytes:
Ａ⁻Ｎ³γＵＢ╬↓×╠γ╠¶╚×╩γ¿γ‖ＢＯγ‖Ｍ‖ＢＯ↑⁺γ¹

Better still, if ReflectOverlapOverlap(0) worked, but I didn't bother supporting n=3, then I could do this for 31 - 4 = 27 bytes:
Ａ⁻Ｎ³γＵＢ╬↓×╠γ╚×╩γ‖ＢＯγ‖ＢＯ↑⁻γ¹

Hmm, didn't knew Charcoal also reflects/mirrors ╠ to ╣ and such. "Charcoal's byte-counter isn't working for some reason." Maybe Charcoal's byte-counter isn't working because those characters aren't part of its code-page? You can count them as 1 byte each according to the challenge rules though, so this is indeed 27.

@KevinCruijssen It depends on which operator you use. (I have to go back and double-check each time; there are a number of them and it gets confusing...)

@Neil Oops, that's a bug, will fix ASAP. Thanks for finding it!

@Neil Also for some reason it's broken when n=4

@ASCII-only So what's the command to reflect without axis overlap, transforming characters, and keeping the original?

That would be ReflectMirror if I'm understanding you correctly

@Neil Oh oops, they don't work with overlap = 0, sorry will fix asap

@ASCII-only Ah, so ReflectMirror() works, but ReflectMirror(:Right) gives the same results as Reflect(:Right)...

Let us continue this discussion in chat.

Charcoal, 44 42 bytes
Crossed out 44 is still regular 44
Ａ⁺±³ＮαＡ⁺¹αω╔×α╦¦╗Ｊ⁰¦¹×ω╠
¦╚×α╩¦╝Ｍ↖↑×ω╣Ｍ↙¤╬

Try it online!

Let us continue this discussion in chat.

Haskell, 75 bytes
w i(a:b:c)=a:(b<$[4..i])++c
f n=concat$w(n+1)$w n<$>["╔╦╗\n","╠╬╣\n","╚╩╝"]

Try it online!
Function w takes an integer i and a list where a is the first, b the second element and c the rest of the list and makes a new list a, followed by i-3 copies of b, followed by c. Apply w first on each each element of the list ["╔╦╗\n","╠╬╣\n","╚╩╝"] and then again (with i increased by 1) on the resulting list. Concatenate into a single list.

What is the <$ operator? Is it just >> with the arguments flipped?

@AneeshDurg: <$ is originally from Data.Functor and has been put into Prelude. It's almost the same as >>. a <$ b replaces every element in b with a, whereas b >> a expects a to be a list and concatenates length of b copies of a.  [1,2] >> "aa" -> "aaaa", "aa" <$ [1,2] -> ["aa","aa"]. Note: 'x' <$ [1,2] equals [1,2] >> "x".

GNU sed, 74 + 1 = 75 bytes
+1 byte for -r flag. Takes input as a unary number.
s/1111(1*)/╔╦\1╗\n;\1╠╬\1╣\n╚╩\1╝/
:
s/(.)1/\1\1/
t
s/;([^;\n]+)/\1\n\1/
t

Try it online!
Explanation
This is pretty simple. Suppose the input is 6 (unary 111111). The first line drops four 1s and transforms the remaining input into this:
╔╦11╗
;11╠╬11╣
╚╩11╝

The third line, in a loop, replaces every 1 with the character preceding it. This creates our columns:
╔╦╦1╗
;11╠╬11╣
╚╩11╝

╔╦╦╦╗
;11╠╬11╣
╚╩11╝

...

╔╦╦╦╗
;;;╠╬╬╬╣
╚╩╩╩╝

Notice that this has also duplicated the ; character. Finally, the fifth line, in a loop, replaces every ; character with a copy of the line that follows:
╔╦╦╦╗
;;╠╬╬╬╣
╠╬╬╬╣
╚╩╩╩╝

╔╦╦╦╗
;╠╬╬╬╣
╠╬╬╬╣
╠╬╬╬╣
╚╩╩╩╝

╔╦╦╦╗
╠╬╬╬╣
╠╬╬╬╣
╠╬╬╬╣
╠╬╬╬╣
╚╩╩╩╝

Vim, 29 bytes
3<C-x>C╔╦╗
╠╬╣
╚╩╝<Esc>h<C-v>kkx@-Pjyy@-p

Since there are control characters, here's an xxd dump:
00000000: 3318 43e2 9594 e295 a6e2 9597 0de2 95a0  3.C.............
00000010: e295 ace2 95a3 0de2 959a e295 a9e2 959d  ................
00000020: 1b68 166b 6b78 402d 506a 7979 402d 70    .h.kkx@-Pjyy@-p

Try it online! (The V interpreter seems to have issues with exotic characters, so that link uses more mundane ones.)
Explanation
3<C-x>     " Decrement the number by 3
C╔╦╗
╠╬╣
╚╩╝<Esc>   " Cut the number (goes in @- register) and enter the "template"
h<C-v>kkx  " Move to the middle column, highlight and cut it
@-P        " Paste @- copies of the cut column
jyy        " Move to the middle line and copy it
@-p        " Paste @- copies of the copied line

To confirm: Is it only the TIO interpreter that's choking on the symbols?

@Shaggy Yeah, it throws a Python error about Latin-1, not a Vim error. (I used the V page just because TIO doesn't have a plain Vim page, and I think V uses Latin-1.) Vim on my machine doesn't have any issue with the characters.

Jelly, 33 bytes
...is it 33? - it costs 5 to convert from one byte string literals (code page indexes) to the Unicode characters.
_2µ“€ðÐ‘ẋ“¡Ø¤“©ßµ‘js3x€2¦€’+⁽"7ỌY

A full program printing the result.
Try it online!
How?
_2µ“€ðÐ‘ẋ“¡Ø¤“©ßµ‘js3x€2¦€’+⁽"7ỌY - Main link: n
_2                                - subtract 2
  µ                               - start a new monadic chain with n-2 on the left
   “€ðÐ‘                          - code page indexes [12, 24, 15] (middle row characters)
        ẋ                         - repeat n-2 times (make unexpanded middle rows)
         “¡Ø¤“©ßµ‘                - code page indexes [[0,18,3],[6,21,9]] (top & bottom)
                  j               - join (one list: top + middles + bottom)
                   s3             - split into threes (separate into the unexpanded rows)
                          ’       - decrement n-2 = n-3
                        ¦€        - sparsely apply to €ach:
                       2          -   at index 2
                     x€           -   repeat €ach (expand centre of every row to n-3 chars)
                            ⁽"7   - literal 9556
                           +      - addition (0->9556; 12->9568; etc...)
                               Ọ  - cast to characters (╠; ╔; etc...)
                                Y - join with newlines
                                  - implicit print

@Shaggy - I am using 9 bytes to represent the characters inside string literals - these are code page indexes. The 5 bytes before the Y at the end, +⁽"7Ọ, adds  9556 to these and then casts to characters. Are they (the 5) free? I feel like that would be the same as if I could use the Unicode characters directly. (I could also use actual characters rather than code page indexes and use a mapping for more bytes).

Nope. After discussion, it was concluded that only the char itself can always be counted as 1, not any other representation.

Rockstar, 150 104 bytes
Listen to B
let B be-3
X's-1
say "╔"+"╦"*B+"╗"
While B-X
say "╠"+"╬"*B+"╣"
let X be+1

say "╚"+"╩"*B+"╝"

Copy Paste it here!
-46 bytes from Shaggy.
I was inspired by Shaggy from this comment.
Here's the real rock song (sort of).
Listen to the bars
Knock the bars down, down, down
Let the end be the bars
Build the end up
Shout "╔"+"╦"*the bars+"╗"
While the end ain't nothing
say "╠"+"╬"*the bars+"╣"
Knock the end down

Shout "╚"+"╩"*the bars+"╝"
Let the prison be gone

The characters for the door can be counted as 1 byte each, so this is 150 bytes. You can golf it down to 104, though.

I think you posted the wrong link, cause that looks like the original program.

That was quick! I fixed it almost straight away. Try again ;)

gotcha, now it works.

Python 3, 75 bytes
n=int(input())-3
print("╔"+"╦"*n+"╗\n"+("╠"+"╬"*n+"╣\n")*-~n+"╚"+"╩"*n+"╝")

Try it online!

You can golf it slightly by starting at n-3: n=int(input())-3;print("╔"+"╦"*n+"╗\n"+("╠"+"╬"*n+"╣\n")*(n+1)+"╚"+"╩"*n+"╝")

Also, n+1 is equivalent to -~n.

Japt, 60 52 49 48 36 bytes
"╔{Uµ3 ç'╦}╗{UÄ ç"
╠{ç'╬}╣"}
╚{ç'╩}╝

Try it online!
Another version (47 bytes + -R flag)
"8{Uµ3 ç'J};{UÄ ç"D{ç'P}G"}>{ç'M}A"c_+9500ÃòU+2

Needs the -R flag (added to the input field). Try it online!
How does it work?
Because I originally assumed the 'door-characters' cost more than one byte, I figured I could save quite a few bytes by encoding them. Then, I subtracted 9500 from the character codes, which left me with the characters 8J; DPG >MA, which only cost one byte each. Then, I could just add 9500 to each character code, and all would be well.
 "8{   Uµ 3 ç'J}  ;{   UÄ  ç"D{   ç'P}  G"}  >{   ç'M}  A"c_+9500Ã òU+2
 "8"+((U-=3 ç'J)+";"+((U+1 ç"D"+(Uç'P)+"G")+">"+(Uç'M)+"A"c_+9500} òU+2
 "8"+           +";"+                      +">"+      +"A"              # Take this string of characters
     ((U-=3 ç'J)                                                        # Repeat "J" input - 3 times
                     ((    ç              )                             # Repeat the string
                            "D"+(Uç'P)+"G"                              # "D" + input-3 times "P" + "G"
                       U+1                                              # Input - 2 times
                                                (Uç'M)                  # Repeat "M" input - 3 times
                                                          c_     }      # Take the character code of every character
                                                            +9500       # Add 9500 to it
                                                          c_     }      # And convert it back to a character
                                                                   òU+2 # Split this string on every (input)th character
                                                                        # Print the resulting array, joined with newlines.

Oh, yeah, you're right.

32 bytes

Dyalog APL, 71 bytes
{('╔',('╠'⍴⍨⍵-2),'╚'),((⍵-3)\⍪('╦',('╬'⍴⍨⍵-2),'╩')),'╗',('╣'⍴⍨⍵-2),'╝'}

Try it online!

You can definitely golf this. E.g. You can always replace (some expr)f Y with Y f⍨ some expr.

@Adám I know, it's in progress, I'm not on computer currently

Ruby, 54 52 bytes
-2 bytes thanks to ymbirtt.
->n{?╔+?╦*(n-=3)+"╗
"+(?╠+?╬*n+"╣
")*-~n+?╚+?╩*n+?╝}

Try it online!
Ungolfed
This is super boring:
->n{
   ?╔ + ?╦ * (n-=3) + "╗\n" +
  (?╠ + ?╬ * n      + "╣\n") * -~n +
   ?╚ + ?╩ * n      + ?╝
}

You can shorten the (n+1) a little by writing -~n - operator precedence will save you the brackets, too.

C# (.NET Core),  Score 123 (141 bytes) Score 118 (136 bytes)
n=>{string a="╔",b="╠",c="╚";for(int i=3;i++<n;a+="╦",b+="╬")c+="╩";a+="╗\n";for(b+="╣\n";n-->2;)a+=b;return a+c+"╝";}

Try it online!
-5 bytes thanks to @KevinCruijssen
Explanation:
n =>
{
    string a = "╔", b = "╠", c = "╚"; //Initialize the first, last and the middle lines with the starting character.
    for (int i = 3; i++ < n;          //Loop n-3 times
        a += "╦", b += "╬")           //Add the middle character to the first and middle line.
        c += "╩";                     //Add the middle character to the last line.
    a += "╗\n";                       //Add the end character to the first line.
    for (b += "╣\n";                  //Add the end character to the first line.
        n-- > 2;)                     //Loop n-2 times.
        a += b;                       //Add the middle line to the first line.
    return a + c + "╝";               //Add the last line and the final character and return.
}

Nice answer, +1 from me. I know it's been a while, but you can golf 5 more bytes by changing b+="╣\n";c+="╝";for(;n-->2;)a+=b;return a+c;}; to for(b+="╣\n";n-->2;)a+=b;return a+c+"╝";} Try it online.

@KevinCruijssen: Thank you.

Java 8, 102 + 101 bytes
java.util.function.BiFunction<String,Integer,String>r=(c,n)->"".valueOf(new char[n]).replace("\0",c);

n->{n-=3;return "╔"+r.apply("╦",n)+"╗\n"+r.apply('╠'+r.apply("╬",n)+"╣\n",-~n)+"╚"+r.apply("╩",n)+"╝";}

This is another string repeater of the same length:
java.util.function.BiFunction<String,Integer,String>r=(c,n)->{String p=c;for(;--n>0;p+=c);return p;}

Try it online!

Not bad, you can make your approach even lower than my answer. First of all you can lower it to 78 + 72 bytes (150 in total) by using a Java 7 method instead of the BiFunction: n->{n-=3;return"╔"+r("╦",n)+"╗\n"+r("╠"+r("╬",n)+"╣\n",-~n)+"╚"+r("╩",n)+"╝";} and String r(String c,int n){return c.valueOf(new char[n]).replace("\0",c);} Try it online. And the second method can also be changed to String r(String c,int n){String r=c;for(;n-->1;r+=c);return r;} (63 bytes), so it becomes 141 bytes in total

Correction, you can even lower it to 130 bytes: n->"╔"+r("╦",n-=3)+"╗\n"+r("╠"+r("╬",n)+"╣\n",-~n)+"╚"+r("╩",n)+"╝" and String r(String c,int n){String r=c;for(;n-->1;r+=c);return r;} Try it online.

Stax, 23 bytes
÷ÅoB↔╒╢Fm|╦a⌐á5µ┐»♫÷d╕Ñ

Run and debug it
Here's the ungolfed version.  Amusingly, it's actually smaller for stax not to use the literal characters because including them as a literal would prevent source packing.
"2Pfj_EQGG]T"!  packed representation of the 9 characters
3/              split into groups of 3
GG              call into trailing program twice
m               print each row
}               trailing program begins here
1|xv\           [1, --x - 1]; x starts as original input
:B              repeat each element corresponding number of times
                effectively, this repeats the internal row of the matrix
M               transpose door; this way it expands the two dimensions

Run this one

JavaScript (ES6), 80 74 bytes
n=>`╔${"╦"[a="repeat"](n-=3)}╗${`
╠${"╬"[a](n)}╣`[a](n+1)}
╚${"╩"[a](n)}╝`

You can count the symbols as one byte each, making this 80 bytes. And you should be able to make better use of template literals to save a few bytes ;)

You can only count the symbols as one byte if you can find an ES6 implementation that will take CP437 input natively.

@user5090812, It's an allowance specific to this challenge.

@user5090812 No need to find that implementation, because the challenge rules state "For the purposes of this challenge, in languages where the symbols used for the "door" take multiple bytes, they may be counted towards your score as a single byte each." So this has a byte-count of 80 bytes instead of 98 (if I counted correctly).

Well, that's a bad rule. It removes all the incentive to look for a better way to store the characters.

For me, the userscript counts 75 chars in your code.

@ETHproductions, it looks like Luke forgot to update the byte count with his last edit. There are a few stray & missing characters, though; the count is actually 74. n=>'╔${"╦"[a="repeat"](n-=3)}╗${'\n╠${"╬"[a](n)}╣'[a](n+1)}\n╚${"╩"[a](n)}╝' (replace 's with backticks and \ns with literal newlines.

@Shaggy: Besides the special rule, I possess the required environment.

05AB1E, 29 bytes
3-…╩╬╦S×`…╔ÿ╗Š…╠ÿ╣IÍ×s…╚ÿ╝Jä»

Try it online!

QBIC, 78 bytes
[:-3|X=X+@╦`]?@╔`+X+@╗`[b-2|Y=Z[b-3|Y=Y+@╬`]?@╠`+Y+@╣`}[b-3|W=W+@╩`]?@╚`+W+@╝`

Fortunately, all of the symbols used in out cell door are on the QBasic codepage.
Explanation
            The TOP
[:-3|       FOR a = 1 to n-3 (-1 for the width, -2 for beginning and end)
X=X+@╦`]    Build out X$ with the parts of the middle-top
?@╔`+X+@╗`  Then print that preceded and followed by the corners
┘           Syntactic linebreak

            The MIDDLE
[b-2|       FOR c = 1 to n-2 (all the middle rows)
Y=Z         Reset Y$ to ""
            Build up the middle rows in the same way as the top,
            just with different symbols and once for each middle row
[b-3|Y=Y+@╬`]?@╠`+Y+@╣`
}           Close the FOR loop
            The BOTTOM
            The same as the top, just with different symbols
[b-3|W=W+@╩`]?@╚`+W+@╝`

Sample Output
Command line: 7

╔╦╦╦╦╗
╠╬╬╬╬╣
╠╬╬╬╬╣
╠╬╬╬╬╣
╠╬╬╬╬╣
╠╬╬╬╬╣
╚╩╩╩╩╝

+1 for using a language that actually has them as one byte chars in its default code page.

Can you add a TIO (or equivalent)?

@Shaggy https://codegolf.stackexchange.com/questions/125237/its-hip-to-be-square/125280#comment307954_125280

Oh, yeah! I'll remember that eventually, I promise! :D

@Shaggy well, don't get too used to the idea. I just found a working Emscripten-build of Dosbox running QBasic. I'll try to gear that toward QBIC in the coming month, so a web env might yet arrive...

Swift, 161 bytes
let f:(String,Int)->String={String(repeating:$0,count:$1)};var p={i in print("╔\(f("╦",i-3))╗\n\(f("╠\(f("╬",i-3))╣\n",i-2))╚\(f("╩",i-3))╝")}

Un-golfed:
let f:(String,Int)->String = {
    String(repeating:$0,count:$1)
}
var p={ i in
    print("╔\(f("╦",i-3))╗\n\(f("╠\(f("╬",i-3))╣\n",i-2))╚\(f("╩",i-3))╝")
}

You can try this answer out here

PHP, 131 bytes, 113 chars
for($z=str_split("╔╠╚╦╬╩╗╣╝",3);$i<$a=$argn;)echo str_pad($z[$b=$i++?$i<$a?1:2:0],3*$a-3,$z[$b+3]),$z[$b+6],"\n";

Try it online!
PHP, 133 bytes, 115 chars
for(;$i<$a=$argn;)echo str_pad(["╔","╠","╚"][$b=$i++?$i<$a?1:2:0],3*$a-3,["╦","╬","╩"][$b]),["╗","╣","╝"][$b],"\n";

Try it online!

JavaScript (ES6), 86 bytes
This is significantly longer than the other JS answer, but I wanted to give it a try with an alternate method.
n=>(g=i=>--i?`╬╣╠╩╝╚╦╗╔
`[(j=i%n)?!--j+2*!(n-j-2)+3*(i<n)+6*(i>n*n-n):9]+g(i):'')(n*n)

How?
We assign a weight to each edge of the grid: 1 for right, 2 for left, 3 for bottom and 6 for top. The sum of the weights gives the index of the character to use.
8666667    0 1 2 3 4 5 6 7 8
2000001    ╬ ╣ ╠ ╩ ╝ ╚ ╦ ╗ ╔
2000001
2000001
2000001
2000001
2000001
5333334

Demo

let f =

n=>(g=i=>--i?`╬╣╠╩╝╚╦╗╔
`[(j=i%n)?!--j+2*!(n-j-2)+3*(i<n)+6*(i>n*n-n):9]+g(i):'')(n*n)

console.log(f(8))

Retina, 56 50 bytes
.+
$*╬╣
^╬╬╬
╠
.?
$_¶
T`╠╬╣`╔╦╗`^.*
T`╠╬╣`╚╩╝`.*¶$

Try it online! Works by building up a square of ╬s and then fixing up the edges (in particular three colums are deleted when the sides are added).

Batch, 126 bytes
@set s=
@for /l %%i in (4,1,%1)do @call set s=%%s%%Î
@echo É%s:Î=Ë%»
@for /l %%i in (3,1,%1)do @echo Ì%s%¹
@echo È%s:Î=Ê%¼

Works in CP437 or CP850. Looks like this in those code pages:
@set s=
@for /l %%i in (4,1,%1)do @call set s=%%s%%╬
@echo ╔%s:╬=╦%╗
@for /l %%i in (3,1,%1)do @echo ╠%s%╣
@echo ╚%s:╬=╩%╝

PowerShell, 67 bytes
'╔'+'╦'*($x=$args[0]-3)+'╗';,('╠'+'╬'*$x+'╣')*($x+1);'╚'+'╩'*$x+'╝'

Takes input $args[0], subtracts 3, saves that into $x, uses that in the construction of the top of the door to output the appropriate number of middle sections. Then we're outputting the middle rows, of which we have $x+1 of. Finally, the bottom row is similar to the top row. All of those are left on the pipeline, and the implicit Write-Output inserts a newline between elements for free.
Try it online!

Perl 5, 61
60 characters of code (90 including the multibyte door characters) + 1 for -p
$_='╔'.'╦'x($n=$_-3)."╗\n";$_.=y/╔╦╗/╠╬╣/r x++$n.y/╔╦╗/╚╩╝/r

Try it online!

C# (.NET Core), 130 bytes
n=>"╔"+R("╦",n-=3)+"╗\n"+R("╠"+R("╬",n)+"╣\n",-~n)+"╚"+R("╩",n)+"╝";string R(string c,int n){string r=c;for(;n-->1;r+=c);return r;}

Port of @RobertoGraham's Java 8 answer, after I golfed about 70 bytes.
Try it online.

MAWP, 73 bytes
@=MM"╔":!3-["╦":1-]`"╗
":2-["╠":M3-["╬":1-]`"╣
":1-]`"╚":M3-["╩":1-]`"╝":

Try it!
Note the strings with newlines

MAWP 1.1 would be insane with thes glyphs lmao

@Razetime yeah. Probably would make a script to brute-force the constants for me lol

Your output is too tall, it should be one line less.

@Shaggy should be fixed now

@Shaggy actually the width was too big also, fixed that as well

Mathematica, 106 bytes
(T[a_,b_,c_]:=a<>Table[b,#-3]<>c;w=Column;w[{T["╔","╦","╗"],w@Table[T["╠","╬","╣"],#-2],T["╚","╩","╝"]}])&

Could you add a TIO (or equivalent)?

goto https://sandbox.open.wolframcloud.com/app/objects/  paste the code(ctrl+v), add [8] at the end and press shift+enter

There appears to be an extra line break between each line, would I be right in saying that's a problem with the rendering of the outpu, rather than the output itself?

@Shaggy wolfram cloud displays all characters in a funny-distorted way so it is not the best way to present such tasks.there are no extra lines and everything looks ok on mathematica. copy and paste your test case to check.I did and they look identical

oK, 38 chars
`0:"╔╠╚╦╬╩╗╣╝"{+x+/:3*0,2_x}@&1,|1,-2+

Try it online.
k does not seem to want to handle unicode well, so I went with oK.

J, 41 37 bytes
ucp@'╬╠╣╦╔╗╩╚╝'{~1 1|.{.&6 3+/<:{.2,*

Try it online!
Default box drawing takes 13 bytes, unfortunately the best way of replacing the characters I could find costs 28.

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


text:
How many ways to write numbers as sums of squares?
Task
Given two integers \$d\$ and \$n\$, find the number of ways to express \$n\$ as a sum of \$d\$ squares. That is, \$n = r_1^2 + r_2^2 + ... + r_d^2\$, such that \$r_m\$ is an integer for all integers \$1 ≤ m ≤ d\$. Note that swapping two different values (e.g. \$r_1\$ and \$r_2\$) is considered different from the original solution.
For instance, the number 45 can be written as a sum of 2 squares 8 different ways:
$$\begin{align}
& 45 \\
& = (-6)^2 + (-3)^2 \\
& = (-6)^2 + 3^2 \\
& = (-3)^2 + (-6)^2 \\
& = (-3)^2 + 6^2 \\
& = 3^2 + (-6)^2 \\
& = 3^2 + 6^2 \\
& = 6^2 + (-3)^2 \\
& = 6^2 + 3^2
\end{align}$$
Rules

Built-in solutions are allowed but non-competing (ahem, Mathematica)
Standard loopholes are also forbidden.
The inputs may be reversed.

Example I/O
In:   d, n

In:   1, 0
Out:  1

In:   1, 2
Out:  0

In:   2, 2
Out:  4

In:   2, 45
Out:  8

In:   3, 17
Out:  48

In:   4, 1000
Out:  3744

In:   5, 404
Out:  71440

In:   11, 20
Out:  7217144

In:   22, 333
Out:  1357996551483704981475000

This is code-golf, so submissions using the fewest bytes win!

Why did you delete this and posted a new one while you can edit the post you deleted?

@LeakyNun My browser threw errors when I tried to edit that, even before deleting it.

Related

If d is 0, why would it return 1?

No, n is 0, not d.

swapping the values (e.g. r_1 and r_2) is considered different even if the two values are equal?

Can you verify your last testcase?

@LuisMendo nope. I'll fix that.

@LeakyNun On Mathematica, SquaresR[22, 333] yields 1357996551483704981475000.

@DeadPossum For 1, 0 test case, there is 1 way to express 0 as a sum of 1 square: 0 == 0^2.

Python 3, 125 bytes
n,d=eval(input())
W=[1]+[0]*n
exec("W=[sum(-~(j>0)*W[i-j*j]for j in range(int(i**.5)+1))for i in range(n+1)];"*d)
print(W[n])

Try it online!
Finishes the last testcase in 0.078 s. Naive complexity is O(d n 2).

Mathematica, 8 bytes, non-competing
SquaresR

Like this was even needed...doesn't add anything new to the question. :P

@EriktheOutgolfer Blame the question; it states explicitly it's allowed.

Those moments where non-built-in solutions nearly beat built-in solutions :D

@JollyJoker My point is, answers should add something to the question, otherwise why even post them? *shrug* :P

@DavidMulder I at first missed "nearly" and was shocked for a bit...

Jelly, 9 bytes
Nr⁸²ṗS€ċ⁸

Try it online!
Takes n and d in this order.

How many years would it take for the last testcase?

@LeakyNun I dunno, it's beyond my comprehension...

MATL, 13 bytes
y_t_&:Z^U!s=s

Inputs are n,  then d. Some of the test cases run out of memory.
Try it online!
Explanation
Consider inputs 17, 3.
y     % Implicit inputs. Duplicate from below
      % STACK: 17, 3, 17
_     % Negate
      % STACK: 17, 3, -17
t_    % Duplicate. Negate
      % STACK: 17, 3, -17, 17
&:    % Two-input range
      % STACK: 17, 3, [-17 -16 ... 17]
Z^    % Cartesian power. Gives a matrix where each Cartesian tuple is a row
      % STACK: 17, [-17 -17 -17; -17 -17 -16; ...; 17 17 17]
U     % Square, element-wise
      % STACK: 17, [289 289 289; 289 289 256; ...; 289 289 289]
!s    % Transpose. Sum of each column
      % STACK: 17, [867 834 ... 867]
=     % Equals?, element-wise
      % STACK: 17, [0 0 ... 0] (there are 48 entries equal to 1 in between)
s     % Sum. Implicit display
      % STACK: 48

Haskell, 43 bytes
0#0=1
d#n=sum[(d-1)#(n-k*k)|d>0,k<-[-n..n]]

Just your basic recursion. Defines a binary infix function #. Try it online!
Explanation
0#0=1            -- If n == d == 0, give 1.
d#n=             -- Otherwise,
 sum[            -- give the sum of
  (d-1)#(n-k*k)  -- these numbers
  |d>0,          -- where d is positive
   k<-[-n..n]]   -- and k is between -n and n.

If d == 0 and n /= 0, we are in the second case, and the condition d>0 causes the list to be empty.
The sum of the empty list is 0, which is the correct output in this case.

Pari/GP, 31 bytes
d->n->sum(i=-n,n,x^i^2)^d\x^n%x

Try it online!

05AB1E, 10 bytes
Ð(Ÿ²ã€nOQO

Takes the arguments as n, then d. Has problems solving the bigger test cases.
Try it online!
Explanation
Ð(Ÿ²ã€nOQO   Arguments n, d
Ð            Triplicate n on stack
 (           Negate n
  Ÿ          Range: [-n ... n]
   ²ã        Caertesian product of length d
     €n      Square each number
       OQ    Sum of pair equals n
         O   Total sum (number of ones)

Jelly, 23 bytes
‘ṬUµJ²fJ[0]ẋ;€ḤSḣL+µ⁹¡Ṫ

Try it online!
Port of my Python solution. Finishes the last testcase in 2.977 s.

Mathematica, 38 bytes
Count[Tr/@Tuples[Range[-#,#]^2,#2],#]&

Pure function taking the inputs in the order n, d. Range[-#,#]^2 gives the set of all possibly relevant squares, with positive squares listed twice to make the count correct; Tuples[...,#2] produces the d-tuples of such squares; Tr/@ sums each d-tuple; and Count[...,#] counts how many of the results equal n.
The first few test cases terminate quickly, but I estimate this would take about half a year to run on the test case 1000,4. Replacing Range[-#,#] by the (longer but) more sensible Range[-Floor@Sqrt@#,Floor@Sqrt@#] speeds up that computation to about 13 seconds.

Jelly, 7 bytes
ŒRṗ²§ċ⁸

Try it online!
Very inefficient; fails to finish within a minute for the last 4 test cases.
How it works
ŒRṗ²§ċ⁸ - Main link. Takes n on the left, d on the right
ŒR      - Yield [-n, -n+1, ..., 0, ..., n-1, n]
  ṗ     - Yield all sublists of this range of length d
   ²    - Square each number
    §   - Take the sum of each list
     ċ  - Count the occurrences of...
      ⁸ - ...n

Python 2, 138
Very inefficient solution with my beloved eval. Why not?
Try it online
lambda n,d:d and 4*eval(eval("('len({('+'i%s,'*d+'0)'+'for i%s in range(n)'*d+'if '+'i%s**2+'*d+'0==n})')%"+`tuple(range(d)*3)`),locals())

It generated and evaluates code like this:
len({(i0,i1,0)for i0 in range(n)for i1 in range(n)if i0**2+i1**2+0==n})

So for some big d it will run very long and consume a lot of memory, having complexity of O(n^d)

Mathematica, 53 51 bytes
SeriesCoefficient[EllipticTheta[3,0,x]^#,{x,0,#2}]&

k, 23 bytes
{+/y=+/{x*x}y-!x#1+2*y}

Try it online! It's a simple brute forcer.

Pyth - 16 bytes
lfqQsm*ddT^}_QQE

Try it
It's horribly inefficient

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


text:
Alphabet Aerobics
Challenge
Given a single letter (a-z) as input, output the 2 lines of Blackalicious' Alphabet Aerobics that correspond to that letter (ignoring the intro & outro).

Rules

You may take input by any reasonable, convenient means as long as it's permitted by standard I/O rules.
Input must either be case insensitive or consistently uppercase or lowercase.
Output may be a newline separated string or an array/list of two strings.
Output must be formatted (capitalisation, punctuation, etc.) exactly as it appears in the test cases below.
Trailing spaces and newlines are not allowed.
This is code-golf so lowest byte count wins.

Test Cases
Each code block below is what should be output for each letter a-z, respectively.
Artificial amateurs, aren't at all amazing
Analytically, I assault, animate things

Broken barriers bounded by the bomb beat
Buildings are broken, basically I'm bombarding

Casually create catastrophes, casualties
Canceling cats got they canopies collapsing

Detonate a dime of dank daily doin' dough
Demonstrations, Don Dada on the down low

Eating other editors with each and every energetic
Epileptic episode, elevated etiquette

Furious, fat, fabulous, fantastic
Flurries of funk felt feeding the fanatics

Gift got great, global goods gone glorious
Gettin' godly in his game with the goriest

Hit em high, hella height, historical
Hey holocaust hints, hear 'em holler at your homeboy

Imitators idolize, I intimidate
In a' instant, I'll rise in a' irate state

Juiced on my jams like Jheri curls jockin' joints
Justly, it's just me, writing my journals

Kindly I'm kindling all kinds of ink on
Karate kick type Brits in my kingdom

Let me live a long life, lyrically lessons is learned
Lame louses just lose to my livery

My mind makes marvelous moves, masses
Marvel and move, many mock what I've mastered

Niggas nap knowing I'm nice, naturally
Knack, never lack, make noise nationally

Operation, opposition, off not optional
Out of sight, out of mind, wide beaming opticals

Perfected poem, powerful punchlines
Pummeling Petty powder puffs in my prime

Quite quaint quotes keep quiet it's Quannum
Quarrelers ain't got a quarter of what we got, uh

Really raw raps, risin up rapidly
Riding the rushing radioactivity

Super scientifical sound search sought
Silencing super fire saps that are soft

Tales ten times talented, too tough
Take that, challengers, get a tune up

Universal, unique, untouched
Unadulterated, the raw uncut

Verb vice lord victorious valid
Violate vibes that are vain, make em vanish

Why I'm all well, what a wise wordsmith just
Weaving up words, weeded up on my workshift

Xerox, my X-radiation holes extra large
X-height letters and xylophone tones

Yellow-back, yak mouth, young ones' yaws
Yesterday's lawn yardsale, I yawned

Zig-Zag zombies, zooming to the zenith
Zero in, zen thoughts, overzealous rhyme ZEA-LOTS!

@Downvoter: Feedback would be appreciated.

I didn't downvote, but the challenge doesn't seem very interesting because the text lacks structure to allow clever compression tricks

@LuisMendo, you'd imagine someone would have seen fit to mention that in the week this was sitting in the Sandbox, wouldn't you? But, no, all it got there were 4 upvotes and a few comments, none of which provided any constructive feedback. Which makes me question the point of having a Sandbox at all!

I agree, downvotes without comments are not very useful, specially in the sandbox

@Shaggy A lot of ppl question sandbox, just see posts about it in Meta

@Shaggy The sandbox is just a place where you can draft your challenges. In order to get suggestions and feedback you actively have to ask people about the things you're not sure about.

@flawr, search TNB for "Alphabet Aerobics" ;) - and they're just the ones I "oneboxed".

More downvotes without a single one of them having the courtesy to provide a single line of feedback! :( Much more and I'll have to delete this - it's the hour and a half that Erik spent on his solution that's staying my hand from doing so now.

@Shaggy sorry but it's here forever now. You can't delete posts with upvoted answers

I downvoted because of Luis Mendo's reason. The challenge seems uninteresting as there is not much interesting compression techniques in the text.

Thanks for commenting, @KritixiLithos; just a shame nobody thought to mention it while this was still in Sandbox.

Whoever takes the time to answer this in 05AB1E wins... Just saying, it won't even be fair.

Nevermind, half of those words are slang; 05AB1E would get wrecked.

PHP, 1678 bytes
<?=ucfirst($argn),strtr(explode(_,gzinflate(base64_decode("LVXJktw2DL3rK5BTX3qqtPV2tGMn8ZKyHTuJ44uKEiGJFkXKXNTWfH0eNXMYDQiCWB4e0C6o/qoqEnPB0fkj3dgcAhVUaejEYz5kL0y1hWultyO9IeG9iDocSRiFJ3TKB984O7Gh9uZU6ak9G8mS2o1OTK2dW2q5yF5GpSVs4Z/a3f5IrfDJLb05zLvhDQaN8DHpOsfw3hXCB2eXsT5Sl26CqrNfhelY5wNuPQ02IA7shbGLqqmzWovFwxGHCzwIkmpmsj1JYSZ8FJxLmx9Inocxe8XzBREKdUHpry70SkhBl5S5tHdD2t6bApHsqSSWKljn6a5OxKIbgYAkXsuN2JQDh2v2elGal3AlXpS3ko/EmtcCYHBQPyKHwE106oxQfYE/0Ua9H4QJqPOa/aajcygC2fYR2fasAz4MXFJKsCuuvlF92MseANGRBm3bCmcrAcaF0zmFyH5HOFQ5WImCcxoVrgWQSOnD1wCrOjQqEM+4HMYjjQzo8MUB/cUDlHutsj+A7mi17UT0gcY8+GR6o0N6CLRLkGU7O8gzt3ZrZhWKhJOSVqtHTqTJg5qVLDh7Y0gcKPcBFePioDU55Rn5Qa0c+uVDAZCuwOxC80bfxexJq4np7Vgq6qLTnr7bbkJp3y1yyd4iq0RNFQ64SSnOiHl3KgC05OHsTOWbXD4TbYKEG9Abkk9Q5xNdsnc3BJ+uE4VtYXqJ5x5Z4f2UD9LOYBP8IpM1UUpfBog94ujN7RTWtb+gZOTKN8Mye5+gRnPrp5S0RZHBJn9wUW7NRnMuaRZTTfNtZVjSbFewfMaA1dmfSbcTDFpOWoMXKJvuY4EykAUMQ8myUcMgPBmx0GTsHZWlIs0Vj0wRHXLL3hnRTTiCq6R3EXGZjE3IG1AfRs1SQjiSXRbrVdjFvodNgArHKvsQQwLLP7HjvB9QA6BWEiPNYk5zAvYD7LLnLqCFi+X5iO+97KOmJZpu1HmdfYzzvA/wR3B0S/eyxG3fP0O+OIxsE1Vg+hFFHvC1oaaJeYGo0Iq92Z+iMCbO2ad4c6yxeUR+eJoMAbNbKFOKCa97ojuSjmPDqVlO3PG3gMcgX05xSScFgmR/qedRc9GPkJyQyoouqFWFrYlLSb5TbNLOrMhj0ZHnG1aBxy4J2WeMv+nwzCfLXjnQGWHoVKSt520fmqqmgFWJeYBQwRMDwWAthbSNvqS+nDDU3VjB1VAiRWwW1BOiYSTaGLDHVyjFpIWS/odzN4JwfxshsZfLIjlMBaBG4B1DU7a0XkFG6ySEsG8HWisls3+U1WD9qtr6OcdV5M/swHCvWPF+bManucHA3LEgjjuiAl0Hee7w6WcslETy7F8WK4oHnLselthcYAEU+yxDO/kR26sp7c9j0nx9SACDeGmR1MQ/g8Nw3QbOvj487SHMUwiptYD656bxS4AVFy51g1Ts/aHd6byJiebzCcLZDHSpD9DcffZfHUopNjBFC+zy7SZ9ta8j3Jp9ch6+iYEe8cujMHmP1iYKY0oB3yMbdcq+lZYACA50Sh1GTXYtH7kCgm7cMOLfXr94eP/hy+df/gc=")))[ord($argn)%32-1],[in,at,er,al,es,th,ou,on,ic,ar]);

Try it online!
PHP, 1952 bytes
<?=ucfirst($argn),explode(_,strtr("rtif8i3 am1eurs, 9en't 1 3l amaz0g
An3yt83ly, I assault, anim1e 50gs_roken b9ri2s b6nded by 5e bomb be1
Build0gs 9e broken, bas83ly I'm bomb9d0g_asu3ly cre1e c1astroph4, casu3ti4
Cancel0g c1s got 5ey canopi4 collaps0g_et71e a dime of dank daily do0' d6gh
Dem7str1i7s, D7 Dada 7 5e down low_10g o52 editors wi5 each and ev2y en2get8
Epilept8 episode, elev1ed etiquette_uri6s, f1, fabul6s, fantast8
Flurri4 of funk felt feed0g 5e fan18s_ift got gre1, glob3 goods g7e glori6s
Gett0' godly 0 his game wi5 5e gori4t_it em high, hella height, histor83
Hey holocaust h0ts, he9 'em holl2 1 y6r homeboy_mit1ors idolize, I 0timid1e
In a' 0stant, I'll rise 0 a' ir1e st1e_u8ed 7 my jams like Jh2i curls jock0' jo0ts
Justly, it's just me, writ0g my j6rn3s_0dly I'm k0dl0g 3l k0ds of 0k 7
K91e k8k type Brits 0 my k0gdom_et me live a l7g life, lyr83ly l4s7s is le9ned
Lame l6s4 just lose to my liv2y_y m0d mak4 m9vel6s mov4, mass4
M9vel and move, many mock wh1 I've mast2ed_iggas nap know0g I'm n8e, n1ur3ly
Knack, nev2 lack, make noise n1i73ly_p21i7, oppositi7, off not opti73
Out of sight, 6t of m0d, wide beam0g opt83s_2fected poem, pow2ful punchl04
Pummel0g Petty powd2 puffs 0 my prime_uite qua0t quot4 keep quiet it's Quannum
Qu9rel2s a0't got a qu9t2 of wh1 we got, uh_e3ly raw raps, ris0 up rapidly
Rid0g 5e rush0g radioactivity_up2 scientif83 s6nd se9ch s6ght
Silenc0g sup2 fire saps 51 9e soft_34 ten tim4 t3ented, too t6gh
Take 51, ch3leng2s, get a tune up_niv2s3, unique, unt6ched
Unadult21ed, 5e raw uncut_2b v8e lord v8tori6s v3id
Viol1e vib4 51 9e va0, make em vanish_hy I'm 3l well, wh1 a wise wordsmi5 just
Weav0g up words, weeded up 7 my workshift_2ox, my X-radi1i7 hol4 extra l9ge
X-height lett2s and xyloph7e t74_ellow-back, yak m65, y6ng 74' yaws
Y4t2day's lawn y9ds3e, I yawned_ig-Zag zombi4, zoom0g to 5e zeni5
Z2o 0, zen 56ghts, ov2ze36s rhyme ZEA-LOTS!",[in,at,er,al,es,th,ou,on,ic,ar]))[ord($argn)%32-1];

Try it online!

Jelly, 1052 1050 bytes
Oị“>ḤĖwỌḞaỌHtṂþÐṿɼ×ƙ\ṀẸqė\ȧIɓịżʂñ"ḃ⁺ụPE4ĿɲɗŀÐ“¡Ƭ£`BrjŒ⁷ḷḊwṡxṙṀrẇp[ṣİ|ḲṬ⁹ⱮØẎ9ṙ“¡Npḥ8Þṿfeṗẋ⁶ż⁹ẎUøịẹYḄnṁ7ZMnb~pOṙɗḣ(Œøṙụ;ḥ⁸ƇṚỊsẎʋðỴİc⁽Ċ“jɲḷȦẒḲƑzRṀ7¥(æċȧƭḶZṘḄƤ`¬?^ḞƙṾƲq“S£÷ƑØQQʠaƭỴȤ_TỴkɦṛ¥gṄĿ²ṆḍḣṾ2ɓṘ ,“¡ẏŒpḌBḢ/c{ḶẒẠf%nM⁼ṃṫQʂrɱṿ¬4ɱUƘMẸṛŻƬÑ“¡Ɱ1ṣḞµ⁶ỌrTXçYṗ$Ȥẋ-ocñƲ“Ñ³{gøUƤ5]ẈṂȮɦµṂTœỌŒ1/Ẇ~œy2¦æƲȧ€ƝGb“€ẉ⁹6¬ƁṡLæẏẏẹyƈ"ð~¢5_Ɲḣ⁸¶mẇn⁷S9EṃẈM'}0ⱮƁṘṢŀ"¬U#~+ẋV“.¹ṗẸ6æAWḣ⁺tɼZĿẓṃẎ⁽C#ẇṣṡẆX½⁵ỵ€⁼µþȦ/]ȥṪ1“~Ṇẇ{KH9kẉḊẠ¢ỊẇLṖṛPḤ£\tkŻbḍṀPJ¡ȧṚ~QNNØ}ȷṬ“¢jÇṘ4ḥs"⁼ụ¦ṣƭRḤḍḄ$Ẉ9⁷JÞ,ẹƓ3ṡọRƓṃØ×ẠȮḞẹ+hṫ}5[ĿpQƇ(“-G>ɦɼ⁽⁷ĿtḌŒƤifLƥƒẠḄḊɲɲðṭŀRṚ-*ƭṭyƝ(Ṙḣ“¡o|ỤṛỊ iżẈṄʂtÞ⁵x⁵ⱮṫE⁾Ḋ`ıĖẹjp½ḳ{HlọḣoẎ“-ḃ]"ṅỊȮmJỵṖ<)ỴƝD_wȤ⁺ḣ4Mœnu⁴jḅȦ5“©ẆẸṡA*ßx⁹ƤƝO¹ṣUṡ4ė-ƲȤ⁾ḃKhTẸ⁵ḅ-⁻nẊẈ"nwỴß⁼ ɗ“ṡṖḟYIɱẉcẓ⁻tŻƊẎ- ṡİȮgṅƝ×`®*çq¡þ⁹Xe“µÑe0Ƭ¦w$ƊIḶ1\"Ɗø,7v&€/$jṠƝȧḋẓœẆĠc“¢ȷCṁ$°ṬḅṿkėḣC{AịB£AtṅẊRWGḂ2µ9ḌUḣœ⁵mⱮṛ⁷ṙḄḟkẆ¦œ“ƭÆ|ƤBċȦlĊæʠȥiƒ.nżṘḃọṬµṛHⱮW^ṗɲḄbX{ḊṾ3ḃʂ5⁸Ẇẓ)ẹ“¦+8ɼġtịḂZṄ⁽ƙḍṄØM.ƙḞȥU$İ¶r¡ṅ¦3Ṗ£|ƘẎẋḌF÷ẋ⁵“⁹ƓBrḍṆdmṫ©ⱮĠ£ƬƘḟ}ėm9ʂaȧQ÷ɲṭẒḃĿƒỊ,ṛ0¬¿Ɠẉṛr!rƑWĠƭ¢/,⁼ẋ'o“@⁶⁵*ƊÇṡḳƈ/ƒĿĠỌ59KɼẸṅ¦⁶Ġƙ'ƒjḶV¡Pḃ÷Ḷıʋʋḣ³8Ẇs“ȷṪjLZ÷\ĠṫĊɼƒiB½mṾf÷²ṭ³¦ṇḷµœ¢żA¢,Mḷȷ¢æⱮBḥṿḥ£İ“¡EȷịḢ/"µİ3ȧÆỴʂJ]Uƈ{Ṙ]¿þLÞƇe/ẏ⁸ƒ÷œTḃṠyuṫḍ0ɠẸ“¢ṂṖ^YḳN:⁵ẓ⁴⁸ịṚ(NṫCṭḂḷcʂW¦ṅƇẓḷ¥b⁵QSYŀ⁽×»

Try it online!
-2 thanks to Jonathan Allan.
Accepts uppercase.
Ironic that only the first three bytes do the real work this program doesn't do any real work, isn't it?
(tfw when it takes you more than an hour and a half but the result is perfect)

An hour and a half?! :o I'm humbled that you would spend so much time on it :)

@Shaggy Most of it was generating the 1048 bytes at the end.

Save two bytes by only accepting lowercase and using Oinstead of ØWw - indexing into your list rotated left by 8.

@JonathanAllan Ooh great idea...but then I prefer uppercase so I'd rotate to the right by 12.

Octave, 2232 2214 2176 bytes
This is an anyonymous function with one huge string hardcoded. The different outputs are separated by a ) which is then used in strsplit.
@(n)strsplit("Artificial amateurs (...) overzealous rhyme ZEA-LOTS!",')'){n-96}

Try it online!

Umm, the whole code actually fits in.

I got an error messages when I tried to include the code, feel free to try it yourself. (Actually I think it would not even be that interesting to see the rest of the code)

Then how is it 2176 bytes? Post limit is 30k chars.

Don't ask me, all I know is that I got an (unspecific) error message when I tried to submit that.

Maybe it has to do with the TIO link's length? That's still not too long though... weird...

Yeah I thought that too first, but when I shortened it using tinyurl.com it said I was not allowed to use url shorteners...

@flawr I got a non-specific error message when submitting here too, but a couple page refreshes and attempts and an I'm not a robot verification it submitted.

SOGL V0.12, 1038 992 991 bytes
Ƨ, "&↑A○f8▓⁵√¹⅟²px∫Uw2ƧΚιx,═hνtεI   =*f⅞aG░‛I:┘'┘‽ΟΨ▲cμ⌠└ιŗY]š⅝&◄⅞▓æCæ»TUΓ↔τ┼≥{_‰ī(*#ģ↑ι<d^¹≈4┘¡ēY←z▓Β6→y⌠$<\ē⁵owD╬#οīλ3ņ┼┘Τ‰±╥μΛš^»KƧ↑³g(y.℮ēDī*█┘E>Ν,±→ø¶ΦKƨS⅝p□D>mƨYψCκΧū╥ō⌠d#╗ΞΡ⅝¬℮te%ΝH↑]ÆυΔ⅔;ΦVO⁹}≈Rōøυ#»→▒⁄w⌡σX╔⁾560yķψ┌λTHļķ:‛ļ:Ι≠sē8□v׀N‽MXσ&⁶┌■ qŗ3C‽Βσ4:Mk{∆▒ΨƧB ;uΡ│ΣV«ŗ╤f⌡E│?æ^νΠ‚H2ō6J>uΓηΣg.R╗|$R‼↑⅞▓^tlM║⁄bd9↔▒┐^Υ|πc⁷ø○āΟ‰□28O╤>V]lαÆøΡω┼|hΦWīūEξ5M¾(Y□ξ§+d¼r▒ģƧ╔ūl■ΡΝž@h∑κ⁸<K▼α≈βī‚⁰⁽N∙!⅟EΜ²█V¾>ΩΒEt═δ√qΛ≡w]ē↔Π⁾ΤXΒ7←η╬¶┌‰RVDΥζVΒ±%÷¤ν↔2Ζ'∙;σ¶▓m⁾ΧqΥ-Ƨυ)┐`θ∫%ψτ:←√′\Ay+‰≡≈ÆMāT┼5eτ^²─κGΘ⁷¾ayψJΘ׀G↓⅜!╔¡┌*«η[░≤k║ŗ«ΘθλΖ○Η▓|ūΕ╚↓ψƧ⅜λO¶μ⁽φ⁹╝╔Z⁽╥Σ←°e+)l$»≡≡m*≡ΞΤ‽|°eŗ)3²žΛ@crO1G└ZPvƧē√≡ΣGα.Σē╝Γ⌠ķa3J¹∞'√ā⅛νξwΤ³░ κē=mģσ↔║¶øø$!π+≡⁵⁴y▒'R≥Æķ+²⁸ēΖ⁄⅛↑↑A▲}<I‼⌠Ξ′╤Β¬C+■∫ο½⅞ΝL,#rΞ█↕ο∫8rL°νnc▼Γ)═^{Φ⅟ε³‛℮lƧčGP¾3◄Ω╗g2FAm׀λ$╗→rWΖ17⅜⌡◄Ič    εt≥q℮′?Æ>┐Τ'ņ¬V→⅔O¼■┼q,‼Β∆∆№ģW■°~¬l⁹ōJbbΘpRņžψ∞ζč╥⁵σθ≈≥⁸¤JÆε5]○¾f׀№ģ§:⅝æT¡⁷ΛΖΨ≤⅝χυ¼š:ÆΛ½±FυΚξū^ΧģƧ'↑KžΨ⁄²I;:χ~Ν(»%γp‽iξC⅝°§Ω≤lδ¦┼}℮≠lχ3╬L¦⁴Ο:gBš╔¶¤:ģMC%u÷⁴┘žYƧΣ0‛⁶0Δ.e_?[─9Νκ⅔⁷}ΦW#_↓δv≥╔Z⅞y4‽ūψqiΖW⁴ƨΡφ%7√‰η²¤š⁷╥⅞5┼/⅜ΔοΦR¾§l¶←∞‰σl1⅛!⁄⁴′νιvk⅓⁴⅛▓ε↑δ@╗ \η!└⅝S0┌²⁰≥¦⁵‘┐Θz,Ww#Θ⁾

sub-1000!
Splitting what is a word and what's a character took a while...
Explanation:
Ƨ,                 push ", "
   "...‘           push https://gist.github.com/dzaima/3053b8f0222593b8fc4f5cd177ae6dec and replace all `ŗ`s with ", "s
        ┐Θ         split on "|"
          z,W      get inputs index in the lowercase alphabet
             w     gets that item from the array
              #Θ   split on `"` (becuase quote has a single-char push command)
                ⁾  sentence case (uppercases the 1st letters)

Try it here! or test all test-cases! (warning: can take a while)

Nice work getting under 1k. Got a TIO or equivalent where I can test this?

@Shaggy SOGL is widely known to be under too heavy development so dzaima himself has decided against it iirc.

@Shaggy ^ yep. But to think of it, actually, it's possible that no more everything breaking updates are coming, so it might be possible sometime in the near future.

@Shaggy Expect a SOGL online javascript implementation in ~15h (it's midnight now :/). It's mostly done (e.g. this program works), but I'd say that that's the most that works.

Husk, 1071 bytes
x';!x'%¨AλḞ↕¥βα, »Ṅ'tαt◄l²Za;ṅȦẏ£₇,İ⌊⌋§,ẋZȦṅ´%ḃ⁸ṙż⁸rḃ6ΔbΨËŀ⁶⁶bȦ†;Ḃ⌉säeḃ⁸►,ḃĿ¦İ'mḃβø»)%¥◄£Ẏα¢ȧ×ẏ₅,ŀY4s;Cȧc₇gc₂ȧ≥*εyẏ⁹X∫cẊ←ρ%ż‡ṪeαŸ]1₀fḋ₄k◄ΨdżḊİ'ÿ#G;żδτÖ$,Ḋo¬ḟ×DΦε÷~←ẇ%Eȧ:ØoŸḊ*ωwȧ‼Äd√ṘżẎ₃;£Γφ£⁹&,⁷ŻË□=Ṫ%Γ2u,⌈Λ,£Γü,ẋ=Λ;Flÿ»Jθ Ḟ₂<f¦τḞŻ€εψ=Ȧ%GïΓ≥*Ġτ,⌊⁶lσ₀sżȯ γĿ‰;GẎτ'Ŀ? ¹¬ï gÄmẆwËgø₅t%Hit¦mıḣ,Ż¦Γ□±h,Ïσ»Ψ;Hey«₈öÿ#İ,ä> 'em«‼jαtÿrȮ³₆γ%żẊo¹do∟z,İ¹Ẋz…;Inα'ŸȦṪ,İ'∟l²Ë↕α'≥×8ṡṫ%ȷ;Jd₀¬mΨj≥₄←↕JhĖiŀ?üȷ<θ↕'ȷȷ5;ȷΨJ,¹t's⌋≈ṁm, ẇJγyȷ⌋l%◄/↓İ'mŻ?¹◄lȷk∫θ ΞkΦ;Ka►†ẏ<kγPβ>∫↕γy□<D%←Ṫṁm∟ıα«g←‡,γ₇Ψï◄⌊J$¹sλ≥e;LȦm¦oμW⌋'←ø†oγy£?√%MΨΔ`mφkŀ₂↑ṁØs,□ṡ▲;λ%√ÄdṁØ,Ṁẏ□KΦωζİ've⁶2₃%ȷNgasη@p⌋Ẇηİ'mẏ[ ,£γa;γŻK, ṅṘ←<,ṁ^□ȯ,ṄOṅ◄%ẎO,₀pΠΦ,Öf⁰t⁷ṗΦ;üt₀fŻḣg,øo₀fṁ%,ωχẎ₈Ġ£ρŀs%⁶ḟ3₉□m,λḟ>Ẏπ±⁷¬;Püψ⁷~ÿ/†ẇṖ,Γ%Ṗ¹¬mΨpṘβ%₂Q₈",□□‰Π<□□"¹t'sμQψ⌋n;⌊Q→Ėsα↕'t≥*α□ṙ_₀fωζẇe≥*, uh%γ⌊lrȧwrȧφ,Ÿṙİüp⁷¿δ;⌋□1ε□↔₁ḋ₂¥ωτ%üṗṠ₂ŀ‡{⁵θ∂ä#żġḢ;ẋ≥lṗ€⌈β⁵ȧφȦ…äeḞJs%Tλ$₂nïż◄/…,θσ□ö↔;ȧΣȦ…,ŀ½¦Ės,ġṪαŸ≥ üp%λ"⁵,ÿÜÜ,żμX;ÿ₈U⌋₇/, Ë►ω²¥Ξ%⁸βV√[⁷Övȷ⌈⁰ẏ←d;£×V√↕₆₅Ȧ…äeż▼ ,ṁ^¦m□▼´%Ẇ¿İ'm◄lẆ⌉,ωζαẇ≈eÖrżΔ#⌋≈;ẇψ▼üpẇ., wẊ)ρ ΦγyȮk⌋⌈≤%⌋XΞ, mΨX-żσ↕«½*Ξτa←⁴;X-hġ`λƒζȦ xy⌊₂₉£Yø%«ωŀ-₆k,γ⌋ẏ«Ḣu, γμȯε'ÿ?ws;ŸΨY'sĿwnŸψ⌐Ȧ¦,İ¥;ω%Zig-ZagŀΓḂs, zo₂σ†oεŻΩh;żZr↕,ΩΩŻ⁰↔s,√oż◄↑Ξ¿ψZEA-LOTS!¨-96ṁ½

Try it online!
Another lazy answer using built in compression.