[Question]
  [
I noticed a certain game had a peculiar life counter, which instead of stopping at `999`, gained a new digit ‚Äì the next number was *crown* hundred or `üëë00`. After `üëë99` came *crown hundred crownty* (`üëëüëë0`) and the last number, after `üëëüëë9`, was *crown hundred crownty crown* or `üëëüëëüëë`, which would be 1110 in decimal.
Your task is to write a [program or a function](https://codegolf.meta.stackexchange.com/a/2422/60340) that [outputs](https://codegolf.meta.stackexchange.com/q/2447/60340) this counter. 
Given an integer from the range `[0,1110]` (inclusive on both ends), output a three character string where 
* every character is from the list `0123456789üëë`
* the crown (üëë) can only appear as the leftmost character or when there's a crown to the left of it
* when this number is read as a decimal number but with the crown counting as `10`, you get back the original number
## Test cases
```
   0 ‚Üí "000"
  15 ‚Üí "015"
 179 ‚Üí "179"
 999 ‚Üí "999"
1000 ‚Üí "üëë00"
1097 ‚Üí "üëë97"
1100 ‚Üí "üëëüëë0"
1108 ‚Üí "üëëüëë8"
1110 ‚Üí "üëëüëëüëë"
```
You may use any non-decimal character instead of the crown. To encourage pretty printing, the crown character (UTF8 byte sequence "\240\159\145\145") counts as one byte instead of four. Your program doesn't have to work for numbers outside the valid range.
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so the shortest answer, measured in bytes, wins!
  
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 50 bytes
```
f=(n,p=1e3)=>n<p?(n+p+'').slice(1):'#'+f(n-p,p/10)
```
[Try it online!](https://tio.run/##bc1NCoMwFATgfU8RzCIJ/r1HEU2p7VnExqKEJDSl17dZmAqmMIuBj2GW4TP48TW7d2nsQ61TH8JN4XpUZ9HfzNXducldzpiovJ5HxVFcGGX5xE3pClcjiHW0xlutKm2ffOKEEBCC1DXJACA7HRWbqNgkiq3cNLREpYwa2lExvG1K018E2UaVbaK4byn80e6nXaq4b2m2fgE "JavaScript (Node.js) ‚Äì Try It Online")
TIO was based on Arnauld's answer. Show üëë as `#`.
[Answer]
# JavaScript (ES6), ~~¬†62 46¬†~~ 44 bytes
*Saved 2 bytes thanks to [@nwellnhof](https://codegolf.stackexchange.com/users/9296/nwellnhof)*
Outputs crowns as `x` characters.
```
n=>(n+1e4+'').replace(/1+0/,'xxx').slice(-3)
```
[Try it online!](https://tio.run/##bc1NCsMgFATgfU8h2UTJj@/RBuMivUuwpqSIhqQUb29dxAZid8N8DPMaP@Om1nl5N9Y9dJiGYIc7tRXqW1WWrF31YkalKccKeF1672O5mTlWzZUF5ezmjG6Ne9KJEkKAMcI5KQCguJwVu6TYZYpC7hpTplImjemsGN929fkvghRJpcgUj62HP9r/tM8Vj60vwhc "JavaScript (Node.js) ‚Äì Try It Online")
### How?
We add \$10000\$ to the input, coerce it to a string, look for the `/1+0/` pattern and replace it with `xxx`. Finally, we return the 3 trailing characters.
*Examples:*
$$\begin{align}&0 &\rightarrow &\text{ "}\color{red}{\text{10}}\text{000"} &\rightarrow &\text{ "xxx000"} &\rightarrow &\text{ "000"}\\
&123 &\rightarrow &\text{ "}\color{red}{\text{10}}\text{123"} &\rightarrow &\text{ "xxx123"} &\rightarrow &\text{ "123"}\\
&1023 &\rightarrow &\text{ "}\color{red}{\text{110}}\text{23"} &\rightarrow &\text{ "xxx23"} &\rightarrow &\text{ "x23"}\\
&1103 &\rightarrow &\text{ "}\color{red}{\text{1110}}\text{3"} &\rightarrow &\text{ "xxx3"} &\rightarrow &\text{ "xx3"}\\
&1110 &\rightarrow &\text{ "}\color{red}{\text{11110}}\text{"} &\rightarrow &\text{ "xxx"} &\rightarrow &\text{ "xxx"}
\end{align}
$$
[Answer]
# [Shakespeare Programming Language](https://github.com/TryItOnline/spl), ~~763~~ ~~692~~ ~~690~~ ~~689~~ 683 bytes
```
,.Ajax,.Ford,.Page,.Act I:.Scene I:.[Enter Ajax and Ford]Ford:Listen tothy!Ajax:You big big cat.Scene V:.Ajax:Remember the remainder of the quotient betweenI twice the sum ofa cat a big big cat.Ford:You be the quotient betweenyou twice the sum ofa cat a big big cat.Ajax:You be the sum ofyou a pig.Be you nicer zero?If solet usScene V.Ford:You big big cat.[Exit Ajax][Enter Page]Page:Recall.Ford:You be I.Scene X:.Page:Recall.Am I nicer zero?If notopen heart.If notlet usScene L.Ford:You big big big big big cat.Speak thy.Am I worse a cat?If soyou zero.Scene L:.[Exit Page][Enter Ajax]Ford:You be the sum ofyou a pig.Is you nicer a cat?[Exit Ajax][Enter Page]Ford:If solet usScene X.
```
[Try it online!](https://tio.run/##jVJLa4QwEP4r0/sS@rjlUrawBcFDaaFsWTxEndW0mthkxLV/3iZRaNZtoYcEMzP5XtF2zTRt2PZdnDbsUZtyw55Eha5SECScvRSo0H8cdorQgB8EoUrws5nfeCotoQLSVI9Xvs/fdA@5rMIqBC0grzzQ8Gdssc0dFtUIBlshVelO@hgKn70miYogRxoQVQI0yAJDz/atGxMeE8QZQxASaPFXlNG1/oPzIz@e9LcFdLJiDwj@oBySgS80@j45gtUNEvR2sRmJiZAPu5OkEF@2ROlzzvzmEilE05yZSJbQ9pzFI9sWkhW70qQ7l3@NwhCbC7Ge9FJPvML7dCg@nN9xxh@0sQghntmet@zpFk0pX9wEB9GPka2fYR1fYqP4ZoI/cglIF9nu2TTdXN/efQM)
Uses `" "` instead of crowns. At the cost of 4 more bytes, this could be modified to show a "visible" character instead.
## Explanation:
```
,.Ajax,.Ford,.Page,.Act I:.Scene I:.[Enter Ajax and Ford]
    Boilerplate, introducing the characters.
Ford:Listen tothy!
    Input a value to Ajax.
Ajax:You big big cat.
    Set Ford's value to 4 (we will be pushing 4 digits from Ajax onto Ford's personal stack).
Scene V:.Ajax:Remember the remainder of the quotient betweenI twice the sum ofa cat a big big cat.Ford:You be the quotient betweenyou twice the sum ofa cat a big big cat.
    DIGIT-PUSHING LOOP: Push Ajax's last digit onto Ford's stack; divide Ajax by 10.
Ajax:You be the sum ofyou a pig.Be you nicer zero?If solet usScene V.
    Decrement Ford; loop until Ford is 0.
Ford:You big big cat.
    Set Ajax's value to 4 (we will pop 3 digits from Ford's stack in the next loop).
[Exit Ajax][Enter Page]Page:Recall.Ford:You be I.
    Pop the top value off Ford's stack, and store that into Page.
    Here, Page will contain 0 if there are no crowns to be drawn,
    and 1 if there are crowns to be drawn.
Scene X:.Page:Recall.Am I nicer zero?If notopen heart.If notlet usScene L.
    DIGIT-DRAWING LOOP: Pop the top value off of Ford's stack and set Ford equal to that value.
    If there are no crowns to be drawn, output Ford's literal value here, and skip the crown-drawing section.
Ford:You big big big big big cat.Speak thy.Am I worse a cat?If soyou zero.
    Draw crown.
    If we are drawing crowns, and Ford contains 0 here, then we are now done drawing crowns, and thus we store 0 into Page.
    (Put in one more "big" for the crown to look like an @ symbol.)
Scene L:.[Exit Page][Enter Ajax]Ford:You be the sum ofyou a pig.Is you nicer a cat?[Exit Ajax][Enter Page]Ford:If solet usScene X.
    Decrement Ajax; loop until Ajax is 1 (i.e. 3 times).
```
[Answer]
# [Python 2](https://docs.python.org/2/), 53 bytes
Hats off to [Arnauld](https://codegolf.stackexchange.com/users/58563/arnauld) for **-22 bytes**. Recursion still wins, though.
```
lambda k:re.sub("1+0","CCC",`k+10000`)[-3:]
import re
```
[Try it online!](https://tio.run/##TY7LasMwEEXX8VcMs5KJEqS2wbHA7UJ0231xDXnJ1E1iGUmBFvrv7lh2TLW5nHvmgrqf8Gnbh74uPvrL/no47eGsnFn724GhXArkqLVGvjsvpaC3S8vVo6qS5tpZF8CZPhgfPBRQMsEBAOkIU54smNyMLDcTZzkVSDFynkemmDwtOaCe9yLPBs6zieXotZh5G3l7Zzl6jWmVJLV1MPwNmjamV8mic00bwAfHhqYUVbp2Xzcf2FNKy9UzcqhnRc0vvH535hjMSZGKQlax19Y5Ei8KSOC78QhN/W8MRXG/B3PxBvDNYv8H "Python 2 ‚Äì Try It Online")
# [Python 2](https://docs.python.org/2/), 51 bytes
This instead implements [tsh's recursive method](https://codegolf.stackexchange.com/a/171863/59487). Saved 2 bytes thanks to [ovs](https://codegolf.stackexchange.com/users/64121/ovs).
```
f=lambda n,p=1000:n/p and'C'+f(n-p,p/10)or`n+p`[1:]
```
[Try it online!](https://tio.run/##TY7LasMwEEXX8VcMs4lElEYqDY4Fahem2@6LMcSpJeqSykJSoYX@uys/Yrq6nHvmwrif@N7b@2Ew6tp8XtoGLHNKcM6lPThobLsttztD7N4xdxCc9v5sd@5cCVkPUYcYQEFFOAMATCukLNsQcZxZHBfOi1RgipmLYuIUi09LBliue17kIxf5wmL2JV/5NPHpxmL2JdI6y0zvYfwNOjtlkNnG@c5GCNGTsal4Te/8x1eI5IGm5f4RGZhVpeYXnr@dfou6lUlNQtRTX/beJ/EkIQl81QGhM//GoNTtHvQ1aMCXHoc/ "Python 2 ‚Äì Try It Online")
[Answer]
# [Python 2](https://docs.python.org/2/), 52 bytes
```
lambda n:['%03d'%n,'%3s'%`n`.lstrip('1')[1:]][n>999]
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSHPKlpd1cA4RV01T0dd1bhYXTUhL0Evp7ikKLNAQ91QXTPa0Co2NjrPztLSMvZ/QVFmXolCmoahoaGBJheMB5RCcAwNLJB5yOoMDRFsI83/AA "Python 2 ‚Äì Try It Online")
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 41 bytes
```
\b((.)|..)\b
$#2$*00$&
T`d`_#`(?=....)1+0
```
[Try it online!](https://tio.run/##K0otycxL/P8/JklDQ0@zRk9PMyaJS0XZSEXLwEBFjSskISUhXjlBw95WDwg0DbUN/v834DI05TI0t@SytLTkMjQwAPINLM25DA1BLEMDCyBhaAAA "Retina 0.8.2 ‚Äì Try It Online") Uses `#`s instead of `üëë`s. Link includes test cases. Explanation:
```
\b((.)|..)\b
$#2$*00$&
```
Pad 1- and 2-digit numbers to three digits.
```
T`d`_#`(?=....)1+0
```
Change leading `1`s of 4-digit numbers to `#`s and delete the next `0`.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 19 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page) - 0 = 19
```
<»∑¬¨»ßDi0…ì‚Å∂·∫ã‚Åπ·∏ä;+»∑D·∏ä·π´ ã
```
A full program printing the result using a space character as the crown.  
(As a monadic Link a mixed list of integer digits and space characters is yielded)
**[Try it online!](https://tio.run/##ATMAzP9qZWxsef//PMi3wqzIp0RpMMmT4oG24bqL4oG54biKOyvIt0ThuIrhuavKi////zExMDg "Jelly ‚Äì Try It Online")** Or see the [test-suite](https://tio.run/##y0rNyan8/9/mxPZDa04sd8k0ODn5UeO2h7u6HzXufLijy1r7xHYXIP1w5@pT3f8Ptz9qWhP5/7@BjqGpjqG5pY6lpaWOoYEBkG9gaa5jaAhiGRpYAAlDAwA).
...maybe a recursive implementation will be shorter.
### How?
```
<»∑¬¨»ßDi0…ì‚Å∂·∫ã‚Åπ·∏ä;+»∑D·∏ä·π´ ã - Main Link: integer, N    e.g. 1010       or   10
 »∑                  - literal 1000                  1000            1000
<                   - less than?                    0               1
  ¬¨                 - logical not                   1               0
    D               - to decimal list               [1,0,1,0]       [1,0]
   »ß                - logical and                   [1,0,1,0]       0
      0             - literal zero                  0               0
     i              - first index - call this I     2               1  (0 treated as [0] by i)
       …ì            - new dyadic chain with swapped arguments - i.e. f(N, I)
        ‚Å∂           - literal space character       ' '             ' '
          ‚Åπ         - chain's right argument        2               1
         ·∫ã          - repeat                        [' ',' ']       [' ']
           ·∏ä        - dequeue                       [' ']           []
                   ã - last four links as a dyad - i.e. f(N, I)
             +»∑     -   add 1000                    2010            1010
               D    -   to decimal list             [2,0,1,0]       [1,0,1,0]
                ·∏ä   -   dequeue                     [0,1,0]         [0,1,0]
                 ·π´  -   tail from index (I)         [1,0]           [0,1,0]
            ;       - concatenate                   [' ',1,0]       [0,1,0]
                    - implicit print                " 10"           "010"
```
[Answer]
# [Python 2](https://docs.python.org/2/), 40 bytes
```
lambda n:'%3s'%`10000+n`.lstrip('1')[1:]
```
[Try it online!](https://tio.run/##TY/RSsMwFIav16c4HBhNWB2JOroEqhfirfdSC5suZZWaliSCgu9eT9OuLDeH7//ODyf9bzh39naoi7ehPX69n45gdbq@8@n6IAW9jT1sWx9c07NUpryUuhqC8cFDASUTGQAgrSHPkhWTu4nlbuZcUYA0JlYqMo3ZUzMDhKUvVD6yymeWkwex8D7y/sJy8oC8SpK6czDeBo2N0@tk1bvGBqAPsDEpRcW37vPbB3bPqXnzgBnUi6LkD55/evMRzEmTikJWMX/qnCPxqIEEvhqP0NRXZSiKyz6Y1hvAlw6Hfw "Python 2 ‚Äì Try It Online")
Implements an idea similar to [Mr. Xcoder's regex-based answer](https://codegolf.stackexchange.com/a/171864/20260) but without a regex. We remove leading 1's in `10000+n` as well as the next character, then pad with spaces to length 3. The result is similar to [ovs's solution](https://codegolf.stackexchange.com/a/171877/20260) using `lstrip` but without needing two cases.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~20~~ 18 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
‚ÇÑ‚Äπi‚ÇÑ+¬¶√´T√∞.;‚Äû1 ‚Äû  :
```
Uses spaces for crowns.
[Try it online](https://tio.run/##yy9OTMpM/f//UVPLo4admUBK@9Cyw6tDDm/Qs37UMM9QAUgoKFj9/29oYGAIAA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9TVnl4gr0S56O2SQoKSvb/HzW1PGrYmQmktA8tO7w65PAGPetHDfMMFYCEgoLV/1p1Jb3DO3T@G3AZApEpl6G5JZcFkGlpaQkUMQAJGxiCCBAXpMTA0pzL0BAkYQiSMDSwABKGBgA).
**Explanation:**
```
‚ÇÑ‚Äπi               # If the (implicit) input is smaller than 1000:
   ‚ÇÑ+             #  Add 1000 to the (implicit) input
     ¬¶            #  And remove the leading 1 (so the leading zeros are added)
                  #   i.e. 17 ‚Üí 1017 ‚Üí "017"
  √´               # Else:
   T√∞.;           #  Replace the first "10" with a space " "
                  #   i.e. 1010 ‚Üí " 10"
                  #   i.e. 1101 ‚Üí "1 1"
                  #   i.e. 1110 ‚Üí "11 "
       ‚Äû1 ‚Äû  :    #  Replace every "1 " with "  " (until it no longer changes)
                  #   i.e. " 10" ‚Üí " 10"
                  #   i.e. "1 1" ‚Üí "  1"
                  #   i.e. "11 " ‚Üí "   "
```
[Answer]
# [Clean](https://github.com/Ourous/curated-clean-linux), 87 bytes
Doesn't output crowns (uses `c`).
```
import StdEnv,Text
$n#i=3-n/1000-n/1100-n/1110
=("ccc"+lpad(""<+n rem(10^i))i'0')%(i,9)
```
[Try it online!](https://tio.run/##Xc9Ba8MgFAfw8/wUYjuq1DBllFRobt1hsMOgu60diEmKoCYkL2P78nNmyXLo5f35vceTp3GVDtE35eAq7LUN0fq26QCfoHwKn/yt@gK0DitbPGbhQQohxpBzSIEKSowxZOtaXVJCDtuAu8pTKT4sY3YjNuyeWq5YPIHuAK0wVD30uMDvVHBM0oOEcXRH5W6U3M3KVWKqE5Uameo8TVvJZtkVKh@t8tlymhuxeP/n/b/lNDeEXdJJ9RAM2Cakq9ZovGxp2NAOwHEzQEqGz2dMb1qHbPrRJf6Y2ulrH7Pnl3j8DtpbM@HVaaibzv8C "Clean ‚Äì Try It Online")
```
$ n                   // function $ of `n`
 # i =                // define `i` as (the number of digits that aren't crowns)
  3 -                 // three minus
  n / 1000 -          // 1 if first digit is crown
  n / 1100 -          // 1 if second digit is crown
  n / 1110            // 1 if third digit is crown
 = (                  // the string formed by
  "ccc" +             // prefixing three crowns to
  lpad (              // the padding of
   "" <+ n rem (10^i) // non-crown digits of `n`
  ) i '0'             // with zeroes
 ) % (i, 9)           // and removing the extra crowns
```
# [Clean](https://github.com/Ourous/curated-clean-linux), 99 - 3 = 96 bytes
This one has crowns.
```
import StdEnv,Text
$n#i=3-n/1000-n/1100-n/1110
=("üëëüëëüëë"+lpad(""<+n rem(10^i))i'0')%(i*4,99)
```
[Try it online!](https://tio.run/##Xc/BSsQwEADQs/2KkF3ZxE0xQZduYHvTg@BBWG/uCiFtJdAkpZ2KfsZ@gb/oFxhT2@3BQ2Z4M8ww0XWpXLC@6OsSWWVcMLbxLaA9FPfunT2XH5As3cLkN6m7FpzzIYkpCZ7kBH9/nU7nh9d1owqC8W7tUFtaIvirodSs@IpeEnN1y6SkYQ@qhWSBoOygQzl6IZwhHJdjypILIjaDxGZSJiNjHCnlwBinbpyK1vMsl9lgmU0WY1/z2ds/b88WY19jeownVb3TYLyLVy2T4bK5YFzTA0O@h5gpOhwQ@VfapeOPjuFHV7V660L68BjuPp2yRo94qhVUvrW/ "Clean ‚Äì Try It Online")
[Answer]
# Japt, 20 bytes
A na√Øve (and slightly drunk!) port of Arnauld's solution. Uses `"` for crown.
```
U+A¬≥ s r"^21*0"_√ßQ√É√Ö
```
[Try it](https://ethproductions.github.io/japt/?v=1.4.6&code=VStBsyBzIHIiXjIxKjAiX+dRw8U=&input=MTExMA==)
[Answer]
# Java 10, ~~84~~ 83 bytes
```
n->{for(int p=100,t;p>0;n-=t%12*p,p/=10)System.out.printf("%c",t=n/p>9?46:48+n/p);}
```
Port of [*@tsh*' C comment](https://codegolf.stackexchange.com/questions/171860/crown-hundred-crownty-crown/171926#comment414886_171871).  
Uses `.` instead of crowns.
[Try it online.](https://tio.run/##XZFNboMwEIX3nGIUKRK0QKBKm1AEPUGzybLqwnUgcgLGgiFVFXF2OnZYYDaWv/H8vDe@sBsLLqfryCvWdfDJhLw7AEJi0ZaMF3DQCHBrxAm4S3GQXkqhwaGjQ4aCwwEkZDDKIL@XTWuSVBZHkY@pyqNUBhmu45cn5asNhb3jX4dFHTY9hqql5NJdrfnKx0xuVJ58bN/et/tnunvpMKZ6jOp/KhozTTNSahLqHpHKz1/fwLyHSi0fatIii18DrtEKgEWHbjSH@NWiXTLHJLGQrNi1UbzgZGdxvMinggXvbZ76zZdqbJpnvU8hVY@TSxnqj9D86LHcZzXZHpxh/Ac)
**Alternative approach (84 (87-3) bytes):**
```
n->f(n,1000)String f(int n,int p){return n<p?(n+p+"").substring(1):"üëë"+f(n-p,p/10);}
```
Port of [*@tsh*' JavaScript's answer](https://codegolf.stackexchange.com/a/171863/52210).
[Try it online.](https://tio.run/##XZFLboMwEIb3OcWIlS3AxYsqpenjBM0my6oLh5jKKZlYeEhVRRwiJ@gVewNqDAtgM9bn@f17Hkd1Uenx8NUVlXIO3pTB6wrAIOm6VIWGbY8AO6oNfkLBfAaQb/xlu/JhCwjP0GH6UjJMZJZlfDNqy0Gb9NHya62pqRHwyb4yjG0cRVy4Zu@CmEn@GP393m5R7H1Sm9g76Z3aDsA2@8oU4EiRPy5nc4CTr5INv7x/gOJDiaQdsSyUNoK8n9E6n2Kez3Aofcpywfl6xnKh9w8W/DDn0S@MbdpNSPdDMmgbGpvZ/TjSJ3FuSFjfJ1XIUH@H/TAuUPSL6NWjZdv9Aw)
[Answer]
# [APL (Dyalog Unicode)](https://www.dyalog.com/), 32 bytes
```
1e3‚àò{‚çµ<‚ç∫:1‚Üì‚çï‚çµ+‚ç∫‚ãÑ'C',(‚çµ-‚ç∫)‚àá‚ç®‚ç∫√∑10}
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///3zDV@FHHjOpHvVttHvXusjJ81Db5Ue9UIFcbyH3U3aLurK6jAeTqArmajzraH/WuALIObzc0qP2f9qhtwqPevkd9Uz39H3U1H1pv/KhtIpAXHOQMJEM8PIP/P@pdlXZohYGCoamCobmlgqWlpYKhgQGQb2BprmBoCGIZGlgACUMDAA "APL (Dyalog Unicode) ‚Äì Try It Online")
Prefix direct function.
Port of [@tsh's JS Answer](https://codegolf.stackexchange.com/a/171863/52210).
### How:
```
1e3‚àò{‚çµ<‚ç∫:1‚Üì‚çï‚çµ+‚ç∫‚ãÑ'C',(‚çµ-‚ç∫)‚àá‚ç®‚ç∫√∑10} ‚çù Main function, arguments ‚çµ and ‚ç∫ (‚çµ ‚Üí input, ‚ç∫ ‚Üí 1000).
     ‚çµ<‚ç∫:                          ‚çù If ‚çµ<‚ç∫
         1‚Üì                        ‚çù Drop (‚Üì) the first element (1) of
           ‚çï                       ‚çù Format (‚çï); 'stringify'
            ‚çµ+‚ç∫                    ‚çù ‚çµ+‚ç∫
               ‚ãÑ                   ‚çù else
                'C',               ‚çù Concatenate (,) the literal 'C' with
                         ‚àá‚ç®        ‚çù Recursive call (‚àá) with swapped arguments (‚ç®)
                    (‚çµ-‚ç∫)  ‚ç∫√∑10    ‚çù New arguments; ‚çµ ‚Üí ‚çµ-‚ç∫; ‚ç∫ ‚Üí ‚ç∫√∑10
```
[Answer]
# PHP, 71 bytes
```
for($n=$argn,$x=1e4;1<$x/=10;$n%=$n<$x?$x/10:$x)echo$n<$x?$n/$x*10|0:C;
```
prints `C` for the crown. Run as pipe with `-nR` or [try it online](http://sandbox.onlinephpfunctions.com/code/5f05b30fbdb0fbb154ad609e981136f7dbc83387).
[Answer]
# [Haskell](https://www.haskell.org/), 48 bytes
```
('2'#).show.(+1000)
n#(a:x)|n==a='c':'1'#x|1>0=x
```
[Try it online!](https://tio.run/##Hc1BDoIwEAXQvaeYBJNpQyFTV4WknEBXLsWYxogQoTaCkQWX4ARe0RNYqZuf9zPJ/Nr0t0vb@kqXnuEGI5729f2VslgSEV/ZiJl85JPV2mj8vOcZc5QYjZMsSI@@M40FDZ1xuxOwsoGkAPcc9sNja2ENLDyDhscxlgPmrFrM4UBCCalElollRSgV@DeFCAo13JYIknT033PVmmvvk7NzPw "Haskell ‚Äì Try It Online")
[Answer]
# C, ~~¬†84¬†~~ 58 bytes
*Thanks to @tsh for saving 25 bytes and thanks to @ceilingcat for saving a byte!*
```
f(n,p){for(p=1e3;p/=10;)n-=putchar(n/p>9?46:48+n/p)%12*p;}
```
[Try it online!](https://tio.run/##bcxBDoIwEAXQPacgJCZTtaGjKNSmepamsUACdQK4Ilzd2oU7O6ufl//H8tbaEBz4I7HVvSYgjc@zolKjUMxzTe/FdmYCX9JdPqrrrWoOMbMdnvakttD7JR9N74Fla5bHcyCYiqsZioKpH@ElYbX8RykTiEKkfgpZJxSTXRRNSjF2sy18rBtMOwc@jF8)
[Answer]
# [sed](https://www.gnu.org/software/sed/), 39
48 bytes, but score is 39, since each üëë counts as 1.
```
/..../s/^1+0/üëëüëëüëë/
s/^/00/
s/.*(...)/\1/
```
[Try it online!](https://tio.run/##NUrJDcIwEPxvJRDk7MwDme0F5QWK8rEjDIW4AlqkApb1g5Hm1LT7La3l5a5zQJsuPEE/797/VIlRgeHzdIjXUa9UdwjPwmxiZkIgOiwLORJxCSG@dX9utTRPjx8 "sed ‚Äì Try It Online")
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 38 - 9 = 29 bytes
*-2 bytes thanks to Jo King*
```
{~m/...$/}o{S/1+0/üëëüëëüëë/}o*+1e4
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/ui5XX09PT0W/Nr86WN9Q20D/w/yJE2EYKKqlbZhq8t@aqzixUkElXkdBXeFR2yQFdR2FNA2VeE2FtPwiBQMdBUNTIDa31FGwtAQShgYGIDEDS3MgaQhmGxpYgEhDg/8A "Perl 6 ‚Äì Try It Online")
Inspired by Arnauld's JavaScript solution.
[Answer]
# [Pip](https://github.com/dloscutoff/pip), 21 bytes
```
(a+t*mR`1+0`'xX3)@>-3
```
[Try it online!](https://tio.run/##K8gs@P9fI1G7RCs3KMFQ2yBBvSLCWNPBTtf4////hgYGBgA "Pip ‚Äì Try It Online")
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 15 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
√ßi‚ïñ@u;‚ïüw‚òº7√∏4œÉcH
```
[Run and debug it](https://staxlang.xyz/#p=8769b740753bc7770f370034e56348&i=0%0A15%0A179%0A999%0A1000%0A1097%0A1100%0A1108%0A1110&m=2)
Same idea as Arnauld's answer.
]