272
\$\begingroup\$

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:

enter image description here

\$\endgroup\$
9
  • 77
    \$\begingroup\$ This is one of the very few (imo) successful non-fixed-output no-input non-random challenge. Unique idea! \$\endgroup\$
    – Mr. Xcoder
    Commented Aug 26, 2018 at 0:45
  • 4
    \$\begingroup\$ Nice challenge! Can we output a fully formatted currency value, if desired? Like $80,662.67 instead of $80662.6659? Your rules seems to preclude the comma, which means I couldn't use any built-in currency functions. \$\endgroup\$
    – BradC
    Commented Aug 27, 2018 at 19:07
  • 7
    \$\begingroup\$ I hope you don't mind, I've added a variation of the Leaderboard Snippet that sorts by score instead of bytes. Excellent first challenge! \$\endgroup\$ Commented Aug 27, 2018 at 19:27
  • 12
    \$\begingroup\$ Just noticed the new contributor tag. Well-constructed challenge, with such a high upvote and a vast amount of answers in only a few days, I wonder if this could be eligible for this years' Rookie of The Year ;) \$\endgroup\$ Commented Aug 28, 2018 at 11:21
  • 4
    \$\begingroup\$ I've nominated this challenge as a candidate for "Rookie of the Year - Challenges" category in Best of PPCG 2018 as I said back then. \$\endgroup\$ Commented Feb 8, 2019 at 8:22

147 Answers 147

5
\$\begingroup\$

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.

\$\endgroup\$
5
\$\begingroup\$

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
\$\endgroup\$
5
\$\begingroup\$

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

\$\endgroup\$
5
\$\begingroup\$

Excel VBA - 22 Bytes, $97336

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

How it works

? - Print in immediate
 "$" - $ character
 asc(".") = 46
 Asc("") = 3
  46 ^ 3 = 97336
\$\endgroup\$
2
  • \$\begingroup\$ A good first post! You can drop an extra byte by removing the &, but this doesn't open up any useable higher salaries via this method - only 10^5 = 100,000, which would require a line-feed, and then can't be typed in the immediate window (vbLf would take you over the character limit) \$\endgroup\$ Commented Aug 28, 2018 at 14:41
  • \$\begingroup\$ This a great first post, but it is worth noting that it only works in 32-Bit Versions of Excel, as in 64-Bit Versions, the ^ character plays double duty as both the exponentiation and longlong type declaration character \$\endgroup\$ Commented Feb 15, 2019 at 19:30
5
\$\begingroup\$

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.

\$\endgroup\$
5
  • 1
    \$\begingroup\$ You can golf some bytes (and thus improve the salary) using + instead of [int] like follows -- "`$$(+[char]"C")"+(+[char]'~') \$\endgroup\$ Commented Aug 28, 2018 at 14:54
  • 1
    \$\begingroup\$ Take it: "$"+($x=+'e'[+$i])+$x, $101101, 21 bytes. You should start the script on a clear Powershell with Set-StrictMode -Off (default mode). If $i have defined then clear the var by command rv i \$\endgroup\$
    – mazzy
    Commented Sep 13, 2018 at 0:38
  • 1
    \$\begingroup\$ Enjoy the bonus: "$"+($x=+'i'[""])+$x, $105105, 20 bytes \$\endgroup\$
    – mazzy
    Commented Sep 13, 2018 at 11:17
  • 1
    \$\begingroup\$ One more 20 bytes :) $x=+'i'[''];"``$$x$x". Note double ` used for comment on stackexchange only. Replace double ` on single one or use allowed space $x=+'i'[''];"$ $x$x". \$\endgroup\$
    – mazzy
    Commented Sep 14, 2018 at 7:48
  • 1
    \$\begingroup\$ Newerending story... +'i'['']|%{"$ $_$_"} with Scrooge McDuck emoji string $ $_$_ \$\endgroup\$
    – mazzy
    Commented Sep 14, 2018 at 8:17
4
\$\begingroup\$

Hexagony, 12 bytes, $122122

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

Try it online!

\$\endgroup\$
4
\$\begingroup\$

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).
\$\endgroup\$
0
4
\$\begingroup\$

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.

\$\endgroup\$
5
  • \$\begingroup\$ What about just 20000? Try it online! \$\endgroup\$
    – Jo King
    Commented Aug 26, 2018 at 0:33
  • 2
    \$\begingroup\$ Actually though, I think this is just a snippet, so you should make it a function or a full program. 162754 \$\endgroup\$
    – Jo King
    Commented Aug 26, 2018 at 0:43
  • \$\begingroup\$ @JoKing Clearly I didn't search enough of the Unicode space to find that 200,000. As for being a snippet, the question asked for "output," which I think can reasonably mean the result of evaluating an expression. Also, at the time I answered, there were several other responses which were just expressions. \$\endgroup\$
    – Sean
    Commented Aug 27, 2018 at 18:24
  • \$\begingroup\$ But since it's hardly a big deal... \$\endgroup\$
    – Sean
    Commented Aug 27, 2018 at 19:17
  • 1
    \$\begingroup\$ 162754 \$\endgroup\$
    – Jo King
    Commented Aug 27, 2018 at 21:08
4
\$\begingroup\$

><>, 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
\$\endgroup\$
4
\$\begingroup\$

Haskell, $99999 (15 bytes)

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

Try it online!

\$\endgroup\$
4
\$\begingroup\$

Swift, $131072 (13 bytes)

"$\(MAXPHYS)"

In Swift Playground it prints "$131072"

\$\endgroup\$
1
4
\$\begingroup\$

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.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ here's a permalink for your answer (although it only evaluates as an integer, which loses you 49 cents). "10 bytes" is only accurate if you are using IBM Codepage 907. \$\endgroup\$ Commented Sep 4, 2018 at 10:23
  • 1
    \$\begingroup\$ And you can save a byte by doing simply ≡⍬ instead of ⍬≡⍬ \$\endgroup\$ Commented Sep 4, 2018 at 10:28
4
\$\begingroup\$

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
\$\endgroup\$
5
  • \$\begingroup\$ Ok, fixed all problems with it now \$\endgroup\$
    – EdgyNerd
    Commented Aug 8, 2019 at 5:59
  • \$\begingroup\$ Oh, I was using Ī since it's Unicode value is 298, and not because it's an instruction. Also, any number above 255 is outputted as a number instead of a character, so it doesn't seem like undocumented behaviour \$\endgroup\$
    – EdgyNerd
    Commented Aug 10, 2019 at 9:20
  • 1
    \$\begingroup\$ +1 for clever use of Unicode characters. \$\endgroup\$
    – user85052
    Commented Aug 10, 2019 at 9:24
  • \$\begingroup\$ Hey @EdgyNerd, you are right about numbers greater than 255 being printed as integers not being undocumented behaviour: when creating the implicit output system, I wanted it to print only ASCII characters in the range of 10 to 255. Why? Because I had no clue people would be using Unicode characters. But also, I think it is unique as well. \$\endgroup\$
    – lyxal
    Commented Aug 10, 2019 at 11:59
  • \$\begingroup\$ yeah, using Unicode character allows you to represent large number using very little bytes, and, as you said, I don't think any other lang has a feature like that \$\endgroup\$
    – EdgyNerd
    Commented Aug 10, 2019 at 12:20
4
\$\begingroup\$

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.

\$\endgroup\$
4
\$\begingroup\$

Python (28 bytes; $15876)

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

Try it online!


This is my first code golf answer. :)

\$\endgroup\$
1
4
\$\begingroup\$

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
\$\endgroup\$
4
  • \$\begingroup\$ Nice answer! However the 2 in your answer does not match the rule "Your code cannot contain the characters 0123456789." ? \$\endgroup\$
    – Julian
    Commented Mar 30, 2023 at 20:14
  • \$\begingroup\$ h;+ª;`$ seems to get the same result for the same byte count \$\endgroup\$
    – Julian
    Commented Mar 30, 2023 at 21:00
  • \$\begingroup\$ You can even get $10,000 extra this way hhg+ª;`$ \$\endgroup\$
    – Julian
    Commented Mar 30, 2023 at 21:19
  • \$\begingroup\$ ahhh darn the 2 \$\endgroup\$
    – la.evis.
    Commented Mar 30, 2023 at 22:24
3
\$\begingroup\$

Brain-Flak, $55555

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

Try it online!

Brain-Flak with -r flag, $57777

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

Try it online!

\$\endgroup\$
3
\$\begingroup\$

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'*'Α');
\$\endgroup\$
1
  • \$\begingroup\$ It shouldn't change your solution much, but the required format is dollar sign first, then value \$\endgroup\$
    – Nicola Sap
    Commented Aug 25, 2018 at 20:53
3
\$\begingroup\$

><>, 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
\$\endgroup\$
3
\$\begingroup\$

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).
\$\endgroup\$
3
\$\begingroup\$

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!

\$\endgroup\$
1
  • 1
    \$\begingroup\$ var x:byte=ord('&');begin write('$',x*x*x)end. saves a byte, but does not increase salary. \$\endgroup\$ Commented Aug 25, 2018 at 17:31
3
\$\begingroup\$

Bubblegum, $260847 (6 bytes)

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

Try it online!

\$\endgroup\$
3
\$\begingroup\$

dc, $177147 (9 bytes)

[$]nAvB^n

Try it online!

\$\lfloor\sqrt{10}\rfloor^{11}\$.

\$\endgroup\$
3
\$\begingroup\$

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)

\$\endgroup\$
4
  • \$\begingroup\$ I believe your score is the number you printed, not the maximum salary. Interesting answer! \$\endgroup\$ Commented Sep 12, 2018 at 21:22
  • \$\begingroup\$ Thanks. I literally print $, 1, and then 8000. \$\endgroup\$ Commented Sep 12, 2018 at 23:30
  • 1
    \$\begingroup\$ $20736 \$\endgroup\$
    – Jo King
    Commented Sep 12, 2018 at 23:47
  • \$\begingroup\$ How do you always do better than me? Clever use of the ASCII value of the dollar sign! \$\endgroup\$ Commented Sep 13, 2018 at 0:07
3
\$\begingroup\$

PowerShell, $1, 17 bytes

Owner's salary:

"$"+[bigint]::One

Try it online!

\$\endgroup\$
6
  • 2
    \$\begingroup\$ You could do "$"+[bigint]::One+[bigint]::One+[bigint]::One+[bigint]::One+[bigint]::One and get $11111, keeping you below the limit. \$\endgroup\$
    – maxb
    Commented Sep 13, 2018 at 11:33
  • \$\begingroup\$ **An entry is valid if** the value it outputs is not greater than ($1'000'000) · *b*<sup>-0.75</sup> Why would the owner break the rules? :) \$\endgroup\$
    – mazzy
    Commented Sep 13, 2018 at 11:35
  • \$\begingroup\$ Thanks for TIO link. I have the error This site can’t be reached with this site \$\endgroup\$
    – mazzy
    Commented Sep 13, 2018 at 11:37
  • \$\begingroup\$ O, Powershell syntax highlighting! Thanks! \$\endgroup\$
    – mazzy
    Commented Sep 13, 2018 at 11:39
  • 1
    \$\begingroup\$ Yeah, It's Owner's salary. :) It's reguired [bigint] to write his salary \$\endgroup\$
    – mazzy
    Commented Sep 13, 2018 at 11:41
3
\$\begingroup\$

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. ^^;)

\$\endgroup\$
3
\$\begingroup\$

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.

\$\endgroup\$
3
\$\begingroup\$

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!

\$\endgroup\$
2
\$\begingroup\$

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 :)

\$\endgroup\$
2
\$\begingroup\$

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:

$×⁶I²

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

\$\endgroup\$
1

Not the answer you're looking for? Browse other questions tagged or ask your own question.