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

• 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

C#, 28 bytes

You don't need to cast to an int as Hille does, so it becomes

Console.WriteLine('ϱ'+'ϱ')

# Symbolic Python, 31 bytes

_=-~-~-~(_==_)
_=""[_::_]

Try it online!

Symbolic Python bans numbers anyway.

### Explanation:

_=-~-~-~(_==_)   # Set _ to 4
_=               # Set _ to
""         # From the representation of some unprintables
# Which is '\x12\x10\x11\x14'
[_::_]   # From the 4th character, take every 4th character
# Output the contents of _ implicitly

A more interesting solution at 34 bytes:

_=-~(_==_)
_=_+_-_+_/_+_*_

Try it online!

_=-~(_==_)               # Set _ to 2
_=_+_-_+_/_+_*_
# '2'+'2-2'+'2/2'+'2*2' = '2'+'0'+'1'+'4' = '2014'
• Crazy that someone else is actually using this stupid language I made, haha – FlipTack Dec 17 '18 at 21:01

### Edited: bash 81 chars!

Just for fun:

wc -c < <(echo {,}{,,}{,}{,,,}{,}{,,,}film dbugjkqstvxz{,}{,,} 'Happy New Year!')

there is no numbers, all letters are used and this print exactly:

2014

( This method could reasonably be used until 2016: by just adding one or two exclamation point after the wish:

wc -c < <(echo {,}{,,}{,}{,,,}{,}{,,,}film dbugjkqstvxz{,}{,,} 'Happy New Year!!')
2015

;-)

### bash 27 chars

.;v=$?;echo$v$?${#v}$[v+v] This will output: bash: .: filename argument required .: usage: . filename [arguments] 2014 Ok, this will generate some unwanted output, but 2014 is printed and is a valid token! The two following sample are error free (a little longer but near golfed) v=$(echo {V..v});echo $[${#v}#vu]
2014

or

printf -vv "%d" $?xfbc;echo$[v>>${#?}] 2014 or even: echo$[$[$[${#?}$?-${#?}]$?>>${#?}]#Iy] 2014 Inspired by comment from GammaFunction: echo$[$[a-a]xfbd>>${#?}]
• You don't need to set a var in the 0xfbc solution: echo $[$?xfbc>>++j] works just fine (19 bytes). – GammaFunction Mar 28 '19 at 7:15
• Nice! Late to post but you could! Unfortunely you have to ensure $? to be 0 and this could not be reused... But impressive! – F. Hauri Mar 28 '19 at 15:54 • @GammaFunction Post edited ;-) – F. Hauri Mar 28 '19 at 16:46 ## @, 9 chars -Σ*{~~}82 Explanation (syntactically invalid) - 2 Subtract the result by 2(2014) Σ Summation of all ASCII codes in the string(2016) * 8 Duplicate the string 8 times {~~} Define the string "~~" There is no Try It Online for @. If the current year is 2016, it would be perfect(7 chars): Σ*{~~}8 # Base64, 9 Bytes MjAxNA== (You can decode it with: echo MjAxNA== |base64 -d) # Javascript, 45 characters _=> new Date().getFullYear()-new Date().getDate() Very Temporary!! Another Day, another very Temporary answer :-) f=new Date().getFullYear()-new Date().getDay() • Welcome to Code Golf! Submissions should be either a full program or a function, so I would recommend prepending _=> to your solution to turn it into an anonymous function. – Stephen Sep 5 '19 at 20:00 • You could possibly remove the space between => and new to save a byte – Benji Mar 19 '20 at 15:26 # Triangular, 12 bytes tE**%Cdd.>/ Try it online! Y'know, I was just about to post a 14-byte solution; luckily I went back to double-check and had a hunch. Ungolfed: t E * * % C d d .  > / -- Actual Execution Order -- t*C The first multiplication does nothing. 12 is pushed twice, then direction changes and both are multiplied to get 144. E*d>/d% Push 14, then multiply 14*144=2016. Decrement twice and print. The 14-byte I was going to post: t*CE.$$$$*...>dd% # Wren, 27 bytes Just like most other answers, convert to code points and print. However this uses control characters in the source code. System.printAll("".bytes) Try it online! ## Explanation "" // An unprintable chain containing 0x14 (20 in decimal) and 0x0e (14 in decimal) .bytes // Convert them to a list of their decimal codes [20, 14] System.printAll( ) // Print them all without a separator (2014) # ><>, 7 bytes aa+nen; You can try it on The Online ><> interpreter. ## Explanation a # push 10 a # push 10 + # push sum of top two values (10 + 10 = 20) n # output top value as number e # push 14 n # output top value as number ; # halt program This doesn't print the following: 20 14 because n outputs the top value as a number without a newline. ## Alternate Solution (9 bytes) This one actually puts 2014 on the stack as a single number and outputs it. cbde**+n; I basically just tried random values for this one :P # ABC, 11 bytes aacncacaaac ## Explanation a increments the accumulator, c outputs it and n sets it to 0. ## Wj, 4 bytes ë‘"C ## Explanation ë‘" % Push a list C % Convert to list of ord codes [20,14] flag:j % Join without a separator $$$$ # MathGolf, 2 bytes ID Try it online! ## Explanation I # push 20 D # push 14 # implicit output ## Spice, 145 97 bytes Improvement using multiplication to get the 9 from 2*2*2+1, as we already had those values. ;t;z;o;n;i@LEN i z;ADD i i i;LEN i o;PUT i i i;LEN i t;MUL t t i;MUL t i i;ADD o i n;OUT t z o n; ## Un-golfed explanation ;t;z;o;n;i@ - Declare vars LEN i z; - Get the length of [], 0, and store in z ADD i i i; - Adding implicitly uses the first element, or 0 if there is none, so we insert 0 into i LEN i o; - Store length of [0], 1, in o PUT i i i; - Insert 0th element of i into i at position i[0] (we're increasing the array size) LEN i t; - Store length of [0, 0], 2, into t MUL t t i; - Multiply t, 2, by itself and store in i MUL t i i; - Multiply t, 2, by i, 4, and store in i ADD o i n; - Add o, 1, to i, 8 and store in n OUT t z o n;- Write to console - "[2] [0] [1] [9]" ## Original ;t;z;o;n;i@LEN i z;ADD i i i;LEN i o;PUT i i i;LEN i t;PUT i i i;PUT i i i;PUT i i i;PUT i i i;PUT i i i;PUT i i i;PUT i i i;LEN i n;OUT t z o n; ## Un-golfed explanation In Spice, all variables are double arrays. Importantly, variables that have no assigned value are either treated as an empty list [] or 0 depending on the operation. The built-in LEN will give the length of an array and we can therefore produce numbers: ;t;z;o;n;i@ - Declare vars LEN i z; - Get the length of [], 0, and store in z ADD i i i; - Adding implicitly uses the first element, or 0 if there is none, so we insert 0 into i LEN i o; - Store length of [0], 1, in o PUT i i i; - Insert 0th element of i into i at position i[0] (we're increasing the array size) LEN i t; - Store length of [0, 0], 2, into t PUT i i i; - Now repeat until there are 9 elements... PUT i i i; PUT i i i; PUT i i i; PUT i i i; PUT i i i; PUT i i i; LEN i n; - ... and store in n OUT t z o n; - Write to console - "[2] [0] [1] [9]" For the original 2014 version, you save bytes for less PUTs - 95 bytes. So this solution will improve next year! # FEU, 69 bytes a/abcdeghij m/a/bb/b/cc/c/dd/d/ee/e/ff/f/gg/g/hh/h/ii/i/jj/j/kk/g U/k Try it online! # Excel, 12 =UNICODE("ߞ Second best I could do was =ARABIC("MMXIV at 14 bytes. ## Jelly, 10 bytes ⁹⁴×H_⁴Ḥ¤’’ Explanation: ⁹ Set the current value to 256. ⁴× Multiply by 16. The current value is now 4096. H Divide by 2. The current value is now 2048. _⁴Ḥ¤ Subtract by 16/2. The current value is now 2016. ’’ Decrement twice. The current value is now 2014. # MAWP, 30 28 bytes !!+!!!!++!*+/!+!!+!+!!++++*: Try it! This will be fun to golf. This is longer than @Lyxal 's answer, but outputs only one time as one number. • 15 bytes – lyxal Sep 28 '20 at 9:10 # Poetic, 112 bytes twos a bad thing using a two?o,hardly!i am using a poem a numeric poem?oh,clearly,but a limited one for certain Try it online! # DROL, 13 bytes ziill<ukl<dfo I wanted to add a language that wasn't already included... DROL is a limited instruction assembler-like language with only two registers as storage. The language does include numbers, so it think it qualifies for this question. But numbers are only used for loop length indicators, as well as being used as the name of some instructions. It's described on the Esolang Wiki DROL page. Here's a rundown of what the code does: z set R1=0 ii increment R1 by 1 twice (2) ll square R1 three two (16) < shift left R1 (32) u set R2=R1 (32) k increment R2 (33) l square R1 (1024) < shift left R1 (2048) d decrement R1 (2047) f subtract R1 = R1 - R2 (2014) o print R1 as an integer # Kotlin, 42 bytes fun main()=print("ް.".map{it.code}.sum()) I used U+1968 which is ް and a . which is U+46. # Phooey, 16 bytes =@+$i>$i=$i<@+$i Try it online! # Stk Tape =@+$i>$i=$i<@+$i # (0) >0 0 (initial state) = # (0) >1 0 tape = stack == tape to get 1 @ # 1 >1 0 push to stack + # (0) >2 0 pop; add stack to tape$i            # (0) >2  0   print tape as integer (2)
>$i # (0) 2 >0 move tape ptr right, print (0) =$i      # (0)  2 >1   same as above to get 1 again, print (1)
<@    #  2  >2  1   move back, push
+$i # (0) >4 1 add stack to tape, print (4) Thank goodness for Phooey's = operator. This would be impossible in Foo. # Phooey, 23 19 bytes This version actually generates the number 2014 instead of printing 2,0,1, and 4. =@+@@@+@**@@*@+--$i

Try it online!

# stack       | tape
=@+@@@+@**@@*@+--$i # (0) | 0 initial state = # (0) | 1 tape = tape == pop() (to get 1) @+ # (0) | 2 double by adding to self @@ # 2 2 | 2 push two copies to the stack @+ # 2 2 | 4 double @* # 2 2 | 16 square by multiplying by self * # 2 | 32 multiply by 2 @ # 2 32 | 32 push 32 for later @* # 2 32 | 1024 square @+ # 2 32 | 2048 double - # 2 | 2016 pop and subtract - # (0) | 2014 pop and subtract$i #         (0) | 2014  print 2014

# ARM assembly, 94 85 bytes (28 bytes compiled)

Textual assembly for ARM mode.

s:subs sb,sb
lsl sl,sb,sb
rsb sb,sl,lsl sl
bx lr

A function which returns 2014 in sb (r9)

Clobbers sl (r10) and sb (r9).

Expanded version:

// It feels so empty here...
.globl s
s:
// use the quirky way subs affects the flags
// to set r9 to 1
subs    r9, r9, r9
// double r9 by adding it to itself
// lsl works just as well
// r9 = 2
// r10 = r9 << r9
// r10 = 2 << 2
// r10 = 8
lsl     r10, r9, r9
// r9 = r9 + (r10 << r9)
// r9 = 2 + (8 << 2)
// r9 = 2 + 32
// r9 = 34
add     r9, r9, r10, lsl r9
// r9 = (r10 << r10) - r9
// r9 = (8 << 8) - 34
// r9 = 2048 - 34
// r9 = 2014
rsb     r9, r9, r10, lsl r10
// Return
bx      lr

This uses the same idea as my Phooey answer, of generating 2048, then subtracting 34. While I do have access to push and pop, ARM isn't a stack machine. It is a register machine. Additionally, we have lsl for shifting left which makes a few cases easier.

It is yet another rare case where the inverted carry flag on ARM is useful for something other than 64-bit subtraction, as it allows us to set a register to 1 when combined with adc.

Additionally, this only works in ARM mode: Thumb-2 did not show the return of shifting by register (which kinda was a dumb waste of encoding bits)

It uses the classic register names instead of the format which is r[0-15].

print(ord('ߞ'))

Try it online!

# Vyxal, 10 3 bytes

»÷∩

Try it Online!

Simply the compressed number 2014

• Can't be bothered to download the interpreter, but does !!!!!''.\$... work for 11 bytes? – Jo King Oct 9 '20 at 4:29

# Scratch, 82 bytes

when gf clicked
say(join(length of[The year two thousnd])(length of[and   fourteen
• Happy 2021! Scratch solutions make me happy though so take your upvote :P – Citty Apr 13 at 13:04
• Out of almost 300 answers, I was surprised that nobody had done Scratch yet! – Nilster Apr 13 at 13:08

# Grok, 13 bytes

iNHI:P-zP-zq

i:H:N-Yx-zZq

# Branch, 11 bytes

}}#/#}#^}}#

Try it on the online Branch interpreter!

Branch does have numbers in it. } is increment and { is decrement. # outputs as number. / goes to the left child, which is automatically initialized to 0, which is shorter than {{. Finally, ^ goes to the parent, which is 2 when that command is called. Actually, since the current node is 1, and the parent is 2, we could do ^}} or }}} to get 4.

An alternative solution that produces 2014 on the tree itself instead of outputting it character by character:

# Branch, 50 bytes

}}^\}}}}}^*^\}}^*{^\}}^*^\/}}}}}}^\}}}}}}}}}^*{^*#

Try it on the online Branch interpreter!

iioddoioiiio

Try it online!

This, this is surprisingly short!

• save bytes by squaring instead of incrementing twice at the end – Recursive Co. Apr 24 at 15:21
• This can just be vanilla deadfish, since you don't use ch{}(). Also, iiio can be replaced with iso for 11 bytes. – A username Apr 25 at 22:32
• And you can get the number 2014: iiisddsddddsdddddddddddo but that's a bit long. – A username Apr 25 at 22:34

Objective C

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy"];
NSLog(@"%@",[formatter stringFromDate:[NSDate date]]);
• From the comments: Gelatin: “Is it acceptable to use the current year?” Joe Z.: “No, it has to be 2014 exactly.” – manatwork Jan 1 '14 at 13:17
• Because the question is a code-golf question, please add the character count. – ProgramFOX Jan 1 '14 at 13:31
• What happened to you, Smalltalk ? You look...different. – bug Jan 7 '14 at 1:17
• NSLog(@"%i",'&'*('F'-'A')); – Albert Renshaw Feb 16 '17 at 18:57
• @Cœur sorry meant this NSLog(@"%i",'&'*('V'-'!')); – Albert Renshaw Mar 17 '18 at 20:08

# Perl, 24 bytes

print-ord(A)+ord for U,O

Pure ascii, no nonprinting characters or utf8-only characters used. Uses the 21st and 15th letters of the alphabet to print 20, 14.