title: Translate oOo CODE

text:
# Question
Title: Translate oOo CODE
Given an input of a program written in oOo CODE, output the BF code that it represents.

Here is a short description of how oOo CODE works:

* First, all non-alphabetic characters are removed (everything not in the range `A-Za-z`).

For example, take the program `PROgRam reVERsES giVeN iNPut sEqUENcE` (an example given on the esolangs wiki page that does exactly what you'd expect). After this first step, we now have `PROgRamreVERsESgiVeNiNPutsEqUENcE`.
* Next, divide all remaining characters into groups of 3. We now have `PRO,gRa,mre,VER,sES,giV,eNi,NPu,tsE,qUE,NcE`. If there is a trailing group of 1 or 2 characters, discard it.
* Convert each group of 3 letters into a BF command based on the following table:

```
ooo  >
ooO  <
oOo  [
oOO  ]
Ooo  -
OoO  +
OOo  .
OOO  ,

```

That is, if the first letter of a group is lowercase, the second is uppercase, and the third is lowercase, it would translate to the command `[`.

With our example, this finally becomes the BF program `,[>,]<[.<]+`, which does indeed reverse its input.

Since this is , the shortest code in bytes will win.

Test cases:

```
<empty string> -> <empty string>
A -> <empty string>
Ab -> <empty string>
Abc -> -
AbcD -> -
AbcDe -> -
AbcDef -> --
1A_b%c*D[]e\\\f! -> --
PROgRamreVERsESgiVeNiNPutsEqUENcE -> ,[>,]<[.<]+

```

# Answer
> 130 votes
# oOo, ~~1569~~ 1515 bytes

Had to be done. Try it here.

Golfed:

```
oooooooooOoOoooooooooooooooOoOooooooOOOoOoooooooOoOOoOOoOOoOOoOOoOOoOOoOoOoooOOoOOoOOoOOoOOoOOoOOoOOoOoooOoooOOooOOoOooOoOoOoooooOoooOoooooOOooOooOoOOooOoOoOoooooOoOooooOoOoooooOoOooOoOOoooOoOooooooOoOOoOOoOOoOOoOoOoooOOoOOoOOoOOoOOoOoooOoooOOooOOoOOoOooOoOoOoooooOoooOoooooOOooOooOoOOooOoOoOoooooOoOooooOoOoooooOoOooOoOOoooOoOoooOoOOoOOoOOoOOoOOoOOoOooOoOoOoooooOoooOoooooOOooOooOoOOooOoOoOoooooOoOooooOoOoooooOoOooOoOOoooOoOooooooOoOOoOOoOOoOOoOoOoooOOoOOoOOoOOoOOoOoooOoooOOooOOoOOoOooOoOoOoooooOoooOoooooOOooOooOoOOooOoOoOoooooooooOoOoooOOooOooOoOOooOoOoOooooOooOooOooOooOooOooOooOooOooOooOOoOoooooooooooooooooooooooooooooooooooooooooooOoOoooOOooOooOooOooOoOOoOOooOoOoOooooooooooooOoOoooOOooOooOooOooOoOOoOOooOoOoOooooOooOooOooOooOooOooOooOooOOoOooooooooooooOoOoooooooooooooooooooooooooOoOoooOOooOooOooOooOoOOoOOooOoOoOooooooooooooOoOoooOOooOooOooOooOoOOooOooOooOooOooOooOooOoOoooooOooooooooooooooooOoOOoOOoOOoOOoOOoOoOoooOOoOOoOOoOOoOOoOOoOOoOoooOoooOOooOOoOOoOooOooOooOoOoooooOoooooOoooOOoooooOoooOOooOoOoooooooOoOOoOooOooOOoooOOooOOooooooOOooOoOooooOoOooooOooooOooooOooOOoooooOoooOOooOoOoooooooOoOooOooOOoooOOooOOoooOOooOOooooooOOooOoOooooOoOooooooooooooOoOOoOOoOOoOoOoooOOoOOoOOoOOoOoooOoooOOooOooOooOoOooooooooooOoOOoOOoOOoOOoOoOoooOOoOOoOOoOOoOOoOOoOoooOoooOOooOOoOooOoOooooOoOOoOooOooOOoooooOoooOOooOoOoOoooOOooOOooooooOOooOoOooooOoOooooOoooOOoooooOoooOOooOoOoooooooOoOOoOooOooOOoooOOooOOoooOOooOOoooOOOoOooooooooooooOOooOoOoooOOooOooOooOooOooOOooooOOooooOOoooOOoOOooooooooooooooooooooooooOoOooooooOOOoOO

```

Translated to Brainfuck (with linebreaks for clarity):

```
>>>+>>>>>+>>,[>>++++++++[<++++++++>-]<+<[->-[>]<<]<[->+>[->+<]>+>>+++++[<+++++>-
]<++<[->-[>]<<]<[->+>[->+<]>+>+++++++<[->-[>]<<]<[->+>[->+<]>+>>+++++[<+++++>-]<
++<[->-[>]<<]<[->>[-]<<]<[-<<<<<<<<<<<+>>>>>>>>>>>>>>[-]<<<<]]<[->>>[-]<<<<]]<[-
<<<<<<<<<+>>>>+>>>>>>>>[-]<<<<]]<[->>>[-]<<<<]<<<<<<<[>[>>>>>++++++[<+++++++>-]<
++<<<[>[>[<->-]<[>>++<<-]<->]<[>+>[>-<<->-]<[>>+<<-]<-]<->]<[>+>>>>++++[<++++>-]
<<<[>>>+++++[<++++++>-]<+<[>++<<->-]<[-]<->]<[>+>[<->-]<[>>++<<-]<-]<-]+>>>>.[-]
<<<<<-<-<-]]>>>>>>>>+>>,]

```

Ungolfed with explanation:

```
this progrAm Translates ooo codE tO brainfUCK cOde. i guesS sINcE ThE ExAMpLE
tEXt WAs SeLf-doCUmENtINg, I ShOUlD PrOBaBLy Make This SElf-DOcUmeNtInG too.

oh, I shoUld menTIon ThaT i WRotE tHe OriginAl BrainFuCk code EnTirElY By haNd.
If you waNt TO sEE tHE bRAiNfUck cODe, RUn THiS PrOGrAm wiTh itSElf AS iNPuT!

baSiCaLly, thiS proGram seTS up MemOrY As fOlLoWs: the fIrSt thrEe Bytes aRe
"ValId" FLags (V0, v1, V2), theN tHErE'S a BArRIeR (A 1) fOLlOweD bY tHree
"vaLue" bIts (b0, b1, b2). THe rEst Of THe aRrAy Is basiCaLly juSt ScratcH
sPacE. tO Save SpAce, i'm slIdINg THe POiNTeR fOrwaRD bY OnE In EAcH ItEratIon
uNTil THe POiNteR hItS the baRrieR, at whiCH poInt ThE ProGrAm Prints out tHe
ConvERteD chArACteR.

tHe ProgrAm eXteNsiVelY usEs tHe cLevEr "gReaTEr-Than" comparison operator
described by dheeraj ram aT
hTtp://sTAckOveRflOw.cOm/QUeSTioNs/6168584/BrAinfuck-comparE-2-nUmbeRS. i hAppEn
tO reAlLY lIKe tHiS iMplemEntAtiOn bEcaUse It iS boTh cOMpAct and nestablE,
wHich is critical for my bf code tO wOrk pROpeRly.

I seT up ThE ReQUisItE sTructure, then pErForm A BunCh oF neSteD cOMpaRisOns
ThaT loOk rOugHlY like tHis:

    if(in >= 65 /* capital a */) {
        if(In <= 90 /* CApITaL Z */) {
            vI = 1
            Bi = 1
        } ELsE {
            iF(in >= 97 /* lOWeRCaSE a */) {
                IF(iN <= 122 /* LoWErCAsE z */) {
                    vi = 1
                }
            }
        }
    }

At thE End OF tHEsE coMpaRisOnS, if the V (valid) Bit iS Set, the ProgRAm sTePs
the poiNtER rIghTwaRDs. if IT hiTS the barRIer, It Then gOeS into A big sEt of
nEstED condiTionALs tHaT test the AcCumUlaTEd vaLUe bITs, anD ConSTruct thE
CorReSpondInG character to pRiNT oUT. tHEn It ReseTS bACk TO tHE iNitiAl stATe.

fInaLly, It Reads anotheR iNPuT ChARaCTeR aNd goES bACk TO lOOpINg.

SO tHere You hAVe iT - An Ooo To BrainFuCK cOnvErtER writtEn in OOo (aNd
BrAinfUCk, bY ExtensiON!). siNcE i havE a Few moRe chARacterS to sPAre In This
progRaM, HeRe's A coUPle oF StrESs teST paTTernS:

0123456789ABcDefghijklmnopQRstUvWxyzABcdEfgHijKlmNopQRstuvWXyz!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
 ~}|{`_^]\[@?>=<;:/.-,+*)('&%$#"!zyXWvutSRqPOnmlkjihgfedcbazyxwvutsrqPoNmlkjihGFEdCBa9876543210

```

Thanks for the interesting challenge!

# Answer
> 15 votes
## CJam, ~~36~~ 35 bytes

```
l{el_eu-},'_f<0+3/W<2fb"><[]-+.,"f=

```

Test it here.

### Explanation

```
l               e# Read input.
{el_eu-},       e# Discard all characters that don't change in a lower/upper case
                e# transformation, i.e. non-letters.
'_f<            e# Compare with '_' to determine case as 0 or 1.
0+              e# Append a zero.
3/              e# Split into chunks of 3.
W<              e# Discard last chunk.
2fb             e# Convert each chunk from base 2.
",.+-][<>"f=    e# Select the corresponding character for each chunk.

```

# Answer
> 9 votes
# JavaScript (ES6), ~~94~~ ~~93~~ ~~91~~ ~~85~~ ~~84~~ 83 bytes

*Saved 1 byte thanks to @dev-null*

```
x=>x.replace(/[a-z]/gi,c=>(a+=c<'a'|0)[2]?b+="><[]-+.,"['0b'+a-(a="")]:0,a=b="")&&b

```

I've tried many variants of this, but this seems to be the shortest. Also works on empty input!

### How it works

First, with `x.replace(/[a-z]/gi,c=>`, we find take each letter `c` in the input. We set `a` and `b` to `""` at the other end of the function call, since the function ignores any parameters past the second. `a` will store a binary string for determining which character we are currently making, and `b` will store the result.

Now for the confusing part: first, with `(a+=+(c<'a'))`, we append a `0` to `a` if `c` is uppercase; `1` otherwise. This expression returns the new value of `a`, so then we can check if it has reached three chars of length with by checking if the character at index 2 exists:`[2]?`. If not, we simply end the function with `:0`.

If `a` is now three chars in length, it is a binary number between `000` and `111`. We can convert this to a decimal number by appending `"0b"` to the beginning, then forcing the engine to parse it as a number with `'0b'+a-0`.

However, we still need to reset `a` to the empty string. We can't just do `'0b'+(a="")-0` because that would mean the string parsed is just `0b`. Fortunately, when parsed as a number, the empty string becomes 0, so we can replace the `0` with `(a="")`.

Now we have our number, and we can just append the character at that index in `"><[]-+.,"` to `b`. After the replace is done, we use `&&b` to return it from the function. (Well, unless the result of `.replace` is empty, which only happens on empty input and returns the empty string anyway.)

# Answer
> 8 votes
# 05AB1E, ~~35~~ 32 bytes

Code:

```
á0«3÷\)vyS).uïJC",.+-][<>"Sr@?)\

```

Using a very clever trick from Martin Büttner, from this answer. Explanation:

```
á0«                               # Remove all non-alphabetic characters and append a zero
   3÷\                            # Split into pieces of 3 and discard the last one
      )v                          # Wrap everything into an array and map over it
        yS).uï                    # Is uppercase? Converts AbC to [1, 0, 1]
              JC                  # Join and convert from binary to int
                ",.+-][<>"        # Push this string
                          S       # Split the string
                           r@     # Reverse the stack and get the character from that index
                             ?    # Pop and print without a newline
                              )\  # Wrap everything into an array and pop

```

Try it online!

Uses **CP-1252** encoding.

# Answer
> 8 votes
## Retina, ~~79~~ ~~75~~ ~~71~~ 70 bytes

*Thanks to randomra for saving 1 byte.*

```
i`[^a-z]

M!`...
m`^
;
+`(.*);(.)
$1$1$2;
T`l
.+
$.&
T`d`_><[]\-+.,
¶

```

Try it online!

### Explanation

```
i`[^a-z]

```

We start by removing everything that's not a letter.

```
M!`...

```

This splits the string into chunks of three characters by returning all (non-overlapping) 3-character matches. This automatically discard any incomplete trailing chunk.

```
m`^
;

```

Prepend a `;` to each line. We'll use this as a marker for the base-2 conversion. Speaking of which, we'll simply treat upper-case letters as `1` and lower-case letters as `0`.

```
+`(.*);(.)
$1$1$2;

```

This does a funny base-2 to unary conversion. At each step we simply double the characters left of the `;` and move the `;` one to the right. Why does this work? Remember we'll be interpreting lower case as `0` and upper case as `1`. Whenever we process a letter, we simply double the running total (on the left) so far - double lower-case letters are just `2*0=0`, so they can be completely ignored and upper-case letters represent the binary number so far, so doubling them is what we want. Then we add the current letter to that running total which represents `0` or `1` correspondingly.

```
T`l

```

Remove all lower-case letters/zeroes.

```
.+
$.&

```

Match each line and replace it with the (decimal) number of characters in that line. Due to the `;` this turns the unary number into its decimal equivalent + 1.

```
T`d`_><[]\-+.,

```

Transliteration which substitutes 1-8 with the corresponding command.

Remove linefeeds.

# Answer
> 7 votes
# MATL, ~~38~~ 32 bytes

```
'><[]-+.,'jt3Y2m)3ZCtAZ)92<!XBQ)

```

**Try it online!**

```
'><[]-+.,'      % push string with BF commands
j               % read input as a string
t               % duplicate
3Y2             % predefined literal: string 'A...Za...z'
m               % true for elements of input string that are letters
)               % index into input string to keep only letters
3ZC             % 2D array whose columns are non-overlapping slices of length 3.
                % The last column is padded with zeros if needed
tA              % duplicate. True for columns that don't contain zeros
Z)              % keep those columns only. This removes padded column, if any
92<             % 1 for upper case letters, 0 for lower case letters in the 2D array
!               % transpose so each group of 3 is a row
XBQ             % convert each row from binary to decimal and add 1
)               % index into string containing the BF commands. Implicitly display

```

# Answer
> 5 votes
# Japt, ~~37~~ 36 bytes

```
Uo"%l" f'.³ £",><[]-+."gX®c ¤gJÃn2Ãq

```

Test it online!

### How it works

```
Uo"%l" f'.³ £  ",><[]-+."gX®   c ¤  gJÃ n2Ã q
Uo"%l" f'.³ mX{",><[]-+."gXmZ{Zc s2 gJ} n2} q

Uo"%l"      // Get rid of all non-letter chars in U.
f'.³        // Take each set of three chars in U.
mX{      }  // Map each item X in this group to:
XmZ{     }  //  Map each letter Z in X to:
Zc s2 gJ    //   Take the char code of Z as a binary string, and take the first char.
            //   This maps each character to 1 if it's UC, or 0 if it's lc.
        n2  //  Interpret the result as a binary number.
",><[]-+."g //  Get the item at this index in this string.
q           // Concatenate the result and implicitly output.

```

# Answer
> 4 votes
## JavaScript (ES6), ~~111~~ 95 bytes

```
s=>s.match(/[A-Z]/gi).map(c=>+(c<'a')).join``.match(/.../g).map(g=>'><[]-+.,'['0b'+g|0]).join``

```

Simply removes non-letters, converts upper case letters into 1s and lower case into 0s, divides into groups of three, ignores a trailing group of 1 or 2, and decodes the groups.

Edit: Saved 16 bytes thanks to @dev-null, although the code no longer works when passed the empty string.

# Answer
> 3 votes
# Pyth, 40 bytes

```
jkm@"><[]-+.,"id2f!%lT3cm?rId0Z1f!rIT2z3

```

Try it here!

Could save 2 bytes if I can output the result as list of characters instead of a string.

## Explanation

Filters out all non-letters, converts uppercase to 1 and lowercase to 0, splits into chunks of 3, interprets every chunk as binary number and uses this as index into a string which contains all BF commands.

```
jkm@"><[]-+.,"id2f!%lT3cm?rId0Z1f!rIT2z3  # z = input

                                f     z   # filter input with T
                                 !        # logical not
                                  rIT2    # T == swapcase(T), true if T is not a letter
                        m                 # map filter result with d
                         ?rId0            # if d == toLower(d)
                              Z1          # 0 for lowercase, 1 for uppercase
                       c               3  # Split into chunks of 3, last element is shorter if needed
                 f                        # filter with T
                  !                       # logical not
                   %lT3                   # len(t) mod 3 -> keep only elements of length 3
  m                                       # map with d
              id2                         # Convert from binary to decimal
   @"><[]-+.,"                      # Get the resulting BF command
jk                                        # Join to a string

```

# Answer
> 3 votes
# Jolf, ~~31~~ 34 bytes

Try it here! Replace  with `\x10` and  with `\x05`. Because I implemented the chop function wrong, I gain 3 bytes. :(

```
►ΜZeZcAAρi♣Epu1pl033d."><[]-+.,"ΙH
        ρi♣E                        remove all space in input
       A    pu1                     replace all uppercase letters with 1
      A        pl0                  replace all lowercase letters with 0
    Zc            3                 chop into groups of three
  Ze               3                keep groups of length three
 Μ                  d               map
                              ΙH   parse element as binary
                     ."><[]-=.,"    and return a member of that
►                                  join by nothing

```

# Answer
> 3 votes
## Hoon, 212 bytes

```
=+([v=turn c=curr q=cold k=tape] |=(t/k `k`(v (v `(list k)`(need ((unit (list k)) p:(rose (murn t (c rush alf)) (star (stun [3 3] ;~(pose (q '0' low) (q '1' hig))))))) (c scan bin)) (c snag (rip 3 '><[]-+.,')))))

```

Ungolfed:

```
|=  t/tape
^-  tape
%+  turn
  %+  turn  ^-  (list tape)
  %-  need  %-  (unit (list tape))
    =+  t=(murn t (curr rush alf))
    p:(rose t (star (stun [3 3] ;~(pose (cold '0' low) (cold '1' hig)))))
  (curr scan bin)
(curr snag (rip 3 '><[]-+.,'))

```
1. use ++murn to get rid of all characters in the input that can't be parsed with "alf" (alphabet)
2. parse the list with a combinator that outputs each 3 characters at a time to a list, replacing lowercase with '0' and uppercase with '1'
3. Cast the result to (unit (list tape)) and forcibly unwrap it to get the furthest parsed result, to work with only multiple of threes without crashing
4. Map over the list, parsing each group as if it were binary
5. Use each number in the list as an index into the text '\>\<\[\]-+.,', and cast the list back out to a tape.

Hoon doesn't have proper regular expressions, only a parser combinator library, so it's sadly pretty verbose. ++scan also crashes if the entire input stream isn't parsed, so I have to use ++rose, coerce it into a unit, and unwrap it for the "farthest parse" value. It also makes heavy use for currying and mapping over lists (++turn), so I alias the function names to one letter variables.

Hoon is the programming language for Urbit, a clean slate reimplementation project. It's purely functional, statically typed, vaguely lisp-like, and compiles to Nock. Nock is a combinator based VM that runs on top of a binary tree bignum memory model.

When you boot Urbit you are dropped into :dojo, the shell and Hoon repl. To run the snippet simply type:

```
%.  "PROgRam reVERsES giVeN iNPut sEqUENcE"

```

and then paste the standalone function on the next line.

# Answer
> 3 votes
## Python 3, 91 bytes

```
b=1
for c in input():
 b=-~c.isalpha()*b+c.isupper()
 if b>7:print(end="><[]-+.,"[b-8]);b=1

```

Hmm... looks a bit long, especially the second line. `b=[b,2*b+(c<'a')][c.isalpha()]` is slightly worse though.

# Answer
> 3 votes
## Jelly, 27 bytes

```
=Œs¬Tịµ=Œu;0s3ṖḄ€ị“<[]-+.,>

```

Try it online! Note that backslashes need escaping in the input string for the second last test case.

```
Implicit input: string s (list of characters)

=Œs             Compare with swapcase
¬               Not - this gives 1 for letters, 0 otherwise
Tị              Take characters at truthy indices
µ               Start a new monadic chain

Input: string s' (list of letters)

=Œu             Compare with uppercase
;0              Append 0
s3              Split into chunks of length 3
Ṗ               Pop last chunk
Ḅ€              Apply convert-from-binary to each chunk
ị“<[]-+.,>      For each number, 1-based index cyclically into the string "<[]-+.,>"

```

# Answer
> 2 votes
# Matlab, 98 bytes

```
function t(s);s=s(isletter(s));s=s(1:end-mod(end,3));r='><[]-+.,';r([4 2 1]*reshape(s<92,3,[])+1)

```
1. Clean
2. Trim
3. reshape into a 3xn Matrix m with UC = 1, lc =0
4. (4 2 1)\*m+1 results in an index list
5. Index to the right chars

# Answer
> 2 votes
# Vyxal, 154 bitsv2, 19.25 bytes

```
Ǎvæ3ẇ'L3=;vBkTṖ»AǑ»iiṅ

```

Try it Online!

```
Ǎ                      # remove non alphabeticals
 væ                    # get the case of each char (0 for lower, 1 for upper)
   3ẇ                  # wrapped into chunks of length 3
     'L3=;             # keep only those of length 3
          vB        i  # converted from binary and indexed into
            kTṖ»AǑ»i   # the 16560th permutation of the BF instruction set
                     ṅ # join by nothing

```

# Answer
> 1 votes
# Perl, ~~76~~ ~~73~~ 72 + 1 = 73 bytes

```
$a.=y+A-Z++dfor/[A-Z]/gi;print substr"><[]-+.,",oct"0b$_",1for$a=~/.../g

```

Requires the `-n` flag:

```
$ perl -n oOo.pl <<< 'PROgRamr{}\eVERsESgiVeNiNPutsEqUENcE'
,[>,]<[.<]+

```

Using the trick with base-2 conversion.

How it works:

```
                          # '-n' auto read first line into `$_`
            for/[A-Z]/gi; # Iterate over all letters a-z
$a.=y/A-Z//d              # Count number of uppercase letters (1 or 0)

                                  for$a=~/.../g # Split $b into hunks of 3 characters. And
                                                # remove any potential trailing characters.
      substr"><[]-+.,",oct"0b$_",1              # `oct("0b$binary")` will convert binary
                                                # to decimal.
print

```

# Answer
> 1 votes
# Ruby ~~117~~ ~~114~~ ~~113~~ ~~111~~ ~~86~~ 79 Bytes

```
gets.tr(?^+m='a-zA-Z','').tr(m,?0*26+?1).scan(/.../){$><<"><[]-+.,"[$&.to_i 2]}

```
* `tr(?^+m='a-zA-Z','')` sets m to `'a-zA-Z'` and removes non-letters
* `.tr(m,?0*26+?1)` converts lowercase to 0, uppercase to 1
* `.scan(/.../)` chunk string into groups of 3 and discard last group if it has less than 3
* `{$><<"><[]-+.,"[$&.to_i 2]}` convert each binary number to a character

# Answer
> 1 votes
# Julia, 107 bytes

```
s->"><[]-+.,"[map(j->parse(Int,j,2)+1,[map(i->i<'_'?'1':'0',m)for m=matchall(r"\w{3}",filter(isalpha,s))])]

```

This is an anonymous function that accepts a string and returns a string. To call it, assign it to a variable.

Ungolfed:

```
function f(s)
    # Brainfuck commands
    bf = "><[]-+.,"

    # Filter out non-alphabetic characters from the input
    chars = filter(isalpha, s)

    # Get all non-overlapping groups of three characters
    groups = matchall(r"\w{3}", chars)

    # Construct binary strings by comparing to _
    binary = [map(i -> i < '_' ? '1' : '0', m) for m = groups]

    # Parse each binary string as an integer and add 1
    indices = map(j -> parse(Int, j, 2) + 1, binary)

    # Return the Brainfuck commands at the indices
    return bf[indices]
end

```

# Answer
> 1 votes
## Lua, 120 Bytes

Big use of `string.gsub()` here, one more time could have allowed me to create a one character pointer on this function to gain some bytes. Also, it is my first lua program without any spaces! :D

This program takes its input via command-line argument and output a BrainFuck program, one command per line.

**Edit: Saved 1 Byte thanks to @Oleg V. Volkov**

```
arg[1]:gsub("[%A]",""):gsub("%l",0):gsub("%u",1):gsub("...",function(c)x=1+tonumber(c,2)print(("><[]-+.,"):sub(x,x))end)

```

### Ungolf and explanations

```
arg[1]:gsub("[%A]","")    -- replace the non-letter character by an empty string
                          -- %A matches all the character not in %a (letters)
:gsub("%l",0)             -- replace lower case letters by 0s
:gsub("%u",1)             -- replace upper case letters by 1s
:gsub("...",function(c)   -- iterate over all groupe of 3 characters
  x=tonumber(c,2)+1       -- convert the 3-letter group from binary to decimal
  print(("><[]-+.,")      -- output the corresponding brainfuck command
             :sub(x,x))
end)

```

# Answer
> 1 votes
# C++, ~~173~~ 167 bytes

Full program, golfed (reads from standard input):

```
#include <cstdio>
main(){for(char*a="@[`{>-[.<+],",c,o=0,t=1;(c=getchar())>0;)if(c=c>*a&&c<a[1]?2:c>a[2]&&c<a[3]?1:0){o|=c>1?t:0;t*=2;if(t>4)putchar(a[o+4]),o=0,t=1;}}

```

Somewhat ungolfed:

```
#include <cstdio>
main(){
    for(char*a="@[`{>-[.<+],",c,o=0,t=1;(c=getchar())>0;)
        if(c=c>*a&&c<a[1]?2:c>a[2]&&c<a[3]?1:0){
            o|=c>1?t:0;
            t*=2;
            if(t>4)putchar(a[o+4]),o=0,t=1;
        }
}

```

Note that `@A` ... `Z[` in ASCII, and likewise for ``a` ... `z}`.

# Answer
> 1 votes
# Python 2, 112 bytes

```
''.join('><[]-+.,'[int('%d'*3%tuple(map(str.isupper,y)),2)]for y in zip(*[iter(filter(str.isalpha,input()))]*3))

```

Will try to golf it more.

# Answer
> 1 votes
# Mathematica, 192 bytes

```
StringJoin[FromDigits[#,2]&/@Partition[ToCharacterCode@#-48,3]&[StringDelete[#,a_/;!LetterQ[a]]~StringReplace~{_?UpperCaseQ->"1",_?LowerCaseQ->"0"}]/.Thread[0~Range~7->Characters@"><[]-+.,"]]&

```

Anonymous function that takes the desired string as an argument. Steps in the (pretty straightforward) algorithm:

1. Clean the string
2. Replace UC-\>"1", lc-\>"0"
3. Turn the string into a binary list
4. Partition the list into threes and interpret each chunk as a base-2 number
5. Replace the numbers with their appropriate symbols and join back into a string.

# Answer
> 1 votes
# Perl 6, 81 bytes

This can probably be done better, but this is my go at it

```
{m:g/:i<[a..z]>/;[~] ("><[]-+.,".comb[:2[$_]]for (+(91>$_.ord)for |$/).rotor(3))}

```

**Usage**

```
> my &f = {m:g/:i<[a..z]>/;[~] ("><[]-+.,".comb[:2[$_]]for (+(91>$_.ord)for |$/).rotor(3))}
-> ;; $_? is raw { #`(Block|149805328) ... }
> f("PROgRamreVERsESgiVeNiNPutsEqUENcE")
,[>,]<[.<]+

```

**Ungolfed**

```
sub oOo ($_) {
    m:g/:i<[a..z]>/;  # Match all letters and put them in $/

    my @digits = (
        for |$/ -> $c {           # For all $c in $/
            +(91>$c.ord)          # 1 if $c.ord < 91 else 0
        }
    );
    @digits.=rotor(3);            # Split the digits into chunks of 3

    my @chars = (
        for @digits -> @l {
            "><[]-+.,".comb[:2[@l]] # Take the character from "><[]-+.,"
                                    # at an index given by converting
                                    # @l (a list of 3 binary digits)
                                    # from base 2 to base 10
        }
    );
    @chars.join # Join the list of chars into a string and return
}

```

# Answer
> 1 votes
# Japt v2.0a0 `-P`, 27 bytes

```
r\L ò3 l3 Ëmè\A Íg"><[]-+.,

```

Saved 3 bytes thanks to @Shaggy

Try it

# Answer
> 0 votes
## Pyke, 31 bytes, noncompetitive

Pyke is older than the challenge, but I added some features to make it more competitive - chunk function. I used the same trick as @Martin Büttner used.

```
#~l{)\`Lm<0+3cFb2"><[]-+.,"@)st

```

Try it here!

# Answer
> 0 votes
# TI-BASIC, ~~311~~ 288 bytes

What, no TI-BASIC answers? Time for me to fix that!

```
Ans→Str1:" →Str2:" →Str6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ→Str4:For(S,1,length(Str1:sub(Str1,S,1:If inString(Str4+"abcdefghijklmnopqrstuvwxyz",Ans:Str2+Ans→Str2:End:sub(Str2,2,length(Str2)-1→Str2:For(B,1,.1+3⁻¹length(Str2:sub(Str2,3B-2,3→Str3:1+sum({4,2,1}seq(0≠inString(Str4,sub(Str3,X,1)),X,1,3→L₁(B:End:For(C,1,.1+dim(L₁:Str6+sub("><[]-+.,",L₁(C),1→Str6:End:sub(Str6,2,length(Str6)-1→Str6

```

Input is the **oOo** code in `Ans`.
Output is the translated **BF** code.

**Examples:**

```
"AbcDef
AbcDef
prgmCDGF18
--
"PROgRam reVERsES giVeN iNPut sEqUENcE
PROgRam reVERsES giVeN iNPut sEqUENcE
prgmCDGF18
.[>,]<[.<]+
"AbcDe
AbcDe
prgmCDGF18
-

```

**Un-golfed:**
(Newlines and comments added)

```
Ans→Str1                                                   ;store the input in "Str1"
" →Str2                                                    ;set "Str2" and "Str6" to a
" →Str6                                                    ; space character
                                                           ; (needed b/c TI-BASIC doesn't
                                                           ;  like concatenating empty
                                                           ;  strings)

"ABCDEFGHIJKLMNOPQRSTUVWXYZ→Str4                           ;store the uppercase alphabet
                                                           ; in "Str4"
For(S,1,length(Str1                                        ;loop over the input string
sub(Str1,S,1                                               ;get the current character
If inString(Str4+"abcdefghijklmnopqrstuvwxyz",Ans          ;if the character is in either
                                                           ; the uppercase or lowercase
                                                           ; alphabet
Str2+Ans→Str2                                              ;add it to "Str2", the code
                                                           ; string
End
sub(Str2,2,length(Str2)-1→Str2                             ;remove the space added earlier
For(B,1,.1+3⁻¹length(Str2                                  ;loop over each 3-char substring
                                                           ; and skip any extra chars
                                                           ; (.1 is added to force one
                                                           ;  loop)
sub(Str2,3B-2,3→Str3                                       ;store said substring in "Ans"
1+sum({4,2,1}seq(0≠inString(Str4,sub(Str3,X,1)),X,1,3→L₁(B ;convert to the respective
                                                           ; index in "><[]-+.,"
                                                           ; (1-indexed)
End
For(C,1,.1+dim(L₁                                          ;loop over each index
                                                           ; (.1 is added to force one
                                                           ;  loop)
Str6+sub("><[]-+.,",L₁(C),1→Str6                           ;add the char to the translation
                                                           ; string
End
sub(Str6,2,length(Str6)-1→Str6                             ;remove the added space and
                                                           ; store the result in "Str6"
                                                           ; and "Ans"
                                                           ;implicit print of "Ans"

```

---

**Notes:**

* TI-BASIC is a tokenized language. Character count does ***not*** equal byte count.

# Answer
> 0 votes
# JavaScript, 148 bytes

```
function a(s){function b(c){return c.charCodeAt()&32}return (l=(s=s.replace(/[^a-z]/gi)).substr(3))?",.+-][<>"[b(s[0])*4+b(s[1])*2+b(s[2])]+a(l):""}

```

# Answer
> 0 votes
# Thunno 2 `J`, 21 bytes

```
Ị³fæl3=;2ȷḋkŻ8ṗ«@ṅisi

```

Attempt This Online!

Port of emirps's Vyxal answer.

#### Explanation

```
Ị³fæl3=;2ȷḋkŻ8ṗ«@ṅisi  # Implicit input
Ị                      # Remove non-alphabets
 ³                     # Split into groups of length 3
  f                    # Case of each character in each group
   æ   ;               # Filtered by:
    l                  #  Length
     3=                #  Equals 3
         ȷ             # To each:
        2 ḋ            #  Convert from binary
           kŻ          # Push "[]<>-+.,"
             8ṗ        # All permutations
               «@ṅ     # Compressed integer 16560
                  i    # Index into permutations
                   si  # Index into the above
                       # Implicit output of joined list

```

---
Tags: code-golf, parsing, interpreter, brainfuck
---


# Question
Title: Without using numbers, get the highest salary you can. But don't exaggerate!
As I'm applying for some jobs whose job advert doesn't state the salary, I imagined a particularly evil interviewer that would give the candidate the possibility to decide their own salary ...by "golfing" it!

So it goes simply like that:

> Without using numbers, write a code that outputs the annual salary you'd like to be offered.

However, being able to write concise code is a cornerstone of this company. So they have implemented a very tight seniority ladder where

> employers that write code that is *b* bytes long can earn a maximum of ($1'000'000) · *b*−0.75.

we are looking at (these are the integer parts, just for display reasons):

```
   1 byte  → $1'000'000       15 bytes → $131'199
   2 bytes →   $594'603       20 bytes → $105'737
   3 bytes →   $438'691       30 bytes →  $78'011
   4 bytes →   $353'553       40 bytes →  $62'871
  10 bytes →   $177'827       50 bytes →  $53'182

```

### The challenge

Write a program or function that takes no input and outputs a text containing a dollar sign (`$`, U+0024) and a decimal representation of a number (integer or real).

* Your code cannot contain the characters `0123456789`.

In the output:

* There may optionally be a single space between the dollar sign and the number.
* Trailing and leading white spaces and new lines are acceptable, but any other output is forbidden.
* The number must be expressed as a decimal number using only the characters `0123456789.`. This excludes the use of scientific notation.
* Any number of decimal places are allowed.

**An entry is valid if** the value it outputs is not greater than ($1'000'000) · *b*−0.75, where *b* is the byte length of the source code.

### Example output (the quotes should not be output)

```
"$ 428000"            good if code is not longer than 3 bytes
"$321023.32"          good if code is not longer than 4 bytes
"  $ 22155.0"         good if code is not longer than 160 bytes
"$ 92367.15 \n"       good if code is not longer than 23 bytes
"300000 $"            bad
" lorem $ 550612.89"  bad
"£109824"             bad
"$ -273256.21"        bad
"$2.448E5"            bad

```

### The score

The value you output is your score! (Highest salary wins, of course.)

---

## Leaderboard

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```
# Language Name, $X (Y bytes)

```

where `X` is your salary and `Y` is the size of your submission. (The `Y bytes` can be anywhere in your answer.) If you improve your score, you *can* keep old scores in the headline, by striking them through. For instance:

```
# Ruby, <s>$111111.111... (18 bytes)</s> <s>$111999 (17 bytes)</s> $123456 (16 bytes)

```

You can also make the language name a link, which will then show up in the leaderboard snippet:

```
# [><>](http://esolangs.org/wiki/Fish), $126,126 (13 bytes)

```

```
var QUESTION_ID=171168,OVERRIDE_USER=77736;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body.replace(/<(s|strike)>.*?<\/\1>/g,"");s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a1=r.match(SCORE_REG),a2=r.match(LANG_REG),a3=r.match(BYTES_REG);a1&&a2&&e.push({user:getAuthorName(s),size:a3?+a3[1]:0,score:+a1[1].replace(/[^\d.]/g,""),lang:a2[1],rawlang:(/<a/.test(a2[1])?jQuery(a2[1]).text():a2[1]).toLowerCase(),link:s.share_link})}),e.sort(function(e,s){var r=e.score,a=s.score;return a-r});var s={},r=1,a=null,n=1;e.forEach(function(e){e.score!=a&&(n=r),a=e.score,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.lang).replace("{{SCORE}}","$"+e.score.toFixed(2)).replace("{{SIZE}}",e.size||"?").replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);s[e.rawlang]=s[e.rawlang]||e});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){var r=e.rawlang,a=s.rawlang;return r>a?1:r<a?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SCORE}}","$"+o.score.toFixed(2)).replace("{{SIZE}}",o.size||"?").replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var LANG_REG=/<h\d>\s*((?:[^\n,](?!\s*\(?\d+\s*bytes))*[^\s,:-])/,BYTES_REG=/(\d+)\s*(?:<a[^>]+>|<\/a>)?\s*bytes/i,SCORE_REG=/\$\s*([\d',]+\.?\d*)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
```

```
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:520px;float:left}table thead{font-weight:700}table td{padding:5px}
```

```
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b"> <div id="answer-list"> <h2>Leaderboard</h2> <table class="answer-list"> <thead> <tr><td></td><td>Author</td><td>Language</td><td>Score</td><td>Size</td></tr></thead> <tbody id="answers"> </tbody> </table> </div><div id="language-list"> <h2>Winners by Language</h2> <table class="language-list"> <thead> <tr><td>Language</td><td>User</td><td>Score</td><td>Size</td></tr></thead> <tbody id="languages"> </tbody> </table> </div><table style="display: none"> <tbody id="answer-template"> <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SCORE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table> <table style="display: none"> <tbody id="language-template"> <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SCORE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>
```

---

Edit: (rounded) maximum allowed score per byte count, for a quicker reference - text here:

# Answer
# bash, $127127

```
x;echo \$$?$?

```

Try it online!

Since the `x` command doesn't exist, it errors and sets the exit code to `127`.

Then, the code outputs a dollar sign followed by `$?` twice. The `$?` variable stores the exit code of the previous command, so this outputs `$127127` in **13 bytes**.
> 122 votes

# Answer
# Java 8, $131,199.00 (15 bytes)

```
v->"$"+'e'*'ԓ'

```

Try it online.

**Explanation:**

```
v->            // Method with empty unused parameter and String return-type
  "$"+         //  Return a dollar sign, concatted with:
      'e'*'ԓ'  //  131199 (101 * 1299)

```

\\$131,199.00 \< 131,199.31\\$

I used a program to generate a printable ASCII character in the range `[32, 126]` which, when dividing `131199`, would have the lowest amount of decimal values. Since `101` can divide `131199` evenly, resulting in `1299`, I'm only 31 cents short of my maximum possible salary based on my byte-count of 15.
> 75 votes

# Answer
# CJam, (5 bytes) $294204.018...

```
'$PB#

```

Try it online!

Explanation:

I derived it from Dennis' answer, but looked for combinations of numbers which would yield a higher result. I almost gave up, but I saw that `P` is the variable for \\$\pi\\$, and that \\$\pi^{11} \approx 294000\\$. The letter `B` has a value of 11 in CJam, giving the code above.
> 52 votes

# Answer
# CJam, 5 bytes, $262'144

```
'$YI#

```

Try it online!

### How it works

```
'$     Push '$'.
  Y    Push 2.
   I   Push 18.
    #  Pop 2 and 18 and perform exponentiation, pushing 262144.

```
> 48 votes

# Answer
# , 20 bytes, `$103540.9`

```
T=pi+pi;cat("$",T^T)

```

Try it online!

The max for 20 bytes is `$105737.1`, so this is quite close to the salary cap!

This would be a nice raise, and if I get paid to do code golf......
> 42 votes

# Answer
# GS2, (5 bytes) $292,929

```
•$☺↔A

```

A full program (shown here using code-page 437). (Maximum achievable salary @ 5 bytes is $299069.75)

**Try it online!**

Builds upon Dennis's GS2 answer...

```
•$☺↔A                             []
•$    - push '$'                  ['$']
  ☺   - push unsigned byte:
   ↔  -   0x1d = 29               ['$',29]
    A - push top of stack twice   ['$',29,29,29]
      - implicit print            $292929

```
> 35 votes

# Answer
# Self-modifying Brainfuck, 16 bytes, $124444

```
<.<++.+.++..../$

```

Try it online!
> 30 votes

# Answer
# , 21 bytes $99649.9

```
cat("$",min(lynx^pi))

```

Try it online!

A different `R` approach - see also Giuseppe's answer

Very close to the maximum of $101937 for this bytecount.

## Bonus: `object.size()`

### , 24 bytes $89096

```
cat("$",object.size(ls))

```

Try it online!

This is probably system-dependent, but when I ra this on TIO I got $89096 - close to the limit of 92223 for 24 bytes.
> 29 votes

# Answer
# JavaScript (ES6), 19 bytes, $109,839

```
_=>atob`JDEwOTgzOQ`

```

Try it online!

\\$109839\\$ is the highest integer \\$\le 109884\\$ which does not produce any digit when prefixed with **'$'** and encoded in base64.

---

# Without `atob()` (Node.js), 26 bytes, $86,126

```
_=>'$'+Buffer('V~').join``

```

Try it online!

The concatenation of **'$'** with the ASCII codes of **'V'** (86) and **'~'** (126).
> 28 votes

# Answer
# PHP, $131116 (8 bytes)

Didn't see one for php and wanted to throw one up. I know someplace in php is a bad typecast that would cut this in half but I can't find it right now.

```
$<?=ERA;

```

This just takes advantage of PHP short tags and the PHP built in constants.

**Try it online!**
> 22 votes

# Answer
# GS2, 5 bytes, $291'000

```
•$☺↔∟

```

This is a CP437 representation of the binary source code.

Try it online!

### How it works

```
•$     Push '$'.
  ☺↔   Push 29.
    ∟  Push 1000.

```
> 18 votes

# Answer
## Excel 19 bytes $107899.616068361

```
="$"&CODE("(")^PI()

```

**Explanation:**

```
     CODE("(")        // find ASCII code of ( which is 40
              ^PI()   // raise to power of Pi  (40^3.141592654)
 "$"&                 // append $ to the front of it
=                     // set it to the cell value and display

```
> 18 votes

# Answer
# Jelly,  ~~$256000 $256256~~  (6 bytes) $257256

```
⁹‘”$;;

```

A full program. (Maximum achievable salary @ 6 bytes is $260847.43)

**Try it online!**

### How?

```
⁹‘”$;; - Main Link: no arguments
⁹      - Literal 256                            256
 ‘     - increment                              257
  ”$   - single '$' character                   '$'
    ;  - concatenate                            ['$',257]
     ; - concatenate                            ['$',257,256]
       - implicit print                      -> $257256

```

---

Previous...

5 bytes $256256

```
”$;⁹⁺

```

('$' concatenate 256, repeat 256 - causing interim implicit printing)

6 bytes $256000:

```
⁹×ȷṭ”$

```

(256 × 1000 ṭack '$')
> 14 votes

# Answer
## vim, ~~$99999~~ ~~$110000~~ $120000

```
i$=&pvh*&ur

```

Try it online!

Uses the expression register (note that there is a \<C-r\> character, which is invisible in most fonts, between the `$` and `=`, for a total of **13 bytes**) to insert the value of the `'pvh'` option times the value of the `'ur'` option.

`'previewheight'` is the option that controls the height of preview windows, which is 12 by default.

`'undoreload'` is the maximum number of lines a buffer can have before vim gives up on storing it in memory for undo, and it defaults to 10,000.
> 14 votes

# Answer
# C#

## Full program, ~~72 bytes, $40448~~ 66 bytes, $43008

```
class P{static void Main()=>System.Console.Write("$"+('T'<<'i'));}

```

Try it online!

### Explanation

Left-shift operator treats chars `'T'` and `'i'` as integers 84 and 105 respectively and performs shift

## Lambda, ~~19 bytes, $109568~~ 17 bytes, $118784

```
o=>"$"+('t'<<'j')

```

Try it online!

**Edit** Thanks to @LegionMammal978 and @Kevin for saving 2 bytes
> 11 votes

# Answer
# PHP, 13 Bytes, $144000 Salary

Unfortunately for this job, moving to Mauritius is required (well, I could move slightly less far eastward, however every timezone less would yield at $36k drop in salary.) To compensate for the inconvenience, my salary increases by $1 every leap year.

```
$<?=date(ZL);

```

This just puts out `Z` the timezone in seconds and appends whether or not it's a leap year.
> 11 votes

# Answer
# brainfuck, 43 bytes, $58888

```
++++++[>++++++<-]>.<++++[>++++<-]>+.+++....

```

Try it online!

### How it works

```
++++++[>++++++<-]>.  write 36 to cell one and print (36 is ASCII for $)

<++++[>++++<-]>+.    add 17 to cell 1 and print (cell 1 is now 53, ASCII for 5)

+++....              add 3 to cell 1 and print 4 times (cell 1 is now 56, ASCII for 8)

```
> 11 votes

# Answer
# Python 3, (22 bytes) $ 98,442

```
print('$',ord(''))

```

**Try it online!**

Much like Doorknob's Ruby answer, the 4 byte Unicode character used here, , has an ordinal value of the maximal integer salary achievable in 22 bytes.

Note that `print()` prints its unnamed arguments separated by spaces by default (`sep` is an optional named argument).
> 10 votes

# Answer
# Gol\>\<\>, $207680 in 8 bytes

```
'o**n; $

```

Try it online!

### How it works:

```
'        Start string interpretation. Pushes the ASCII value of every character until it wraps back around to this character
 o       Output the top stack value as ASCII. This is the $ at the end of the code
  **     Multiply the top 3 stack values (This is the ASCII of 'n; ', 110*59*32
    n    Output top of stack as integer.
     ;   Terminate program
       $ (Not run, used for printing the $)

```

Interestingly enough, you can use `h` instead of `n;`, which yields `'o**h5$` with a score of $231504, but you can't use 0-9, and there isn't another 1-byte way to push 53, the ASCII value of `5`
> 9 votes

# Answer
# 05AB1E (5 bytes), $262626

```
'$₂ÐJ

```

Try it online!

\\$262626 \< 299069\\$. Pushes the character `$` to the stack, then pushes the integer \\$26\\$. From here, the program triplicates the integer, leaving the stack as `["$", 26, 26, 26]` and joins (`J`) the stack.
> 8 votes

# Answer
# Mathematica, 18 bytes, $107,163.49

```
$~Print~N[E^(E!E)]

```

Full program; run using `MathematicaScipt -script`. Outputs `$107163.4882807548` followed by a trailing newline. I have verified that this is the highest-scoring solution of the form `$~Print~N[*expr*]` where `*expr*` is comprised of `Pi`, `E`, `I`, and `+-* /()!`.
> 8 votes

# Answer
# JavaScript (Node.js), 23 bytes, $65535

```
_=>"$"+ +(~~[]+`xFFFF`)

```

Try it online!

This is the best I can get without `atob`, though there is a large improvement space tbh

You know, having no short character to ascii conversion function sucks A LOT.

***AFTER A WHOLE DAY***

# JavaScript (Node.js), 30 bytes, $78011

```
_=>"$"+``.codePointAt(![])

```

Try it online!

## or: 29 bytes, $80020

```
_=>"$"+``.codePointAt(!_)

```

Where  is `U+13894 INVALID CHARACTER`

Oh `String.codePointAt`! I've just completely forgotten this!

## A joke one (15B, $130000), not vaild at all but just for fun

```
_=>"$十三萬"

```
> 8 votes

# Answer
# Jelly, 8 bytes, $210176.48625619375

```
⁽½"×½”$,

```

3535 (`⁽½"`) multipli(`×`)ed by its sqrt (`½`).

Try it online!
> 6 votes

# Answer
## Ruby, $119443

```
$><<?$<<?.ord

```

Try it online!

The maximum integer output for 17 bytes. The Unicode character is U+1D293, which is 119443 in hex.
> 6 votes

# Answer
# brainfuck, 34 bytes, $69999

```
+[->-[---<]>-]>.[-->+++<]>.+++....

```

Try it online!

### Explanation:

```
+[->-[---<]>-]>.   Generate and print 36 ($)
[-->+++<]>         Divide by 2 and multiply by 3 to get 54 (6)
          .        Print 6
           +++.... Print 9999

```
> 6 votes

# Answer
# Perl 5.26.2, 12 bytes, $146002

```
say$]^"\x11\x0e\x01\x06"
```

Hex escapes only shown because ASCII control chars are filtered out.

Try it online!

You can get a bit more with different Perl versions, for example $155012 with 5.25.12.
> 6 votes

# Answer
## MATLAB, 17 bytes, $112222

```
['$','..////'+pi]

```

Old answer:

```
['$','RRUUTR'-'!']

```
> 6 votes

# Answer
# MathGolf, $353535 (4 bytes)

```
'$W∙

```

Try it online!

## Explanation

```
'$    Push "$"
  W   Push 35
   ∙  Triplicate top of stack

```

## Disclaimer

This language was created after the posting of this question. While the language is a general language, it is designed with numerical questions in mind. It contains a lot of 1-byte number literals, and other nifty things for number-related questions. It is still a work in progress.
> 6 votes

# Answer
# dc, $169169 10 bytes

```
Dd*d[$]nnn

```

Try it online!

This prints 13 (`D`) squared, twice
> 5 votes

# Answer
# Japt, 5 bytes, $262144

```
'$+I³

```

Test it

---

Explanation `I` is the Japt constant for `64`, `³` cubes it and then `'$+` concatenates that with the dollar symbol.
> 5 votes

# Answer
# Befunge-93, 9 bytes, $192448

```
a>$",**.@

```

Try it online!

Outputs `$192448`, just two dollars and nine cents short of the maximum. This even works as a polyglot with proper implementations of Befunge-98, where it doesn't even have to throw up an unrecognised instruction error!

### Explanation:

```
a>$        Basically no-ops
   "       Wrapping string that pushes the code and a lot of spaces to the stack
    ,      Print the $
     **    Multiply the byte values of a, > and a space
           62*97*32 = 192448
       .@  Print the number and terminate

```
> 5 votes

# Answer
# Befunge-98 (PyFunge), 8 bytes, $209728

```
$",**.q:

```

Try it online!

The character `:` has been computed using the following method:

```
>>> chr(int((1_000_000 * 8 ** -0.75) / (ord(' ') * ord('q'))))
':'

```

Using `@` and `f` also works but gives only $208896.
> 5 votes

# Answer
# PowerShell 5.1, ~~$77126~~ ~~$85184~~ ~~$101101~~ $105105, ~~25~~ ~~21~~ 20 Bytes

```
"$"+($x=+'i'[""])+$x

```

or

```
+'i'['']|%{"$ $_$_"}

```

or

```
$x=+'i'[''];"`$$x$x"

```

+10k thanks to AdmBorkBork
+16k thanks to Mazzy
+4k thanks to Mazzy again
+2 solutions thanks to Mazzy, the absolute Maddest Lad

With a little help, we hit the 100k mark. We have "i" index into itself to do some cheeky casting and then concats that to itself.
> 5 votes

# Answer
# Excel VBA - 22 Bytes, $97336

```
?"$"&Asc(".")^Asc("")

```

**How it works**

```
? - Print in immediate
 "$" - $ character
 asc(".") = 46
 Asc("") = 3
  46 ^ 3 = 97336

```
> 5 votes

# Answer
# Cubix, $155088 (12 bytes)

```
*Ouo'ე'$/@

```

Try it online!

An interesting problem, was hoping to get this down to 7 or 8 bytes, but it proved difficult. Pushes the ე and $ characters to the stack, outputs the `$`, multiples top of stack, outputs the number and halts. Still hoping to find a lower byte option
> 5 votes

# Answer
# Hexagony, 12 bytes, $122122

```
D{y@!!<'*;z/

```

Try it online!
> 4 votes

# Answer
# Jelly, 5 bytes, $256'256

```
”$¹⁹⁹

```

Try it online!

### How it works

```
”$¹⁹⁹  Main link. No arguments.

”$     Set the left argument and the return value to '$'.
  ¹    Apply the identity function. This allows implicit printing.
   ⁹   Set the return value to 256.
       Since this discards the previous return value ('$'), it is printed implicitly.
    ⁹  Set the return value to 256.
       Since this discards the previous return value (256), it is printed implicitly.
       (implicit) Print the last return value (256).

```
> 4 votes

# Answer
# Perl 6, ~~11 bytes, $165,000~~ ~~10 bytes, $177,147~~ 12 bytes, $150,000

~~'$'~㉝\*ↁ~~

~~'$'~۳¹¹~~

{'$'~۳\*ↇ}

Try it online!

~~The Unicode characters ㉝ (CIRCLED NUMBER THIRTY THREE) and ↁ (ROMAN NUMERAL FIVE THOUSAND) conveniently evaluate to their Unicode values in numeric expressions.~~

~~`۳` is the Unicode character EXTENDED ARABIC-INDIC DIGIT THREE, which conveniently evaluates to its Unicode value of 3 in numeric expressions. That 3 is raised to the eleventh power by following it with two superscript ones.~~
> 4 votes

# Answer
# T-SQL, ~~$65,025~~ $72,614 (33 bytes)

```
PRINT CONCAT('$',CHECKSUM('
ßÝ'))                                       --  $72614,   33 bytes

```

Just in case that doesn't display or copy correctly, the string is `CHAR(10) + CHAR(223) + CHAR(221)`, so does not contain any multi-byte characters.

I've verified `CHECKSUM` produces this same result in both SQL 2017 and SQL 2012; it is unlikely but possible that other versions might produce different values (since the exact `CHECKSUM` mechanism is unpublished).

To find this I had to evaluate the `CHECKSUM` of all possible 3-character strings from `CHAR(9)` (tab) to `CHAR(255)`. Good thing that's easy enough to do in SQL with a self-join from a number table.

Some of my prior attempts:

```
PRINT CONCAT('$',CHECKSUM(']èÆ'))           --  $72562,   33 bytes
PRINT CONCAT('$',SQUARE(ASCII('ÿ')))        --  $65025,   36 bytes
PRINT CONCAT('$',PI()*EXP(PI()*PI()))       --  $60738.6, 37 bytes

```

Note that any of these can alternately be written, with no loss of bytes, as:

```
PRINT FORMAT(CHECKSUM(']èÆ'),'C')           --  $72,562.00  33 bytes

```

The latter has a more nicely formatted output, but it is unclear whether the comma is allowed by the rules.
> 4 votes

# Answer
# \>\<\>, 7 bytes, $232110

```
'onnè$

```

Try it online!

Explanation (simple):

```
'onnè$
'      : Start putting chars onto the stack.
 o     : Print the stack top
  nn   : Print the stack top as numbers
    è$ : Errors the program

```
> 4 votes

# Answer
# Haskell, $99999 (15 bytes)

```
pred<$>"%:::::"

```

Try it online!
> 4 votes

# Answer
# Swift, $131072 (13 bytes)

```
"$\(MAXPHYS)"

```

In Swift Playground it prints "$131072"
> 4 votes

# Answer
# APL $130189.4947846055 (~~18~~ 15 bytes, ~~10~~ 9 characters)

Thanks to @Ross Presser for pointing out the byte length and for saving a character. Byte length determined using Python's `len` function.

```
'$',!○*≡⍬
=> $ 130189.4947846055

```

Can be run on repl or offline if you have an APL interpreter e.g. NodeJS + NGN APL.

The maximum for the length is $177827.9.

### How it works

is the empty vector and the single argument form of  obtains the depth of the argument (number of nested arrays, effectively). This can be used to obtain the number 1 in order to perform further math operations, as a vector containing only scalars (or nothing at all) has depth 1.

`!○*` are the factorial, pi times X, and e^x functions, respectively. APL operates right-to-left, so the value 1 is passed to these functions RTL and this expression computes `(pi * e)!`.

Then the dollar sign must be prepended by concatenating (`,`) the string value with the computed value.

**Note**: I did this mostly by trial and error. Often, using exponentiation after multiplication resulted in values that were way too large for the byte count. There might be a more optimal combination of operators.
> 4 votes

# Answer
# Keg, $298298 (5 Bytes)

```
\$Ī:

```

Fixed my answer now so it actually fits within the rules. `Ī` is two bytes so this is very close to the max I can get for this byte count.

# How it works

```
\$   Pushes $ to the stack, has to be escaped since $ is the swap instruction in Keg
Ī  Pushes the unicode value of this character, which is 298
:  Duplicates the top value of the stack, which is 298
End of programme prints entire stack, resulting in $298298

```
> 4 votes

# Answer
# Python (28 bytes; $15876)

```
print('$',ord('~')*ord('~'))

```

Try it online!

---

This is my first code golf answer. :)
> 4 votes

# Answer
# vemf, ~~$200,000 (7 bytes)~~ $210,000 (8 bytes)

*+1 byte but also +$10,000 thanks to Julian*

```
hhg+ª;`$

```

try it online

## Explanation

```
     ;   ' procatenate (reverse concatenate)
    ª    '   string representation of
hhg+     '     210,000 (as 100,000+100,000+10,000)
         ' and
      `  '   character literal
       $ '     dollar sign

```
> 4 votes

# Answer
# Brain-Flak, $55555

```
([(((()()()()){}){}())](((((({})({}()){}))))))

```

Try it online!

# Brain-Flak with `-r` flag, $57777

```
((((((((()()()()){}){}())(({}()){}))()()))))

```

Try it online!
> 3 votes

# Answer
# Pascal (FPC), $72089

33 bytes

```
begin write('$',$AFFFF div$A)end.

```

Try it online!

Found by playing with arithmetics and hexadecimal constants. See below for more interesting answers.

---

### Pascal (FPC), $65526

37 bytes

```
var x:word=-$A;begin write('$',x)end.

```

Try it online!

Thanks to @JonathanAllan for reminding me of initialization in declaration, it shortened my new approach.

No way Brain-Flak programmer can have bigger salary!

`$A` is hexadecimal constant 10. Variables of type `word` have values in range `0..65535`, so initializing it with -10 gives 65526 instead (and a range check warning).

---

### Pascal (FPC), $54872

47 bytes

```
begin write('$',ord('&')*ord('&')*ord('&'))end.

```

Try it online!
> 3 votes

# Answer
# Java

**program, 73 bytes, $40033 (of max 40041.67)**

```
interface G{static void main(String[]a){System.out.print("$"+'+'*'Σ');}}

```

**Explanation**

It uses the product of the ascii character `+` (43) with the greek unicode character `Σ` (931).

**Lambda, 35 bytes, $69388 (of max 69494.27)**

```
()->System.out.print("$"+'L'*'Α');

```
> 3 votes

# Answer
# \>\<\>, 8 bytes, $210196

```
'o+n+|V$

```

Try it online!

### Explanation:

```
'         Push the rest of the code to the stack
 o        Print the $
  +n      Add the top two and print as a number (210)
   n+|    Add the top three and print as a number (196)
 o+       Error as the stack runs out

```
> 3 votes

# Answer
# PHP, 18 bytes, $114431

This was actually a very quick challenge, but fun!

```
$<?=ppuurp^AAAAAA;

```

Simply writes `$114431` (excluding the warnings).

Tricks I've used:

* PHP will output anything outside it's opening and closing tag (saves 3 bytes vs `'$'.[...]`)
* The opening tag `<?=` has the same effect as `<?php echo [....];` (saves 8 bytes)
* You don't need to use quotes for "strings" that don't have spaces or start with numbers.
This makes it so PHP parses it as a constant.
Non-existing constants are converted to string (ex. `AAAAAA` is the same as `"AAAAAA"`).
(saves 4 bytes - 2 bytes per "string")
* You don't really need the closing tag, and PHP advices you to not include it if it is a page that shouldn't have output.
(Check https://stackoverflow.com/a/19953547/2729937 for more).
> 3 votes

# Answer
# Bubblegum, $260847 (6 bytes)

```
00000000: 03b3 c759 0bf8                           ...Y..

```

Try it online!
> 3 votes

# Answer
# dc, $177147 (9 bytes)

```
[$]nAvB^n

```

Try it online!

\\$\lfloor\sqrt{10}\rfloor^{11}\\$.
> 3 votes

# Answer
# Shakespeare Programming Language, $18000 (~~207~~ 205 bytes)

```
,.Ajax,.Ford,.Act I:.Scene I:.[Enter Ajax and Ford]Ajax:You be the square oftwice the sum ofa cat a big cat.Speak thy.You cat.Open heart.You be the cube oftwice twice the sum ofyou a big big cat.Open heart

```

Try it online!

This language made this challenge simultaneously easy and hard. On one hand, there already are no numbers in the source code. On the other hand, the program size can get VERY long (the shortest header is 51 bytes, meaning I'm already out $947601.07!).

Salary printed: `$18000`

Maximum salary: `$18457.99` (rounded)
> 3 votes

# Answer
# PowerShell, $1, 17 bytes

Owner's salary:

```
"$"+[bigint]::One

```

Try it online!
> 3 votes

# Answer
# LOLCODE 1.2, ~~19~~ 77 Bytes ($38100)

```
HAI 1.2
    VISIBLE "$:[DIGIT THREE]:[DIGIT EIGHT]:[DIGIT ONE]:[DIGIT ZERO]:[DIGIT ZERO]"
KTHXBYE

```

Try it online!

The header `HAI 1.2` and footer `KTHXBYE` are always required so not included in final byte count.

LOLCODE lacks a way to directly cast a char literal to a number, but you CAN give it a unicode normative name and it returns that unicode character. Changing the number name frequently changed the byte count so this was a bit tricky but this worked out fine :)

(Also had brainfart and forgot including `0123456789` wasn't allowed hence the 19 → 77. ^^;)
> 3 votes

# Answer
# GolfScript, $210210 (8 bytes)

```
"$i").+.

```

Try it online!

```
"$i"     # Push this string
    )    # Separate last char and parse it to an integer, in this case it's 105
     .+  # Add it to itself
       . # Copy top of stack

```

In the end everything in the stack is concatenated. This is only $ 14.10 under the limit.
> 3 votes

# Answer
# Hexagony, 15 bytes, $125125

```
j{F)))<'-;z/@!!

```

```
   j { F
  ) ) ) <
 ' - ; z /
  @ ! ! .
   . . .

```

I originally had an answer similar to @user202729, but I realized that I could add 3 increments ")" to z in order to make it 125 and it kept it under 16 bytes ($125000 max).

Try it online!
> 3 votes

# Answer
# gvm (commit 2612106) bytecode, 7 bytes ($232255)

```
░$áΦá └
```

program shown in cp 437 encoding. It seems I can't paste a non-breaking space correctly here :( (`ff` in cp-437, `U+00a0` in unicode) -- the space in the code should be one.

Output:

```
> ./gvm salary.bin
$232255

```

Hexdump:

```
> hexdump -C salary.bin
00000000  b0 24 a0 e8 a0 ff c0                              |.$.....|
00000007

```

Disassembled:

```
c:0100  b0 24       WCH #'$'    ; write character $
c:0102  a0 e8       WUD #$e8    ; write unsigned byte $e8 (232)
c:0104  a0 ff       WUD #$ff    ; write unsigned byte $ff (255)
c:0106  c0          HLT         ; terminate

```

---

This is a pre-alpha version of a virtual machine I'm working on -- hope this is still allowed, the commit that correctly executes this code is from yesterday :)
> 2 votes

# Answer
# Japt, 7 bytes, $232,255

```
'$+#è#ÿ

```

Try it online!
> 2 votes

# Answer
# Charcoal, 6 bytes, $252525

```
$×³Ｉ²⁵

```

Try it online! Link is to verbose version of code. Works by casting the numeric constant `25` to string and repeating it `3` times. The best Charcoal can do in 5 bytes is $222222:

```
$×⁶Ｉ²

```

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

# Answer
# LOWER, $40457

72 bytes

```
ₔₓ₃₆ₔₓ₅₂ₔₓ₄₈ₔₓ₅₂ₔₓ₅₃ₔₓ₅₅

```

Try it online!

`ₔₓ<num>` \- print a character with ASCII code `<num>`
> 2 votes

# Answer
# \>\<\>, 8 bytes ($196196)

code:

```
e|noi:*

```

input:

```
$

```

Try it online!

My first ever \>\<\> entry; \>\<\> is a weird language and it took me a while to find a way to print the `$` without using a ton of characters. If it wasn't needed, `f|n:*` would print `225225` inside the $299069 limit. Instead, stuck with 8 characters and a $210224 limit. But hey, $196196/yr. is some serious money.

# How it works

```
 e|noi:*
>          Fish starts top left, pointing right
 e         Push 14 onto the stack (stack: [14])
  |        Mirror. Fish is now moving left
 e         Push 14 onto the stack again, wrap around (stack: [14,14])
       *   Pop x and y, multiply, push result (stack: [196])
      :    Duplicate top of the stack (stack: [196,196])
     i     Read a character from input as a string ($), push to stack (stack: ['$',196,196])
    o      Pop and print it as a character (output `$`, stack: [196,196])
   n       Pop and print as a number (output `$196`, stack: [196])
  |        Mirror. Fish is now moving right
   n       Pop and print as a number (output `$196196` stack: [])
    o      Pop, stack is empty: error; program terminates

```
> 2 votes

# Answer
# Pepe, $74088 (30 bytes)

```
reeeEeeEeerEeeEeEeEerEeeEereEE

```

Try it online!

**Explanation**

```
reeeEeeEee                     # print $
          rEeeEeEeEe           # push 42 in stack r
                    rEeeEe     # cube of 42 (74088)
                          reEE # output number

```
> 2 votes

# Answer
# Actually, 8 bytes, $196418

```
'←┘F$'$+

```

Explanation:

```
'←┘F$'$+
'←        push the string "←"
  ┘       CP437 ordinal (27)
   F      27th Fibonacci number (F(27) = 196418)
    $     convert to string
     '$+  prepend a dollar sign

```

Try it online!
> 2 votes

# Answer
# Befunge-93, ~~$154836~~ ~~$164220~~ $165554, ~~12~~ 11 bytes

```
".;=$",**.@

```

Try it online!

I calculated the Number using the ASCII Values of the letters

```
46 * 59 * 61 = 165554

```

Thanks to Jo King for golfing 1 byte and raising my salary by ~~$9384~~ $10718.
> 2 votes

# Answer
# Excel: 23 bytes, $93648.047476083

```
="$"&PI()^(ARABIC("X"))

```

Max is $95214.73 (2 bytes can be saved, but no salary improvement by removing parentheses around the ARABIC function)

## Excel: 15 bytes, $131196.0508, Max $131,199 (Cheat)

```
="$"&NOW()*PI()

```

For certain values of now() :-) (Set system date to 5/2/2014)
> 2 votes

# Answer
# K (oK), $130,331.00 of a maximum of $131,199.00 (15 bytes)

```
"$",$*/`i$"//;"

```

Try it online!

Output contains quotation marks because that's how strings are represented in K.

### How:

```
"$",$*/`i$"//;" # Anonymous function, no arguments.
          "//;" # The string '//;'
       `i$      # coerce into integers (uses the ascii values of '//;', which are 47 47 59)
     */         # product of the list (47² × 59 = 130.331)
    $           # convert into a string
   ,            # and prepend
"$"             # a dollar sign

```
> 2 votes

# Answer
# Python 2 (Cython), $101106 $101937 $105737 (21 20 bytes)

Another Unicode character solution. This is the closest *printable* character I could find to the 21-byte maximum amount. Don't think Python can get any higher than this...

```
print"$",ord("")

```

Outputs:

```
$ 105737

```

## How it works

"" is 4-byte char U+18AF2 "TANGUT COMPONENT-755". 0x18af2 = 101106 in decimal.

Edit: Thanks to Dennis for pointing out that there's a usable character with a higher value and earning more money!

"" is 4-byte char U+18E31. 0x18e31 = 101937 in decimal.

Edit: Thanks to ovs for pointing out that the u prefix isn't necessary in Cython! An extra byte is gained: TIO

"" U+19D09. 0x19d09 = 105737.

NOTE: this works in TIO but fails in Python console with `TypeError: ord() expected a character, but string of length 4 found`
> 2 votes

# Answer
# ShinyLisp, 8 bytes, $204864

```
S"$"DpEv

```

Ungolfed:

```
(strings "$" drop even)

```

`drop` is a function which discards the first few elements of a list. When used as a number, it's equal to 2048. `even` checks whether a number is even, but when used as a number, it's equal to 64. `strings` concatenates strings, so the two functions get cast to numbers which then get cast to strings.
> 2 votes

# Answer
## MATLAB, 22 bytes, $99649.9031

```
['$',num2str(''''^pi)]

$99649.9031

```

Just bad luck the character `'` is part of the syntax so to escape it I needed to repeat it.

This solution and all the other below are interchangeable with the `sprintf` function. Ex `sprintf('$%f',''''^pi)` will return the same output.

---

## Older solutions:

**23 bytes, $80662.6659**

```
['$',num2str(pi^pi^pi)]

$80662.6659

```

---

**24 bytes, $74704.2869**

```
['$',num2str(now/pi/pi)]

$74704.287

```

Explanation: the `now` function return a serial date code (today 29-August-2018 =\> 737301). Just needed to divide that a bit to make the salary fit the cap.

Nice thing about it, if you run it tomorrow you'll get a bit more (pennies only though...)
> 2 votes

# Answer
# C, $80010 (29 bytes)

```
o(){printf("$%d",'\aq'*'*');}

```

Try it online!

I did a brute-force search on all expressions `x * y`, where `x` is a 2-character literal and `y` is a `char`. The desired result has a rather uncomfortable value, which requires one of the chars to be escaped: `\a` (which is equal to 7).

For a 29-byte program, the maximum that may be displayed is 80020.

---

Fun fact: my search program printed all solutions literally at first. Imagine what it did when it output all these `\a` characters...
> 2 votes

# Answer
# brainfuck, 30 bytes, $77'777

```
-[[<->->+>++++<<]>-]>.<<<.....

```

BF-Crunch did most of the work for me.

Try it online!
> 2 votes

# Answer
# Stax, 6 bytes ($256256)

```
¥r○s╙$

```

Run and debug it

Unpacked version:

```
VB$c'$L Full program
VB$     Push "256"
   c    Copy
    '$  Push "$"
      L Listify stack, producing ["$", "256", "256"]
        Implicit flatten and output

```
> 2 votes

# Answer
# Braingolf, 8 bytes, $209,764

```
#$@#å+*

```

Output:

```
$209764

```

209764 \< 1e6 * 8-0.75

Try it online!
> 2 votes

# Answer
# K (oK), 13 bytes, $145794

Try it online!

```
"$",$*/"B//"

```

Run multiplication over the characters B//, it will convert them to their integer counterparts and give the result of B\*/\*/ (145794), String the result ($) and join (,) it to "$"
> 2 votes

# Answer
# Gol\>\<\>, $232104 (7 bytes)

```
$'onhè

```

Well, I don't think this can get much smaller or higher in price! (and I know that the last char is a 2 byte char, I included it in the byte count)

There is a program that outputs a higher price, but it uses an error, in \>\<\>, here is a link, which also works in Gol\>\<\> too!

**5th version, $210104 (8 bytes)**

```
$'ofe*nh

```

Only 120.1$ off from being the max score, whew!

**4th version, $182182 in 9 bytes**

```
$'oed*:nh

```

**3rd version, $168168 in 11 bytes**

```
'$'oce*:nn;

```

**2nd version, $150150 in 12 bytes**

```
'%'Moaf*:nn;

```

Literally 2 minutes after I made the previous one, I figured out how to golf it more.

**1st version, $121121, 14 bytes**

```
d:+a+ob:*:n:n;

```

|

|

|

Yep, that's it.

This can probably be golfed better with more money.
> 2 votes

# Answer
# Zsh, $127569, 15 bytes

```
];<<<\$$?${-%?}

```

Try it online!

Squeezing out a bit more than the Bash answer by abusing the default flags. By default, the `$-` parameter is set to `569X`. `${ %?}` removes the last character. We can actually get a lot further by manually controlling the flags:

## `zsh -178`, $156789, 11 bytes

```
<<<\$${-%?}

```

Try it online!

---

If the exponent was slightly more favorable (`-0.74` instead of `-0.75`), I could get quite the bonus: `zsh +X5 -2378 '<<<\$$-'` (7 bytes and $236789). Maybe management could be convinced next year...
> 2 votes

# Answer
# C# ~~29~~ ~~20~~ 19 Bytes

~~Assuming it's allowed to omit the otherwise required `Main()` entry point and assuming `using System;`...~~

Swapped to the interactive C# compiler and have saved now 10 bytes - 8 from removing `Console` and another by using an ascii character instead. And since it's the only line a semicolon isn't necessary. Not a bad salary :P

```
Write("$"+'Ϩ'*'m');

```

Output: `$109000`

Try it online!
> 2 votes

# Answer
# Hexagony, $220220, 7 bytes

```
Ü~;]!@

```

Try it online!

This is my first Hexagony answer using `[]`. This instruction switches between pointers and I've never really needed them before. Formatted, this is a size 2 hexagon.

```
 Ü ~
; ] !
 @ .

```

The `Ü` character has ordinal value `220`, and we then negate that and output. `(-220)%256 = 36`, the ordinal value of `$`. Next we need to negate it back to 220, print twice and exit. However, if we implement this naively (just `~!!@`), then that totals up to 8 bytes, which brings us over the $210224 limit. Instead we switch to the next pointer, which starts at the top right moving southeast. This executes the `~!`, before wrapping round to the center, which pushes the value of `Ü` again, before switching again. Now we're on the right corner going southwest, printing again before wrapping around to the the center, negating and switching. Finally, we're in the bottom right moving west, which takes us to the `@` to terminate.

To help visualise this, you can use the excellent Hexagony IDE at hexagony.net
> 2 votes

# Answer
# Nibbles, $300000 (4.5 bytes)

```
"$"++;*;$

```

Attempt This Online!

```
"$"++;*;$
"$"       "$"
   +      Add
    +      add
     ;      x :=
      *      multiply
       ;$     1000
              100
            x
           x

```

This assumes that we don't have to round up fractional byte counts. Another solution which works without this assumption:

## Nibbles, $256256 (5.5 bytes)

```
"$"*+;$~ch~

```

Attempt This Online!

```
"$"*+;$~ch~
"$"         "$"
   *        Multiply
    +  ~     add 1
     ;$       1000
        ch~  256

```
> 2 votes

# Answer
# Vyxal, ~~$177827 (10 bytes) $192450 (9 bytes)~~ $210224 (8 bytes)

*Thanks to Kevin Cruijssen for -1 byte and me for -1 byte*

```
\$»∧<i»J

```

Run it

Explanation:

```
\$       # Push a dollar sign
  »∧<i»  # Push salary (base-255-compressed)
       J # Concatenate
         # Implicit print

```
> 2 votes

# Answer
# Aheui (esotope), 24 bytes, $91300

```
븖븜뜨쁘멓희다멍

```

Try it online!

Turned out to be surprisingly close to the bound of $92223.

```
밞밤따빠맣    9 4 * dup putchar; prints '$' (36) and leaves 36 on the stack
빠따밤밞      dup * 4 9; [1296 4 9]
망더          loop: print +; print 9, add, print 1300, break
희            halt

```
> 2 votes

# Answer
# Thunno 2 `j`, 5 bytes, $262,144

```
kk³'$

```

Maximum for 5 bytes is $299,069

#### Explanation

```
kk      # Push 64 to the stack
  ³     # Pop and push 64 ** 3
   '$  '# Push the string "$"
        # The j flag joins the stack
        # (which is reversed in Thunno 2)
        # Implicit output

```

#### Screenshot
> 2 votes

# Answer
# Vyxal `RssṪ`, 26 bitsv1, 3.25 bytes ($371091)

```
\$»*

```

Try it Online!

If the interviewer is going to play dirty, then so am I. That'll teach companies to put arbitrary restrictions on their job offerings!
> 2 votes

# Answer
# SmileBASIC, 10 bytes, $131072

```
?"$";#R*#L

```

`#R` and `#L` are constants with values of 512 and 256.
> 1 votes

# Answer
# Forth (gforth), ~~$104857~~ $125000 (16 bytes)

```
." $"char  .

```

Try it online!
> 1 votes

# Answer
# Flobnar, 16 bytes, $123904

```
$,g<+<>!
@X:+<*\

```

Try it online!

A little hard since I couldn't use numbers, but I got around it by using the `g`et command.

### Explanation:

```
........   Start the program
@......    Evaluate left and print result

......>.   Evaluate to the right
......\

$......!  Invert
.......   Pop the top of the call stack (does nothing)

$,g.....  Print the cell at:
..:....     Top of the call stack (0,0 => $)

.,.....!  , returns 0, ! inverts that to 1 and
......\     \ stores it in the call stack

...<+<..  Return ((Z+Z)+(Z+Z))*((Z+Z)+(Z+Z))
...+<*.     Where Z is the return of the leftmost arrow

..g.....  Return the cell at:
.X:....     Top of the call stack (1,1 => X (88))

```
> 1 votes

# Answer
# Python 2, $65536 (34 bytes)

An answer using mathematical operators:

```
t=True;t+=t;t<<=t;print"$",t**t>>t

```

## How it works

```
t=True;    # True evaluates to 1
t+=t;      # 1 + 1 = 2
t<<=t;     # 2 << 2 = 8
print"$",  # Python 2's print statement doesn't need parentheses or whitespace
t**t>>t    # 8 ** 8 = 16777216
           # 16777216 >> 8 = 65536

```
> 1 votes

# Answer
## VBA, 21 bytes, $101,126

Max salary for 21 bytes: $101937.86

```
?"$"ASC("e")&ASC("~")

```

Literally just prints `$`, `101` and `126` without spaces

Golfing wise: VBA will automatically concatenate a string followed by a number or function, so there is no `&` required between `?"$"` and `ASC("e")`

If the `&` is omitted, then you get spaces between the strings and numbers - *if* this is a valid output then for 20 bytes you can use `?"$"ASC("i")ASC("~")` to get `$ 105 126` (max salary: $105,737.13)
> 1 votes

# Answer
# Common Lisp, $72447 (33 bytes)

```
(format t"$~d"(char-code #\))

```

The character is Unicode U+11AFF.

Try it online!
> 1 votes

# Answer
# Pyth, ~~$161051 (11 bytes)~~ $192450 (9 bytes)

```
+\$C"ˮǂ

```

Performs an integer conversion (via `C`) on two two-byte characters (ˮ, code point `0x2EE`, and ǂ, code point `0x1C2`), resulting in a final value of `0x2EFC2`, i.e. $192450, the best integer score for this byte-count.

**Old answer:**

```
+\$^hT/ThhZ

```

Prepends a '$' sign to the result of 11^5.
> 1 votes

# Answer
## Excel, ~~10~~ 16 bytes, ~~$177827~~ $125000

`="$"&ROW()`

Not sure if this is a valid entry. It returns $ following the current row number. So if you put it on row ~~177827~~ 125000, it will return ~~$177827~~`$125000`
> 1 votes

# Answer
# x86 (32-bit) machine code, $124124

Hexdump (16 bytes):

```
b8 3a 1d e3 03 f7 e0 89 01 c1 e8 08 89 41 04 c3

```

Disassembly:

```
b8 3a 1d e3 03  mov eax, 65215802
f7 e0           mul eax
89 01           mov[ecx], eax
c1 e8 08        shr eax, 8
89 41 04        mov[ecx + 4], eax
c3              ret

```

I found the "magic" number 65215802 by brute-force search. Its square is hexadecimal `F1C2C34323124`. When interpreted as a 4-byte string, it's `$124`. After a shift by 8 bits right, it's `124`, with a zero-byte string terminator.

For a 16-byte program, the maximum that may be displayed is `$125000`.
> 1 votes

# Answer
# GS2, 4 bytes ($256256)

```
•$▼▼

```

Try it online!

Just thought I'd add this as there were no 4 byte solutions. There are probably better solutions of 4 bytes, it'd be interesting to see what the highest is.

Explanation:

```
•$    Push a '$' character on the stack
  ▼   Push 256 on the stack
   ▼  Push 256 on the stack

```
> 1 votes

# Answer
# SQLite, 26 bytes, $86850

```
select'$'||unicode('')

```

Try it online!

Inspired by T-SQL @BradC answer
> 1 votes

# Answer
# FreeBASIC, $124095 (16 bytes)

```
?"$" &&hc &&hfff

```

prints

```
$124095

```

? means print

&h is the hex prefix

& connects parts together

Tested using FreeBASIC online
> 1 votes

# Answer
# MATL, 12 bytes, $155052

```
'$'t';I'hpVh

```

(Maximum for 12 bytes is $155100)

Explanation:

```
'$'t';I'hpVh

'$'             String literal
   t            Duplicate
    ';I'        String literal, product of which results in highest bound by $_max / 38
        h       Horizontal concat
         p      Product (implicitly converts to int)
          V     Convert to string
           h    Horizontal concat

```
> 1 votes

# Answer
# Common Lisp, 59 bytes $46974

```
(defun x()(format nil "~{~a~}"(list'"$"(char-code #\띾))))

```

Try it online!
> 1 votes

# Answer
# Runic Enchantments, 6 bytes, $255000

Thought I'd hit up a few challenges with the language I wrote a few days ago. TIO doesn't yet have an interpreter for it (coming soon I hope). Character set and execution is similar to \>\<\>, but with an extended set of available commands, multiple IPs, and IP "energy" (some commands--such as `o` (sort)--require/consume mana and IPs with 0 mana are terminated).

```
'ÿY'$@

```

Try it online!

### Explanation

```
>          Implicit entry (single line programs only; does not occupy a cell)
 'ÿ        push ÿ as a character
   Y       multiply by 1000 (implicit conversion to 255)
    '$     push $ as a character
      @    print entire stack and terminate the IP

```

An earlier attempt was `e|$$$':*` (push 15, reflect, push 15, multiply, duplicate, push `$`, print, print, print, (print: empty stack: IP terminated), resulting in $196196 however I realized that I could use `@` instead of `$$` which got me `f|@$':*` with a score of `$225225`, but further experimentation showed that I could get down to *six* characters starting from `Pbp'$@` (push PI, push 11, power, push `$`, print and terminate), which was `c5p'$@`. But that ran into the issue of no digit characters allowed (ironically, both entries resulted in higher outputs).

## 2 IPs (because the language can): $148642 (max $155100)

```
>e'$@
FFm\>

```

Try it Online

### Explanation

This will be a little hard to follow, but hopefully it makes sense. Instruction pointers wrap when they reach the edge of the program.

```
>
    >      Entry points (each IP begins with 10 mana)
----------------------
 e         Push 14
F          Fizzle
----------------------
  '        Enable single character read mode
 F         Fizzle
----------------------
   $       Push '$'
  m        Push current mana (8)
----------------------
    @      Print stack ($14) and terminate
   /       Reflect upwards
----------------------
   $       Pop and print (8)

----------------------

   /       Reflect right
----------------------
   $
mFF/       Push current mana (6), fizzle twice, reflect up
           At this point the IP is in a loop. It will terminate
           when it pushes a (2) and fizzles twice to end up with 0 mana

```
> 1 votes

# Answer
## JavaScript, 31 bytes, $74088

```
(x='*'.charCodeAt())=>'$'+x*x*x

```

The `*` asterisk character decimal code point `42` cubed is `74088` Try it online!
> 1 votes

# Answer
# C (clang), $70560 (34 bytes)

```
main(){printf("$%d",'*'*'*'*'(');}

```

Try it online!
> 1 votes

# Answer
# Z80Golf, $123456 (12 bytes)

```
00000000: 0606 3e24 ffc6 0c3c ff10 fc76            ..>$...<...v

```

Try it online!

Assembly:

```
ld b, 6 ; loop 6 times
ld a, 24h ; '$' char
rst 38h
add 0Ch ; 30h='0' char
loop:
	inc a
	rst 38h ; putchar
	djnz loop
halt

```

Try it online!
> 1 votes

# Answer
# Oracle SQL, 54 bytes ($50200)

```
select '$'||to_number(rawtohex('─↑'),'xxxx') from dual

```

Symbols must have codes 196 and 24 because 196 * 256 + 24 = 52000. Symbols may differ for different code pages, demonstrated result tested for code page 437.

```
SQL> select '$'||to_number(rawtohex('─↑'),'xxxx') from dual
  2  /

'$'||TO_NUMBER(RAWTOHEX('─↑'),'XXXX')
-----------------------------------------
$50200

SQL> exit;
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

C:\Windows\System32>chcp
Active code page: 437

```

# Oracle SQL, 44 bytes ($57343)

```
select '$'||ascii(unistr('\DFFF')) from dual

```

Max allowed number in this case is 58534 but the max one in HEX without digits is DFFF.

```
SQL> select '$'||ascii(unistr('\DFFF')) from dual
  2  /

'$'||A
------
$57343

```
> 1 votes

# Answer
# Canvas, $279936 (5 bytes)

```
$６７＾＋

```

Try it here!

Note that the ６ & ７ there are full-width characters, not ASCII numbers.
> 1 votes

# Answer
# Ink, $56789, 43 bytes

```
$<>
-(o)~temp q=o+o+o+o
-(t){t+q}{t<=q:->t}

```

Try it online!

# Explained

```
$<>               // Print a dollar sign and do not print a trailing newline.
-(o)              // Create a gather, and give it the label o. This creates a variable o, which keeps track of how many times this gather has been reached
                  // It is currently set to 1, and it will stay that way.
~temp q=o+o+o+o   // Create a variable q, containing the number 4.
-(t)              // Another label, another variable.
{t+q}             // print t + q, that is to say t + 4
{t<=q:->t}        // If t is not greater than q, jump to the gather labelled t
                  // (this automatically increments the t variable)

```

# Alternative solution: $66666, 31 bytes, but

I did find a better solution, but I don't like it, because it abuses a bug in the interpreter:

```
-(n){|}$<>
-(t){t<n+n:{n+n}->t}

```

Try it online!

The `{|}` is a sequence - it outputs one string (the empty string, in this case) the first time the line is reached, and another string (which in this case is also the empty string) every subsequent time the line is reached.
This might not seem useful here, since we never return to that line. But in the current version of Inklecate, when a sequence occurs immediately after a labelled gather, the gather's readcount increments three times rather than the usual one.
This makes it easy to produce a 3, which we then use to print the number 6 five times.
> 1 votes

# Answer
# Befunge-93 (FBBI), $209024 (8 bytes)

```
",**.@G$

```

Try it online!
> 1 votes

# Answer
# Cascade, $177827, 10 bytes

```
^$
 #"

```

Try it online!

I'm lucky here in that  counts as a letter variable, which allows me to fetch its ordinal value, with the cost that it is a multi-byte character.
> 1 votes

# Answer
# Go, $84426

```
func f(){print("$",'')}

```

The character in the single quotes is the Unicode character with code point `U+149CA`, encoded as 4 bytes in UTF-8. The Unicode standard does not currently assign it a value, but it is nevertheless valid to place it in Go source code, earning me only 18 cents below the maximum for 27 bytes. If you prefer, the character `U+14646 Anatolian Hieroglyph A530` is the nearest that is assigned, though it only gets me $83526.
> 1 votes

# Answer
# Wren, 34 bytes, $71021

Wren's verbosity ruined the game.

```
System.printAll(["$"]+"
".bytes)

```

Try it online!
> 1 votes

# Answer
# Whitespace, $ 65,025 (37 bytes)

```
[S S S T    S S T   S S N
_Push_36_$][T   N
S S _Print_as_character][S S S T    T   T   T   T   T   T   T   N
_Push_255][S N
S _Duplicate_255][T S S N
_Multiply][T    N
S T _Print_as_integer]

```

Letters `S` (space), `T` (tab), and `N` (new-line) added as highlighting only.
`[..._some_action]` added as explanation only.

Try it online (with raw spaces, tabs and new-lines only).

**Explanation in pseudo-code:**

```
Print '$' to STDOUT
Integer n = 255 * 255
Print n to STDOUT

```

---

I've created this 05AB1E program to generate this largest binary value that is still within the allowed salary based on the byte-count of the other necessary Whitespace commands, which resulted in `11111111` (255).
> 1 votes

# Answer
# Deadfish~, $101111 (21 bytes)

```
iisiisc{{d}}iiisioioo

```

Try it online!
> 1 votes

# Answer
# Knight, ~~$126126 (13 bytes)~~ $127127 (15 bytes)

```
O++"$"=d+A"~"Td

```

Try it online!

Output:

```
$127127

```

Now that `ASCII` is standard, this becomes very easy.

```
O++"$"=d+A"~"Td
         A"~"   # ASCII value of "~", 126
        +    T  # Add TRUE (coerced to 1) to get 127
      =d        # Assign 127 to d
  +"$"          # Prepend "$", this stringifies d
 +            d # Append 127 again to get "$127127"
O               # Output

```
* $1001: `+A"~"T`
> 1 votes

# Answer
# Squire, ~~$77777 (27 bytes)~~ $80000 (28 bytes)

```
proclaim("$"+arabic(M*LXXX))

```

Outputeth:

```
$80000

```

True Squire programmers needeth not the characters `0123456789`, rather, they useth Roman numerals.

```
# Proclaim to ye standard output...
proclaim(
    # A dollar sign,
    "$"
    # and M*LXXX in thy strange Arabic numeral system,
    # what one might write as 80000
    + arabic(M*LXXX)
)

```
* $2223: `M*LXXX` should've been obvious lol

---

# Squire without Roman numerals (commit `93d3bf1`), $55555 (38 bytes)

```
proclaim("$"+arabic(x=length(""+n))*x)

```

Sampersand doubteth my first solution, claiming that Roman numerals art "cheating". I contemplated catapulting him, but nay, I wouldns't want to slay the creator of this divine language.

Abuseth a blunder in commit `93d3bf1`, where the program counteth `"" + null` as `V` characters long.

```
# Proclaimeth to ye standard output...
proclaim(
   # A dollar sign,
   "$"
   # appended to the Arabic numeral 5
   +arabic(
     # Since n naught exist, it evaluateth to "null".
     # Assigneth the length of this to "x"
     # blunder: "null" art IV characters, not V, you jest
     x = length("" + n)
   )
   # Multiplieth the string "5" V times to get "55555"
   * x
   # Reward: "$55555"
)

```
> 1 votes

# Answer
# Rattle, $ 180180 (9 bytes)

```
$|bn*~/bb

```

Try it Online!

# Explanation

```
$|          take "$" as a variable
  b         add "$" to print buffer
   n        get ASCII value of "$" (36)
    *~      multiply by 10 ("~" acts as a zero here)
      /     divide by 2
       bb   add to print buffer twice
            (implicit output of "$180180")

```
> 1 votes

# Answer
# Vyxal , 6 bytes, $260847

```
\$»⟑¬ǎ

```

Try it Online!
> 1 votes

# Answer
# Zsh, $138166 (14 bytes)

```
<<<\$$[##]
```

Attempt This Online!

is the Unicode character with codepoint 138166. This is the maximum integer score for 14 bytes.
> 1 votes

# Answer
# Trilangle, $177827 (10 bytes)

```
"$o!@"

```

That CJK character is U+2B6A3, and 0x2b6a3 is 177827 in decimal.

Try it on the online interpreter!
> 1 votes

# Answer
# Pyth, $192169 (9 bytes)

```
s+\$CM"À©

```

Try it online!
> 1 votes

# Answer
# Julia 1.0, $101937 (~~23~~ 21 bytes)

```
print(:$,Int(''))

```

Try it online!

To obtain the magic value, I rounded down the maximum score for a solution with this byte count, then converted it to a `Char`.

-2 bytes thanks to amelies: print `:$` instead of `'/$'`
> 1 votes

# Answer
# GolfScript, 6 bytes, $255,255

```
"$\xFF").

```

Try it online!

The `\xFF` should be a literal `255`-codepoint character, which is a fairly common technique in a lot of languages, however `255` specifically doesn't work. There are multiple different character sets with different characters for `255`, and golfscript parses none of them correctly. In other words, pretend that `\xFF` is only one character long because it should be able to.
> 1 votes

# Answer
# Forth (gforth), 33 bytes, $69696

```
CHAR , CHAR $ DUP EMIT OVER * * .

```

Try it online!

As much as I prefer jonesforth, gforth doesn't need trailing whitespace for . to work properly, so it saves a byte.
> 1 votes

# Answer
## PHP, 18 Bytes $98301

Using the defined constants of php core.

```
$<?=E_ALL*SIGQUIT;

```

It's simple `E_ALL = 32767` and `SIGOUIT = 3`

**Output**

```
$98301

```

\**No restriction on use of defined constants :D
> 0 votes

# Answer
# Pip, ~~$192,450~~ $202,020 (~~9~~ 8 bytes)

```
O'$t+tMh

```

Try it online!

### Explanation

```
          Preset variables used: t = 10, h = 100
O'$       Output a dollar sign with no trailing newline
   t+t    10 + 10
      Mh  for each digit in 100
          The result is the list [20;20;20]
          Output, concatenating items together (implicit)

```
> 0 votes

# Answer
# plain TeX (using `pdftex`), $91126 (24 bytes)

```
\$\number`[\number`~\bye

```

Output is printed into a PDF.

Explanation: `\number`` prints the decimal place in the ASCII table of the following character.
> 0 votes

# Answer
# brainfuck, 44 bytes, $57777

Omg, first time trying this thing.... I don't even know how I did it xD

```
+++++++++[>++++>+<<-]>.>[>++++++<-]>-.++....

```

Try it online!
> 0 votes

# Answer
# PHP, $122122 (17 bytes)

```
$<?=$a=ord(z),$a;

```

---

first attempt, $80662, 25 bytes:

```
$<?=(M_PI**M_PI)**M_PI<<!A;

```

---

test script
> 0 votes

# Answer
# Swift 4, $50653 (50 bytes)

```
let a=UnicodeScalar("%")!.value;print("$\(a*a*a)")

```

Try it online!
> 0 votes

# Answer
# BASH, $82154 (28 bytes)

```
printf \\b!T|xxd -p|tr $[] $

```

Try it online.

This one requires an ASCII-capable machine, as `\b`, `!`, `T` must have code table positions `0x08`, `0x21`, `0x54` respectively. `$[]` is an empty arithmetic context whose result is `0`.
> 0 votes

# Answer
## Python 3, $78011 & 23 bytes

`print("$",ord(""))`

This is really simple, I just used the largest ordinal value I could find.

Try it online!
> 0 votes

# Answer
# Backhand, $189642 (9 bytes)

```
""o@$*O}

```

Try it online!

This was a bit of a weird one. The unprintable in the middle has a char value of `24`.

### Explanation:

Note that the pointer typically moves three steps at a time

```
"            Starts a string literal
   @        Pushes some characters to the stack
             Bounces off the edge and go left
 "  $  O     Push some more chars and end the string literal
             Bounce off the edge and go right
  o          Output the $
     *       Multiply the O (79) by the unprintable (24) = 1896
        }    Step to the right, which bounces off the edge, so steps left instead
       O     Output the 1896
 "  $        Start another string literal and reflect
  o  *  }    Push chars and reflect
  o  *       Push more chars and reflect
 "           End string literal
    $  O     Swap the o and * and outputs the * as a number (42)
   @        Unprintable (ignored) and then terminates

```

Most of this was from accidentally using `}` (step right) instead of `{` (step left) as the last char, which led me to find out that this used the `O` (output number) twice, so I could avoid having to do too much more fiddling.
> 0 votes

# Answer
# Lua, $74088 (32 bytes)

```
s='*'x=s:byte()print('$'..x*x*x)

```

Try it online!

### How:

`s:byte()`returns an integer equivalent to string `s` ASCII value, `'*'` value is `42`, `42^3=74088`. I guess this is the optimal solution for the size of the code I managed to think of, feel free to prove me wrong.
> 0 votes

# Answer
# Aheui (esotope), 30 bytes, $73636

```
밦밦따빠맣빠뱘휉망어

```

Try it online!

---

### Explanation:

```
밦: push 6, move cursor right by 1(→).
밦: push 6, →
따: mul(push 36), →
빠: dup(push 36), →
맣: print as character(36 > '$'), →
빠: dup(push 36), →
뱘: push 7, move cursor right by 2(→→).
휉: end.
망: print as integer, →
어: move cursor left by 1(←).

```

Note: Print instruction moves cursor in reverse direction if current storage is empty.
> 0 votes

# Answer
**C (gcc) - 26 bytes - $53159**

```
main(){printf("$%d",'ϧ');}

```

Try it online!
> 0 votes

# Answer
# C, $82154 (28 bytes)

```
main(){printf("$%x",'!T');}

```

Try it online!
> 0 votes

# Answer
# cQuents, $177800 (10 bytes)

```
@$#t:tto۲

```

Try it online!

## Explanation

```
@$          prepend $
  #t        output tenth term in sequence
    :       each term in the sequence equals
     tt       10 * 10 *
       o۲               python ord("۲"), which is 1778

```
> 0 votes

# Answer
## Perl 6, 18 bytes ($114431)

```
say '$'~ord ''

```
> 0 votes

# Answer
# 33, $139,968 (12 bytes)

```
"$"jcaaaxxpo

```

## Explanation

```
"$"       p  | Prints '$'
   jca       | Loads 36 (ASCII value of '$') into the accumulator and counter
      aaxx   | Trebles it (108), then multiplies the result by 1,296 (139,968)
           o | Prints it

```
> 0 votes

# Answer
# BRASCA, ~~$165100 (11 bytes)~~ $192100 (9 bytes)

```
'$o'ÀHgn

```

Try it online!

## Explanation

```
'$o          - Print $
   'À        - Push 192
     H       - Push 100
      gn     - Concatenate and print

```
> 0 votes

# Answer
# Pxem, 9 bytes (filename only), $192255.

* Filename (escaped unprintables): `$.p\300\377.n.n`

Try it online!
> 0 votes

# Answer
# Risky, $200000 (8 bytes)

```
\*\!/**+:}!_\*+

```

Try it online!

**Explanation:**

```
       +         ;  Join
   !             ;    Pair of
\*\              ;      "$" (6 * 6)
    /**          ;      "2" (5 * 10)
           _     ;    Fill
        :}!      ;      [1, 0, 2, 0, 1] (100 in base 3)
            \*+  ;      "0" (6 * 8)

```
> 0 votes

# Answer
# Ly, $151515 ~~(9 bytes)~~ ~~(11 bytes)~~ (12 bytes)

```
'/' -::'$ouu

```

Try it online!

```
'/' -::'$ouu  #
'/            # Push codepoint for "/" (47) on the stack
  '           # Push codepoint for " " (32) on the stack
   -          # Subtract yielding (15)
    ::        # Duplicate the top of the stack twice
      '$:o    # Push a "$" on the stack and print it as a char
          uu  # Print two entries on the stack as numbers (1515)

```

At the end of the code the stack contains `15` which is printed as a int by default, making the final concatenated output `$151515`.
> 0 votes

# Answer
# Rattle, 14 bytes, $122265

```
$|b<=@*~//*`*b

```

Try it online!

Try to outgolf this in Rattle!!!!!

# Explanation

```
|                 takes anything to the left of it as input ("$")
 b                adds "$" to the print buffer
  <               moves the pointer left (wraps around to pointer = 99)
   =@             sets the value on top of the stack to the pointer ( = 99 )
     *~           multiplies this value by 10 ( = 990 )
       //         divides by two, twice ( = 247.5 )
         *`       multiplies this value by its rounded self ( = 247.5 * 247 = 61132.5)
           *      multiplies this value by 2 ( = 122265)
            b     adds this value to the print buffer, prints and clears buffer implicitly

```

Note that this works in the current version of Rattle, but the data tape may eventually be expanded past 100 slots (the TIO link here is permanent for the current Rattle version, 1.1.2)
> 0 votes

# Answer
# Thunno `KJ`, $93,648.04 (7 bytes)

```
AwaA^'$

```

Attempt This Online!

#### Explanation

```
Aw       # Push pi
  aA     # Push 10
    ^    # Push pi ** 10
     '$ '# Push "$"
         # The flags concatenate them
         # (Because of the way Thunno's
         # stack works, the "$" gets
         # put in front of the number)
         # Implicit output

```
> 0 votes

# Answer
**Excel, $260847, (6 Bytes)**

(Max of 260847.43 at 6 bytes)

=Row()

In cell A260847 (or any other cell in the row), simply have =Row(). Row returns the row of the reference in question, and when nothing is given, simply returns the row of the cell that the formula is in.

We can then use Excel's Accounting formatting to insert the $ for us (or any other type of custom formatting).

This makes us extremely efficient and effective!
> -2 votes

---
Tags: code-challenge, restricted-source, self-referential
---