# 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 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.

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: ++++++[>++++++++<-]>++.--.+.+++. – Braden Best Apr 1 '15 at 21:37
• Brainfuck isn't a valid language for this challenge. – Joe Z. Apr 1 '15 at 22:49
• I know. That's why I posted it as a comment – Braden Best Apr 1 '15 at 22:51
• I wonder if this question gets a small spike in popularity around New Year's. – Joe Z. Dec 26 '15 at 23:28
• Waiting for "Come on folks, don't you realize it's 2016?" :) – padawan Jan 4 '16 at 23:35

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')
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. – Joe Z. Jan 7 '14 at 2:48

PHP: 54 chars

Slightly different approach, albeit long, using concatenation, and not using ordinal values:

<?=floor(M_E).floor(M_EULER).ceil(M_EULER).ceil(M_PI);

• <?= echo date('Y') ?> – Surabhil Sergy Jan 7 '14 at 11:37
• @SurabhilSergy that is not a valid answer, the output will change in 2015. – zamnuts Jan 7 '14 at 22:44

## PHP - 13 bytes

<?=m_n_^_o_k;


A fairly trivial ASCII-only solution.

Other variants:

<?=Q__Q^cone;
<?=VonV^d__b;
<?=PAAP^bqpd;
<?=BEAU^pupa;


etc.

• BEAU^pupa LOL. – Joe Z. Jan 9 '14 at 18:59
• <?=date('Y'); in any year ) – Dmitry Dubovitsky Jan 13 '14 at 14:50
• @DmitryDubovitsky <?=date(Y); would also work, but it won't always print 2014, as the problem requires. – primo Jan 13 '14 at 23:32

## 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

# 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. – Michael Stern Jan 3 '14 at 12:59
• @MichaelStern Explanation added :) – Timtech Jan 3 '14 at 15:22
• :π/π+π/π→B:B^B^B→C:Disp C^C*(C/B)-C*B-B would be 2 characters shorter. – Michael Madsen Jan 8 '14 at 11:02
• @MichaelMadsen Thanks, updated! – Timtech Jan 8 '14 at 11:49
• 8 bytes can be saved with various tweaks: iPart(e→B:BBBB:Ans^B(Ans/B)-AnsB-B – Khuldraeseth na'Barya Nov 18 '17 at 20:12

# 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 – Ismael Miguel Jan 9 '15 at 11:49
• I don't think this is a programming language... – cat Apr 7 '16 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.

# 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).

# 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.)

# 05AB1E, 4 bytes

ToRÀ


Try it online!

T        # 10
o       # 2**x (1024)
R      # reverse (4201)
À     # rotate left (2014)
# implicit output

• Boring alternative: ŽGMR. – Kevin Cruijssen Nov 19 '19 at 15:42
• Some more: ŽFÌ;, ŽG_À, ŽΓû¨, ŽlT¦ – Makonede Mar 16 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? – MilkyWay90 May 25 '19 at 15:05
• @MilkyWay90 Emotinomicon pushes the character code of each character in the string. – Erik the Outgolfer May 25 '19 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. – Shaggy Sep 24 '20 at 14:44

### 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. – MD XF May 12 '17 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. – Joe Z. Jan 7 '14 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. :-) – Stephen Montgomery-Smith Jan 7 '14 at 3:20
• Maybe 34 bytes: :;y=$[x=!$?,x+x];echo $y$?$x$[y+y] Try it online! – ImHere Aug 29 '19 at 20:32
• Hmmm, Just 29 bytes: echo $[x=y=!x,y+=y]$?$x$[y+y] Try it online! – ImHere Aug 29 '19 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); } } – Amit Ranjan Jan 7 '14 at 6:55
• @Amit, you can't use numbers in this challenge... – shamp00 Jan 7 '14 at 9:10
• if an exit code is acceptable class a{static int Main(){return '!'*'>'-' ';}} is just 47 chars. – Jodrell Jan 7 '14 at 12:05
• I like this one, my countdown numbers skills sucked so I ended up with ('d' + 'e').ToString() + Math.Ceiling(Math.PI); – NibblyPig Jan 8 '14 at 15:02

## 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 – Teun Pronk Jan 31 '14 at 14:56
• @TeunPronk but that's the generation code, not the submission -- the submission is the binary – cat Apr 15 '16 at 23:47

# Sclipting, 3 characters (6 bytes)

This outputs the string "2014".

꼣갱꽀

• That's not 3 bytes though. – daniero Jan 23 '14 at 19:52
• I didn’t say it was. – Timwi Jan 23 '14 at 20:02
• Well I can see that obviously, but the question actually asks for a byte count. – daniero Jan 23 '14 at 20:30
• Byte count stands at 12, I believe. – cjfaure Feb 8 '14 at 19:34
• No, it’s 6 bytes. – Timwi Feb 8 '14 at 20:35

## Pure bash 18

Without fork!

echo $[$[$#xd]#bbc] 2014  • How about: printf %x \'— Just 13 characters (15 bytes). – ImHere Aug 30 '19 at 22:18 • @Isaac Awesome! I learn today this printf %d \'A newer seen before! – F. Hauri Aug 31 '19 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. – Joe Z. Jul 8 '14 at 11:08 • @JoeZ. I understand. No worries, the rules make sense. – isaacg Jul 8 '14 at 15:50 # 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} – Pedro Maimere Jan 19 at 0:57 # 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) – Konrad Borowski Jan 1 '14 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. – Reinstate Monica Jan 15 '14 at 0:12 • @WolframH Noted. I'll update it later. – nyuszika7h Jan 21 '14 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. – Michael Stern Jan 2 '14 at 22:46 • Just playing around, maybe five minutes, probably less. I’m pretty sure this is far from the most compact formula. – Christopher Creutzig Jan 3 '14 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. # C++, 50 bytes #include<iostream> int main(){std::cout<<'U'^'A';}  • You should provide compile-ready code in C++. – Joe Z. Jan 1 '14 at 5:24 • Also, use four spaces before each line for blocks of code. – Joe Z. Jan 1 '14 at 5:29 • i added "iostrean but it disappeared, actually am new so don't know how to" – zeeshan mughal Jan 1 '14 at 5:29 • This is supposed to be code golf, i.e. shortest code possible. Remove unnecessary whitespace, etc – Doorknob Jan 1 '14 at 5:32 • @DoorknobofSnow thanx, after your edition i can still see few extra spaces – zeeshan mughal Jan 1 '14 at 5:34 # Java 8, 33 bytes ()->Integer.parseInt("bbc",'\r');  # 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

## EXCEL: 148 bytes

=POWER(ROW()+ROW(),(ROW()+ROW()+ROW())*(ROW()+ROW()+ROW())+ROW()+ROW())-(POWER(ROW()+ROW(),ROW()+ROW()+ROW())*(ROW()+ROW()+ROW()+ROW())+ROW())-ROW()

only works in A1.

• 1. It works anywhere in row 1. 2. Use the ^ operator instead. 3. You can also save a few using row 2 instead and a little algebra: =ROW()^((ROW()+ROW()/ROW())^ROW()+ROW())-ROW()-ROW()^(ROW()+ROW()+ROW()/ROW(. But then again, you can also save some by going all the way to Row 2014 too. – Calculuswhiz Jul 10 '20 at 12:23
• Of course, concatenation is also an option. – Calculuswhiz Jul 10 '20 at 12:28