579
\$\begingroup\$

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

\$\endgroup\$
  • 10
    \$\begingroup\$ Even though numbers are ignored in brainfuck, I thought I'd post one anyway. 32 Chars: ++++++[>++++++++<-]>++.--.+.+++. \$\endgroup\$ – Braden Best Apr 1 '15 at 21:37
  • 4
    \$\begingroup\$ Brainfuck isn't a valid language for this challenge. \$\endgroup\$ – Joe Z. Apr 1 '15 at 22:49
  • 8
    \$\begingroup\$ I wonder if this question gets a small spike in popularity around New Year's. \$\endgroup\$ – Joe Z. Dec 26 '15 at 23:28
  • 3
    \$\begingroup\$ Waiting for "Come on folks, don't you realize it's 2016?" :) \$\endgroup\$ – padawan Jan 4 '16 at 23:35
  • 1
    \$\begingroup\$ @BradenBest It's possible to do it in 31 characters in at least two different ways: +++++++[>+++++++<-]>+.--.+.+++. and ++++++++++[>+++++<-]>.--.+.+++. \$\endgroup\$ – Zubin Mukerjee Feb 21 '16 at 17:47

274 Answers 274

4
\$\begingroup\$

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);
\$\endgroup\$
  • \$\begingroup\$ <?= echo date('Y') ?> \$\endgroup\$ – Surabhil Sergy Jan 7 '14 at 11:37
  • 1
    \$\begingroup\$ @SurabhilSergy that is not a valid answer, the output will change in 2015. \$\endgroup\$ – zamnuts Jan 7 '14 at 22:44
4
\$\begingroup\$

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.

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

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

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

Bash 28

echo $((`printf %d \':`#yG))

Similar to the Ruby and Python solutions, but uses base62, now without literal 6 and 2 (but pretty long...)! Using base58 as recommended by @DigitalTrauma along with removing quotes around the printf format string, Thanks!

Better 17 (Thanks @user13955 and @DigitalTrauma!)

tr a-l /-:<<<dbcf

"It's shorthand for tr abcdefghijkl /0123456789:. Not very geeky, I'm afraid." -user13955 Also updated to use a heredoc instead of echo, thanks @DigitalTrauma!

\$\endgroup\$
  • 3
    \$\begingroup\$ Not a valid solution since 2 and 6 are forbidden. \$\endgroup\$ – jub0bs Jan 1 '14 at 12:32
  • 1
    \$\begingroup\$ user13955 suggested this edit, might be worth considering: echo dbcf|tr a-l /-: It's shorthand for tr abcdefghijkl /0123456789:. Not very geeky, I'm afraid. \$\endgroup\$ – Justin Jan 7 '14 at 8:18
  • 1
    \$\begingroup\$ Pure bash|ksh 110 bytes: sum(){ (IFS=+;echo $(($*)));}&&d(){ echo $((n=n+n));}&&false||n=$?&&sum $(d;d;d;d;echo $((n=n+n+n+n));d;d;d;d) \$\endgroup\$ – Henk Langeveld Jan 8 '14 at 2:38
  • 1
    \$\begingroup\$ I verified that the unicode solution works in ksh93. \$\endgroup\$ – Henk Langeveld Jan 8 '14 at 2:46
  • 2
    \$\begingroup\$ @DigitalTrauma Pure bash 18: echo $[$[$#xd]#bbc] ... without fork! \$\endgroup\$ – F. Hauri Apr 16 '14 at 22:23
4
\$\begingroup\$

TI-Basic, 49 41 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
\$\endgroup\$
  • \$\begingroup\$ I'm up voting on the assumption this works; I have no way to test it. \$\endgroup\$ – Michael Stern Jan 3 '14 at 12:59
  • \$\begingroup\$ @MichaelStern Explanation added :) \$\endgroup\$ – Timtech Jan 3 '14 at 15:22
  • \$\begingroup\$ :π/π+π/π→B:B^B^B→C:Disp C^C*(C/B)-C*B-B would be 2 characters shorter. \$\endgroup\$ – Michael Madsen Jan 8 '14 at 11:02
  • \$\begingroup\$ @MichaelMadsen Thanks, updated! \$\endgroup\$ – Timtech Jan 8 '14 at 11:49
  • \$\begingroup\$ 8 bytes can be saved with various tweaks: iPart(e→B:BBBB:Ans^B(Ans/B)-AnsB-B \$\endgroup\$ – Khuldraeseth na'Barya Nov 18 '17 at 20:12
4
\$\begingroup\$

Japt, 3 bytes (2 chars)

Japt is newer than this competition (created in 2015), but was not created specifically to answer it.

That's right. 2 chars. Explanation:

#   // Char-code of next character
 ߞ  // Character with char-code of 2014
    // Implicit output

Try it online!

\$\endgroup\$
  • \$\begingroup\$ Does this mean I can undelete my Microscript answer? \$\endgroup\$ – SuperJedi224 Dec 9 '15 at 2:25
  • \$\begingroup\$ @SuperJedi224 There's a list in the main post of "invalid but interesting answers". I think newer languages fall into this category. \$\endgroup\$ – ETHproductions Dec 9 '15 at 2:31
4
\$\begingroup\$

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.

enter image description here

\$\endgroup\$
  • 5
    \$\begingroup\$ If you change the size to Word, it will be an almost-valid answer that will output only 2014 \$\endgroup\$ – Ismael Miguel Jan 9 '15 at 11:49
  • \$\begingroup\$ I don't think this is a programming language... \$\endgroup\$ – cat Apr 7 '16 at 14:40
4
\$\begingroup\$

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.

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

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

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

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

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

Emotinomicon, 14 bytes

😭ߞ😲😨

Explanation:

😭  ߞ   😲  😨  explanation
😭              begin quote string
    ߞ           
        😲      end quote string
            😨  pop N and output as a number

ߞ is U+7DE. 0x7DE is 2014.

\$\endgroup\$
  • \$\begingroup\$ Okay, thanks! In your code, do you convert the quote string to a number when it's outputting? \$\endgroup\$ – MilkyWay90 May 25 at 15:05
  • \$\begingroup\$ @MilkyWay90 Emotinomicon pushes the character code of each character in the string. \$\endgroup\$ – Erik the Outgolfer May 25 at 15:07
3
\$\begingroup\$

C, 37 Characters

main(){printf("%d%d",'d'-'P','\xE');}
\$\endgroup\$
  • \$\begingroup\$ You could knock off 3 bytes by renaming main to f since we don't require main to be used. \$\endgroup\$ – MD XF May 12 '17 at 19:51
3
\$\begingroup\$

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]
\$\endgroup\$
  • 1
    \$\begingroup\$ That doesn't use ASCII? That's a bit hard. \$\endgroup\$ – Joe Z. Jan 7 '14 at 2:04
  • \$\begingroup\$ @JoeZ. My program would work just as well if the system used ebcdic. And as you know, a multitude of ebcdic systems use bash. :-) \$\endgroup\$ – Stephen Montgomery-Smith Jan 7 '14 at 3:20
  • \$\begingroup\$ Maybe 34 bytes: :;y=$[x=!$?,x+x];echo $y$?$x$[y+y] Try it online! \$\endgroup\$ – Isaac Aug 29 at 20:32
  • \$\begingroup\$ Hmmm, Just 29 bytes: echo $[x=y=!x,y+=y]$?$x$[y+y] Try it online! \$\endgroup\$ – Isaac Aug 29 at 21:04
3
\$\begingroup\$

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

C# - 64 chars

class P{static void Main(){System.Console.Write('!'*'>'-' ');}}

pretty printed

class P 
{ 
    static void Main() 
    { 
        System.Console.Write('!' * '>' - ' ');
    } 
}
\$\endgroup\$
  • \$\begingroup\$ What if we use class P { static void Main() { System.Console.Write(2014); } } \$\endgroup\$ – Amit Ranjan Jan 7 '14 at 6:55
  • \$\begingroup\$ @Amit, you can't use numbers in this challenge... \$\endgroup\$ – shamp00 Jan 7 '14 at 9:10
  • 2
    \$\begingroup\$ if an exit code is acceptable class a{static int Main(){return '!'*'>'-' ';}} is just 47 chars. \$\endgroup\$ – Jodrell Jan 7 '14 at 12:05
  • 1
    \$\begingroup\$ I like this one, my countdown numbers skills sucked so I ended up with ('d' + 'e').ToString() + Math.Ceiling(Math.PI); \$\endgroup\$ – NibblyPig Jan 8 '14 at 15:02
3
\$\begingroup\$

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
\$\endgroup\$
  • 1
    \$\begingroup\$ I think it shouldn't have any characters [0..9] in your code \$\endgroup\$ – Teun Pronk Jan 31 '14 at 14:56
  • \$\begingroup\$ @TeunPronk but that's the generation code, not the submission -- the submission is the binary \$\endgroup\$ – cat Apr 15 '16 at 23:47
3
\$\begingroup\$

Sclipting, 3 characters (6 bytes)

This outputs the string "2014".

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

Pure bash 18

Without fork!

echo $[$[$#xd]#bbc]
2014
\$\endgroup\$
  • 1
    \$\begingroup\$ How about: printf %x \'— Just 13 characters (15 bytes). \$\endgroup\$ – Isaac Aug 30 at 22:18
  • \$\begingroup\$ @Isaac Awesome! I learn today this printf %d \'A newer seen before! \$\endgroup\$ – F. Hauri Aug 31 at 7:41
3
\$\begingroup\$

Pyth, 4 bytes

C"ߞ

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

\$\endgroup\$
  • \$\begingroup\$ 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. \$\endgroup\$ – Joe Z. Jul 8 '14 at 11:08
  • \$\begingroup\$ @JoeZ. I understand. No worries, the rules make sense. \$\endgroup\$ – isaacg Jul 8 '14 at 15:50
3
\$\begingroup\$

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]
\$\endgroup\$
  • \$\begingroup\$ +1 for the first non-cheating program in this question that doesn't depend on ASCII or UTF-8 (unless I missed something) \$\endgroup\$ – Konrad Borowski Jan 1 '14 at 21:54
  • \$\begingroup\$ 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. \$\endgroup\$ – WolframH Jan 15 '14 at 0:12
  • \$\begingroup\$ @WolframH Noted. I'll update it later. \$\endgroup\$ – nyuszika7h Jan 21 '14 at 21:49
3
\$\begingroup\$

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.

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

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)
\$\endgroup\$
  • \$\begingroup\$ 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. \$\endgroup\$ – Michael Stern Jan 2 '14 at 22:46
  • \$\begingroup\$ Just playing around, maybe five minutes, probably less. I’m pretty sure this is far from the most compact formula. \$\endgroup\$ – Christopher Creutzig Jan 3 '14 at 13:13
3
\$\begingroup\$

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.

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

C++, 50 bytes

#include<iostream>
int main(){std::cout<<'U'^'A';}
\$\endgroup\$
  • \$\begingroup\$ You should provide compile-ready code in C++. \$\endgroup\$ – Joe Z. Jan 1 '14 at 5:24
  • \$\begingroup\$ Also, use four spaces before each line for blocks of code. \$\endgroup\$ – Joe Z. Jan 1 '14 at 5:29
  • \$\begingroup\$ i added "iostrean but it disappeared, actually am new so don't know how to" \$\endgroup\$ – zeeshan mughal Jan 1 '14 at 5:29
  • 5
    \$\begingroup\$ This is supposed to be code golf, i.e. shortest code possible. Remove unnecessary whitespace, etc \$\endgroup\$ – Doorknob Jan 1 '14 at 5:32
  • \$\begingroup\$ @DoorknobofSnow thanx, after your edition i can still see few extra spaces \$\endgroup\$ – zeeshan mughal Jan 1 '14 at 5:34
3
\$\begingroup\$

Java 8, 33 bytes

()->Integer.parseInt("bbc",'\r');
\$\endgroup\$
3
\$\begingroup\$

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

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

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

╔═╗ ╔═╗ ╗ ╦ ╦
  ║ ║ ║ ║ ║ ║
╔═╝ ║ ║ ║ ╚═╣
║   ║ ║ ║   ║
╚═╝ ╚═╝ ╩   ╩
\$\endgroup\$
  • \$\begingroup\$ You could shorten all your mains to f, saving 3 bytes each, and your submission will still be valid. \$\endgroup\$ – MD XF May 12 '17 at 19:53
3
\$\begingroup\$

Jelly, 3 bytes

⁽¥Æ

Try it online!

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

Racket, 18 bytes

(~a(+ #xa #xa)#xe)
\$\endgroup\$
3
\$\begingroup\$

Clojure, 9 bytes

Inspired by the Matlab answer, converts char \u075e to an int:

(int \ߞ)
\$\endgroup\$

protected by Community Jan 14 at 6:34

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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