# 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

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

ë‘"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

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

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 adc sb,sb add sb,sb lsl sl,sb,sb add sb,sl,lsl 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 adc r9, r9, r9 // double r9 by adding it to itself // lsl works just as well // r9 = 2 add r9, r9, r9 // 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]. # Python 3, 16 bytes print(ord('ߞ')) Try it online! # 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 # CSASM v2.4.0.2, 83 bytes func main: push " " len print push "" len print push " " len print push " " len print ret end The only way to push numbers to the stack without using numbers is to create str instances and then get their lengths. # Hexagony, 3 bytes ߞ! Try it online! Or if you prefer code that terminates, here's 4 bytes: ߞ!@ 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. ### C# (56 characters) Class P{static void Main(){Console.Write(','*','+'N');}} • This doesn't print anything. – shamp00 Jan 5 '14 at 15:05 • 26 characters = 4 bytes?? I don't think so... – jub0bs Jan 6 '14 at 12:24 • Sorry. I just included the logic only. Now I included the whole program. – Merin Nakarmi Jan 7 '14 at 3:34 • You need System.Console to use Console. – shamp00 Jan 8 '14 at 14:24 • using System; will be on the header. So.... – Merin Nakarmi Jan 8 '14 at 17:50 BAT (windows batch), 7 characters echo %* save as a.bat and invoke as a 2014 is there any restriction on using command line parameters? – Einacio I don't think so, but echo$1 still has a number in it. – Joe Z.

not a so valid answer, but noone was posting an answer in this wonderful language

• Does BAT have an equivalent to sh’s $@ for “all parameters”? – Zev Eisenberg Jan 10 '14 at 23:29 • @ZevEisenberg that's what i used, altought it seems someone didn't like it – Einacio Jan 13 '14 at 15:14 PHP (27) - not shortest ASCII PHP but more readable <?=hexdec($e=hexdec(E)).\$e;

# Bat (Windows batch), 13 bytes (characters)

echo.^T |od -x

(^T is one character.)

# Bash, 15 bytes

echo "^T "|od -x

(^T is one character.)

• How about: printf %x \'— 13 characters. – Isaac Aug 30 '19 at 22:26