# Produce the number 2014 without any numbers in your source code

Note to challenge writers as per meta consensus: This question was well-received when it was posted, but challenges like this, asking answerers to Do X without using Y are likely to be poorly received. Try using the sandbox to get feedback on if you want to post a similar challenge.

It's 2017 2018 2019 2020 2021 2022 2023 already, folks, go home.

So, now that it's 2014, it's time for a code question involving the number 2014.

Your task is to make a program that prints the number 2014, without using any of the characters 0123456789 in your code, and independently of any external variables such as the date or time or a random seed.

The shortest code (counting in bytes) to do so in any language in which numbers are valid tokens wins.

Leaderboard:

var QUESTION_ID=17005,OVERRIDE_USER=7110;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;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="<h1>"+e.body.replace(OVERRIDE_REG,"")+"</h1>")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/<a/.test(o)&&(o=jQuery(o).text()),s[o]=s[o]||{lang:e.language,user:e.user,size:e.size,link:e.link}});var t=[];for(var o in s)s.hasOwnProperty(o)&&t.push(s[o]);t.sort(function(e,s){return e.lang>s.lang?1:e.lang<s.lang?-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("{{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 SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;
body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;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>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></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>{{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>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr></tbody> </table>

• Even though numbers are ignored in brainfuck, I thought I'd post one anyway. 32 Chars: ++++++[>++++++++<-]>++.--.+.+++. Apr 1, 2015 at 21:37
• Brainfuck isn't a valid language for this challenge. Apr 1, 2015 at 22:49
• I know. That's why I posted it as a comment Apr 1, 2015 at 22:51
• I wonder if this question gets a small spike in popularity around New Year's. Dec 26, 2015 at 23:28
• Waiting for "Come on folks, don't you realize it's 2016?" :) Jan 4, 2016 at 23:35

# Javascript, 37 bytes

((_=+!![])<<''+_+''+_)-(_<<_+++_+_)-_


It's not code golf until someone bitshifts.

$node > ((_=+!![])<<''+_+''+_)-(_<<_+++_+_)-_ 2014  It is actually Javascript, I promise. ((_=+!![]) // create 1 and save in _ << // left bitshift by 11 to get 2048 ''+_+''+_ // create 11 from '1' + '1' ) - // subtract (2048 - 32) === 2016 ( _<< // bitshift by 5 to get 32 _+++_+_ // create 5 from 1 + (++1) + 2 )-_ // subtract 2 to get 2014  • That looks so much like Brainfuck. Oct 19, 2014 at 14:59 # TI-BASIC, 12 bytes A completely new approach. iPart(π+iPart(e)sinh(π+√(π  This could probably be golfed further, using a 1-byte token in place of e, but I have spent far too long on this today... # Javascript, 6 characters (8 bytes) I never saw any rule saying we had to produce the number 2014 in the absence of any other output. (Nor anything about not outputting to an error, but that's more obvious.) new—  For me, on Firefox Nightly, this produces TypeError: "\u2014" is not a constructor, which contains the number 2014. (If it isn't obvious, this happens because the em dash, —, is U+2014. Or, in other terms, it's the unicode character that can be represented by the hexadecimal number 2014.) • Yes, but... Simply — yield Uncaught SyntaxError: illegal character U+2014 on my Firefox. – tsh Nov 3, 2021 at 6:11 Ruby: p eval("#{""=~//}x#{"\a".ord}de")  Here is how it works inside IRB shell: >> p eval("#{""=~//}x#{"\a".ord}de") 2014  ## J (18) This one doesn't use any character codes. Uses the idea that the sum of the sequence of natural numbers from 1 -> 63 = 2016. <:<:+/i.*:+~+~p:%_  • You could save two bytes <:<:+/i.*:+~dyad Nov 18, 2017 at 16:50 Multiboot x86 Assembly (250 bytes): [BITS N] %define L(x) mov dword [eax],'zaza'-x O equ 'A'<<\xe F equ 'bab'-'aaa' M equ \xFF\xAF\xAA\xFA-\xFD\xFF\xFC\xDE C equ -(M+F) h: dd M dd F dd C dd h+O dd h+O dq 'a'-'a' dd s+O s: mov eax,'\'<<\r L('HBJB') add eax,'e'-'a' L('IBFB') hlt  Compile with: nasm src.S -o 2014.bin -f bin -DN=32  (If someone has a suggestion for replacing the N macro, I'm all ears) • You can also submit the machine code as its own answer, provided final compiled binary doesn't have any bytes from 0x30 to 0x39 in it. Jan 7, 2014 at 2:48 ## Javascript: 47 characters Not the shortest, but another solution: $ node
> [!+[]+!+[]]+[+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+[]]
"2014"


Source

## Javascript: 6 characters

Your task is to make a program that prints the number 2014 without using any of the characters 0123456789

Ok, here you go: 6 characters.

$node > "²⁰¹⁴" '²⁰¹⁴'  Yeah, only for ASCII lowers. :-) Will I win? :-D ## x86 - 16 bytes (Assembled) This little snippet moves the stack so it overlaps the video memory, to then push the individual numbers straight to the screen (They even blink! Surely a sign of good times to come). Code: (Note: '0'-'9' -> 0x30-0x39) B890A8 8ED0 2C5C 50 2C04 50 48 50 40 40 50  Assembled from: mov ax, 0xA890 mov ss, ax sub al, 0x5c push ax sub al, 3 push ax dec ax push ax inc ax inc ax push ax  Build'n run: nasm -f bin -o 2014.com 2014.asm dosbox 2014.com  • I think it shouldn't have any characters [0..9] in your code Jan 31, 2014 at 14:56 • @TeunPronk but that's the generation code, not the submission -- the submission is the binary – cat Apr 15, 2016 at 23:47 # TI-Basic, 4941 31 π/π+π/π→B:B^B^B→C:C^C(C/B)-CB-B  Explanation • π/π+π/π→B Store 2 in B • :B^B^B→C Store 16 in C • :C^C(C/B)-CB-B Display 2014 • I'm up voting on the assumption this works; I have no way to test it. Jan 3, 2014 at 12:59 • @MichaelStern Explanation added :) Jan 3, 2014 at 15:22 • :π/π+π/π→B:B^B^B→C:Disp C^C*(C/B)-C*B-B would be 2 characters shorter. Jan 8, 2014 at 11:02 • @MichaelMadsen Thanks, updated! Jan 8, 2014 at 11:49 • 8 bytes can be saved with various tweaks: iPart(e→B:BBBB:Ans^B(Ans/B)-AnsB-B Nov 18, 2017 at 20:12 # awk (28) There's definitely a need for an "awky" answer... ;-) BEGIN{print++I+I--I++I++I*I}  ...oookaaayyy... the last * may be a + too. But please don't call it an "awkf*ck" solution then... ;-) BEGIN{print++I+I--I++I++I+I}  I think, I prefer the later version now because of less different characters... (tested with gawk and mawk) • A different use of variables that saves one byte: BEGIN{print++I+I J++I++I*I} Jan 19, 2021 at 0:57 # Windows Calculator - 5 characters Inspired by this answer to a different question. Open the Windows Calculator in Programmer View (Hex mode) and type: DFEC± This is what the result looks like. • If you change the size to Word, it will be an almost-valid answer that will output only 2014 Jan 9, 2015 at 11:49 • I don't think this is a programming language... – cat Apr 7, 2016 at 14:40 # The Shakespeare Programming Language, 219 bytes I am using drsam94's compiler. . Ajax,. Puck,. Act I: Scene I: [Enter Ajax and Puck] Ajax: You is the difference between a fat fat fat fat fat fat fat fat fat fat fat cat and the sum of a fat fat fat fat fat cat and a fat cat!Open thy heart! [Exeunt]  ## Explanation .  Everything from the first line to the first period is the title, parsed as a comment. Ajax,. Puck,.  These are characters from Shakespeare's plays, and descriptions (also comments) Act I: Scene I:  Act I and Scene I, used for gotos (not used here) Ajax:  The character speaking. You is the difference between  Assigns the difference of the next two values to the character being spoken to. a fat fat fat fat fat fat fat fat fat fat fat cat  Every adjective multiplies by 2, a noun is either 1 or -1 depending on its connotation (in this case it's 1). 2^11 * 1 = 2048. the sum of a fat fat fat fat fat cat and a fat cat  The sum of the next two values. 32 + 2 = 34, so 2048 - 34 = 2014 Open thy heart!  Prints the value of the character being spoken to as a number. # PHP, 27 bytes not in any way competitive to xfix´s solution, but here are a few versions with 27 bytes each: <?=hexdec($c=hexdec(e)),$c; # e->14->20, e->14 <?=ord(U)-ord(A),hexdec(e); # 85-65,14 <?=($c=ord(","))*$c+ord(N); # 44*44+78 <?=($c=ord("."))*$c-ord(f); # 46*46-102  The first one already has been posted by brother Filip; but the others have not. This one has 37 bytes, but I like it (inspired by the Calculator solution) <?=dechex(hexdec(dfeb)^hexdec(ffff));  or 13 bytes with <?=sqpu^AAAA;  But that idea has already been used by primo # C, 33 30 bytes Numerical Solution 1 f(){printf("%d",'<'*'#'-'V');} // 2014 = 60 * 35 - 86  # C, 86 83 bytes Numerical Solution 2 #define A ((int)'}') #define B (((int)'r')-((int)'d')) f(){printf("%d",A*B+A+A+B);} // A = 125 // B = 14 // 2014 = 125*14 + 125 + 125 + 14  # C, 53 50 bytes ASCII Art 1 f(){printf("┌┐ ┌┐ ┐ ┐┌\n┌┘ ││ │ └┤\n└┘ └┘ ┴ ┴");}  Result ┌┐ ┌┐ ┐ ┐┌ ┌┘ ││ │ └┤ └┘ └┘ ┴ ┴  # C, 94 91 bytes ASCII Art 2 f(){printf("╔═╗ ╔═╗ ╗ ╦ ╦\n ║ ║ ║ ║ ║ ║\n╔═╝ ║ ║ ║ ╚═╣\n║ ║ ║ ║ ║\n╚═╝ ╚═╝ ╩ ╩\n");}  Result ╔═╗ ╔═╗ ╗ ╦ ╦ ║ ║ ║ ║ ║ ║ ╔═╝ ║ ║ ║ ╚═╣ ║ ║ ║ ║ ║ ╚═╝ ╚═╝ ╩ ╩  • You could shorten all your mains to f, saving 3 bytes each, and your submission will still be valid. May 12, 2017 at 19:53 # Golfscript, 6 chars {xy}.*  Inspired from Peter Taylor's answer. This solution involves non-printable characters too. Where x and y represent 20 and 14 in ASCII (the non-printable characters we were talking about before). # 05AB1E, 4 bytes ToRÀ  Try it online! T # 10 o # 2**x (1024) R # reverse (4201) À # rotate left (2014) # implicit output  • Boring alternative: ŽGMR. Nov 19, 2019 at 15:42 • Some more: ŽFÌ;, ŽG_À, ŽΓû¨, ŽlT¦ Mar 16, 2021 at 22:28 # Emotinomicon, 14 bytes 😭ߞ😲😨  Try it online! Explanation: 😭 ߞ 😲 😨 explanation 😭 begin quote string ߞ 😲 end quote string 😨 pop N and output as a number  ߞ is U+7DE. 0x7DE is 2014. • Okay, thanks! In your code, do you convert the quote string to a number when it's outputting? May 25, 2019 at 15:05 • @MilkyWay90 Emotinomicon pushes the character code of each character in the string. May 25, 2019 at 15:07 # Rockstar, 34 32 bytes X was up equalizing a word Say X  Say hello to rockstar! (No I didn't make this one) ## Explanation: This first line: X was up equalizing a word  Uses Rockstar's Poetic number literals. (As opposed to regular literals, which use numbers). This means that the length of every word after was indicates the digit in that position. So here we have a 2 length (up), a 10 length (equalizing) a 1 length (a) and a 4 length (word). The length is % 10, so equalizing becomes a 0, and the result is that the variable X has the value 2014. Then of course we print it with Say • Save 2 bytes by using X's instead of X was. Sep 24, 2020 at 14:44 # Add++-i, 13 bytes L,"j"O"&"OL/*  Try it online! Caird why no halve built-in you have like 3 fricking built-ins for doing special stuff with doubling but absolutely nothing for halving why do you do this to me? ## Explained L,"j"O"&"OL/* L, # start a lambda that's automatically called by the -i flag "j"O # push the number 106 to the stack - that's the ascii value of j "&"O # push 38 to the stack - that's the ascii value of & L/ # push the length of the stack (2) and divide 38 by that. This is not a definitive way to consistently divide by 2...it's a miracle the circumstances allowed this. This results in 19 * # and multiply the two items (106 and 19) to get 2014.  ### C, 37 Characters main(){printf("%d%d",'d'-'P','\xE');}  • You could knock off 3 bytes by renaming main to f since we don't require main to be used. May 12, 2017 at 19:51 ## bash 35 I want something that doesn't use ASCII or UNICODE. [ ];x=$?;y=$[x+x];echo$y$?$x$[y+y]  If you don't mind some error messages mixed in (28 characters): [;x=$?;echo $x$?$[x/x]$[x+x]


You can get rid of the error messages if you don't mind corrupting a file (32 characters):

[ 2>x;x=$?;echo$x$?$[x/x]$[x+x]  • That doesn't use ASCII? That's a bit hard. Jan 7, 2014 at 2:04 • @JoeZ. My program would work just as well if the system used ebcdic. And as you know, a multitude of ebcdic systems use bash. :-) Jan 7, 2014 at 3:20 • Maybe 34 bytes: :;y=$[x=!$?,x+x];echo$y$?$x$[y+y] Try it online! – user92894 Aug 29, 2019 at 20:32 • Hmmm, Just 29 bytes: echo$[x=y=!x,y+=y]$?$x$[y+y] Try it online! – user92894 Aug 29, 2019 at 21:04 ### newLISP - 61 characters I can't seem to play golf in Lisp -- is it just too wordy? (int(apply string(map(fn(c)(find c'(b c a e d)))'(a b c d))))  # C# - 64 chars class P{static void Main(){System.Console.Write('!'*'>'-' ');}}  pretty printed class P { static void Main() { System.Console.Write('!' * '>' - ' '); } }  • What if we use class P { static void Main() { System.Console.Write(2014); } } Jan 7, 2014 at 6:55 • @Amit, you can't use numbers in this challenge... Jan 7, 2014 at 9:10 • if an exit code is acceptable class a{static int Main(){return '!'*'>'-' ';}} is just 47 chars. Jan 7, 2014 at 12:05 • I like this one, my countdown numbers skills sucked so I ended up with ('d' + 'e').ToString() + Math.Ceiling(Math.PI); Jan 8, 2014 at 15:02 # Sclipting, 3 characters (6 bytes) This outputs the string "2014". 꼣갱꽀  • That's not 3 bytes though. Jan 23, 2014 at 19:52 • I didn’t say it was. Jan 23, 2014 at 20:02 • Well I can see that obviously, but the question actually asks for a byte count. Jan 23, 2014 at 20:30 • Byte count stands at 12, I believe. Feb 8, 2014 at 19:34 • No, it’s 6 bytes. Feb 8, 2014 at 20:35 ## Pure bash 18 Without fork! echo$[$[$#xd]#bbc]
2014

• How about: printf %x \'— Just 13 characters (15 bytes).
– user92894
Aug 30, 2019 at 22:18
• @Isaac Awesome! I learn today this printf %d \'A newer seen before! Aug 31, 2019 at 7:41

# Pyth, 4 bytes

C"ߞ


Pretty straightforwards, just convert that character to an integer and print.

• While this answer is now technically the shortest, I can't accept it because it was written in a language that didn't exist at the time of writing the question. Jul 8, 2014 at 11:08
• @JoeZ. I understand. No worries, the rules make sense. Jul 8, 2014 at 15:50

# Python 2, 68 bytes

Not really short, but it abuses the fact that Python accepts booleans where an integer is required, because bool is a subclass of int.

import string;d=string.digits;T=True;print d[T+T]+d[:T+T]+d[T+T+T+T]

• +1 for the first non-cheating program in this question that doesn't depend on ASCII or UTF-8 (unless I missed something) Jan 1, 2014 at 21:54
• False can be shortened to d>d. On the other hand, d[d>d]+d[T] can be shortened to d[:T+T], so that optimization is not really necessary ;-). Also, from string import*;d=digits;saves one character. Jan 15, 2014 at 0:12
• @WolframH Noted. I'll update it later. Jan 21, 2014 at 21:49

### Excel VBA, 51 bytes

MsgBox Len("aa") & Len("") & Len("a") & Len("four")


As it's 2015 you could add an extra character onto "four" for an extra byte.

## MATLAB (no char codes), 47 chars

p=pi,q=p^p;e=exp(p);floor(q*q+q*e-q-q-q-p-e-e)

• I played with a similar approach in Mathematica (which has a much larger set of mathematical constants built-in). How long did it take you to develop that solution. Jan 2, 2014 at 22:46
• Just playing around, maybe five minutes, probably less. I’m pretty sure this is far from the most compact formula. Jan 3, 2014 at 13:13

# BASIC v2.0 (Commodore 64), 24 bytes

PRINT ASC("&")*(ASC("V")-ASC("!"))


The Commodore BASIC tokens are single-byte representations of BASIC keywords. This should result in storing the above line as 24 bytes instead of 34.

I was aiming to construct an equation based on character codes, so I was looking for ideal characters in PETSCII. To minimize the number of operations in the equation, it seemed like a good idea picking a pair of divisors of 2014.

However, none of the combinations were perfect, because either one of the divisors were too large, too small or the character code of a number.

So I ended up using 38 which is CHR$("&") and 53, but instead of directly using the latter which is CHR$("5"), I used the difference of 86 and 33. These are the character codes for CHR$("V") and CHR$("!") respectively.

Tested in VICE and FC64.