text:
Import this into your own language
The Zen of Python must surely be one of the most beautiful Easter eggs in any language. (It is created by writing import this)
So why not create a version for your own language?
For those who don't have access to Python 2 or 3, your code should output the following:
The Zen of [YOUR LANGUAGE]

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

The original was The Zen of Python, by Tim Peters.
This is code-golf, so the shortest answer in bytes wins.
Standard loopholes apply, this includes no built-ins (if you are making a solution in Python, Pyth or another derivative of Python, the equivalent of import this is forbidden).

This is my first question, so please tell me whether it is good or not.

@DJMcMayhem clearly, the solution here is to rename yourself :)

Even with the language and username fields, this challenge is still just printing a large, static block of text, which means it's a dupe of the rickroll challenge.

@DJMcMayhem I have removed the username part of the challenge.

I argue that this isn't just a duplicate because it is relevant to coding.

It is very similar in spirit to the rickroll, but I don't see why it couldn't stay open. I know we've been closing challenges as dupes of the rickroll for years, but I think it's kinda getting ridiculous. I want to leave it open.

If this question is closed as a duplicate, I think that there should be some way for new PPCG users to find these questions, as I couldn't find anything with a search.

@boboquack there is the sandbox to get feedback on your ideas for challenges.

For KC questions in particular, a search is going to be hard, since while the words printed may not be the same, the underlying challenge often is. In addition to the sandbox (suggested by Jonathan), you can also browse the top voted Kolmogorov complexity challenges to get a (very brief) overview of the kinds of things that have been done.

Thank you @JonathanAllan I wasn't aware of this at the time.

JavaScript (ES6) 665 bytes
f=a=>{for(_="._eds  ieaouobvishld itxplicpecial  idonesaty ennever th    to mplbetter   an explain, e Althgh If iemti`ThZ of JS__ButifuluglyEiicSiecoexCoexcoicFlntSparsedseRdabilcntsScas ar't sghbrk  rulpracticalbepuryError passiltlyUnlelsilcIn    facof ambiguy, refusthtemptigusTherbe-- and preferabll--waydo th wamanot b first unly'rDutchNowoft *right* nowhard'a badsy maba goodNampac arhking gre -- let'do morof  ose!`";G=/[-]/.exec(_);)with(_.split(G))_=join(shift());return eval(_).split`_`.join`
`}

Because of string compression, some characters cannot be displayed in this snippet. This is above script hex-encoded:
663D613D3E7B666F72285F3D222E5F1D65641D1C73201B20691B1A6561196F75186F627669181B177368186C64201669741578706C6963151470656369616C201320696419126F6E1165731061740F79200E656E0C6E657665720B2074680920746F20086D706C0762657474657209616E2006086578706C61696E2C2015056520041D416C746818676820031D496609046907656D0C740F69111A021A0601605468045A0C206F66204A535F5F421975746966756C0175676C791D45140169076963151D5369076501636F0765781D436F07657801636F0769630F1C466C0F016E10741C53706172736501640C73651D5219646162696C150E63186E74731D5313636173102061720C27742073130C186768086272196B090472756C100370726163746963616C150E62650F1B70757215791D4572726F721B160B207061731B73696C0C746C791D556E6C101B65146C0E73696C0C631C496E0904666163046F6620616D6269677515792C2072656675730474680474656D70740F691108677510731D546865720416620411652D2D20616E642070726566657261626C0E116C0E11042D2D1777617908646F20150374680F2077610E6D610E6E6F74206204170F20666972737420756E6C101B791827720444757463681D4E6F77010B030B1A6F66740C20062A72696768742A206E6F77026861726405271B6120626164120219737905206D610E62046120676F6F64121D4E616D107061631020617204110468116B696E67206772650F12202D2D206C6574271B646F206D6F72046F66096F73652160223B473D2F5B012D1D5D2F2E65786563285F293B2977697468285F2E73706C6974284729295F3D6A6F696E2873686966742829293B72657475726E206576616C285F292E73706C6974605F602E6A6F696E600D0A607D

It can be compiled using the following function:
f=a=>eval(a.match(/../g).map(a=>String.fromCharCode(parseInt(a,16))).join``)

Demo


text:
Draw an ASCII-O'-Lantern for Halloween
Halloween is almost here, the holiday after which most people need to wean themselves off a hollow diet of sugar.
Write a program that takes in a positive integer. If the integer is less than 31 (1 through 30), output this ASCII-art jack-o'-lantern, looking to the right as if looking forward to Halloween:
 _____I_____
| | | | | | |
| | |^| |^| |
| | | |^| | |
| | |VvVvV| |
|_|_|_|_|_|_|

If the input is 31 (the October date Halloween is on), output the same ASCII-o'-lantern, but looking left:
 _____I_____
| | | | | | |
| |^| |^| | |
| | |^| | | |
| |VvVvV| | |
|_|_|_|_|_|_|

If the input is greater than 31, output a bloated-looking ASCII-o'-lantern who probably ate too much candy. He can face either left or right since queasyness can be disorientating. So output:
 _____I_____
| | | | | | |
| |o| |o| | |
| | |^| | | |
| |XXXXX| | |
|_|_|_|_|_|_|

or
 _____I_____
| | | | | | |
| | |o| |o| |
| | | |^| | |
| | |XXXXX| |
|_|_|_|_|_|_|

Whichever you prefer. It may even be different for different numbers above 31.
The shortest code in bytes wins.

아희(Aheui), 914 bytes
붕빠뿌빠삮빠싸빠받따싼사주따반따퍄속맣이
숚뽀빠소뚜번범뻐터번선야챠슊산받발따다뿌
분뽀더번투빠뿌삮뿌다뿌쑬섣뽀빠뼈ㅇ뚜범쑬
받발따또싾솒빠쏟싿솓아삲쏠쑧뽀터벋터볼설
뿌뻐뻐뻐선썬뻐퍼섟썫선뻐퍼샧셗뺘쎣뺘뼈선
받따반타파빠빠받따받반타타싾삲빠빠빠빠뿌
숟썭뻐선썭뻐섣썭뻐선썭뻐섣썯터범떠범뻐선
빠싽술빠싽산빠싽삳빠싽숟삮쎨뿌서탸쥬싸셔
쀼이썭솓쀼섣싻이연우섞빠쏠뱐선반노쌹뻐숛
손빠쓞유삯쏢으산뽀쌹쏡야뼈섣싺이셗처솓썱
아솓썲솑쏢삱쏜빠쌄숞뚜범범섩뻐분터뿌뻐튜
번이손쎫ㅇ야샨우쌃이쀼뱔뿌떠뽀투또뿌뽀노
본떠벋뻐떠번떠숃볌쎬볌섩뿌빠뽀펴봄벌뽀뻐
샯이멓삭뭏ㅇㅇ이멓샥뎌뵥뿌븀범이멓삭뭏맣
맣이ㅇ몋섨희ㅇㅇㅇㅇㅇ먛뻐살뽀ㅇ솕멓샮속

Try it here! (please copy and paste the code manually)
Aheui might not be for golfing, but it's fun nonetheless. :)
Outputs:
N = 10
 _____I_____
| | | | | | |
| | |^| |^| |
| | | |^| | |
| | |VvVvV| |
|_|_|_|_|_|_|

N = 31
 _____I_____
| | | | | | |
| |^| |^| | |
| | |^| | | |
| |VvVvV| | |
|_|_|_|_|_|_|

N = 40
 _____I_____
| | | | | | |
| |o| |o| | |
| | |^| | | |
| |XXXXX| | |
|_|_|_|_|_|_|

JavaScript (ES6), 185 142 140 136 bytes
Now you can tweet-a-pumpkin!
n=>` _____I_____
0 4 1
02421
0 |^| 1
031
|_|_|_|_|_|_|`.replace(/\d/g,x=>x-2?x-3?x^n>30?"| |":"| | |":n>31?"XXXXX":"VvVvV":n>31?"o":"^")

Probably still room for improvement...

That x^n>30 trick had me confused at first but when I worked out what was going on I shamelessly stole it to improve my answer. As compensation I'm giving you an upvote for it anyway.

Jelly, 73 bytes
“ẋƥḷỊKNṇ&JƝ¡'Ɲṣ,c;|Ṙɗ.hṿ#⁴ɠ³Ṙṅ’b8ị“ I|o^Xv_”
<32ị“o^XV“vX”y¢s13µ¹U31=³¤?Y

Full program
TryItOnline!
Might be possible to golf this with the aid of bounce, ŒḄ.
How?
“ẋƥḷỊKNṇ&JƝ¡'Ɲṣ,c;|Ṙɗ.hṿ#⁴ɠ³Ṙṅ’b8ị“ I|o^Xv_” - Link 1, Jack construction
“ẋƥḷỊKNṇ&JƝ¡'Ɲṣ,c;|Ṙɗ.hṿ#⁴ɠ³Ṙṅ’              - a base 250 integer
                               b8            - convert to base 8
                                 ị           - index into
                                  “ I|o^Xv_” - literal " I|o^Xv_"
                                             - makes this, without the line feeds:
                                                _____I_____
                                               | | | | | | |
                                               | |o| |o| | |
                                               | | |^| | | |
                                               | |XvXvX| | |
                                               |_|_|_|_|_|_|

<32ị“o^XV“vX”y¢s13µ¹U31=³¤?Y - Main link: n
<32                          - 1 if n is less than 32 else 0
   ị                         - index into
    “o^XV“vX”                - list of strings, ["o^XV","vX"]
             y               - map those characters (o->^ and X->V OR v->X) in string:
              ¢              -    call last link (1) as a nilad
               s13           - split into chunks of length 13
                  µ          - monadic chain separation
                          ?  - ternary if:
                         ¤   -     nilad and links as a nilad
                     31=³    -         31 equals first argument
                   ¹         -     identity (do nothing if true)
                    U        -     upend (reverse each if false)
                           Y - join with line feeds

Ruby, 137 bytes
Face points left on and after the 31st.
->n{puts ' _____I_____',(0..4).map{|i|s=[?|]*7*' _'[i/4]
s[5-n/31*2,5]=' | | o| |o |^| VvVvV_|_|_'[i*5,5];s.tr('ovV','^vVoX'[n/32*3,3])}}

Ungolfed in test program
f=->n{
  puts ' _____I_____',                                #Draw top of pumpkin
  (0..4).map{|i|                                      #then 5 more lines
    s=[?|]*7*' _'[i/4]                                #of 7 | separated by space or _ .
    s[5-n/31*2,5]=' | | o| |o |^| VvVvV_|_|_'[i*5,5]  #Add a line of face with 'o' eyes and 'VvVvV' mouth.
    s.tr('ovV','^vVoX'[n/32*3,3])                     #Substitute characters as necessary.
  }
}

f[gets.to_i]

Charcoal, 71 bytes
ＮβＡ‹β³²τＡ§o^τεＡ§XVτφＡ§XvτθＦ³«Ｐ↑⁵|_»↑⁵←I←×_⁵‖Ｏ→↙↙←←ε↙←^↖↓ε↓→φθφθφ¿⁼β³¹‖←

Note: This code does not work in the most recent commit as of posting, because string indexing is broken. It should, however, work in this version from October 25. It also runs successfully on the version currently on Try It Online.
Explanation
Charcoal is a language designed for ASCII-art. Output is put onto a canvas, which is printed at the end of the program.
Setup
Get input and calculate face characters:
Ｎβ        Input number into beta
Ａ‹β³²τ    Assign beta<32 to tau for easy reuse
Ａ§o^τε    Assign appropriate eye character (selected via indexing into "o^") to epsilon
Ａ§XVτφ    Assign outside and middle mouth character to phi
Ａ§Xvτθ    Assign other mouth character to theta

Draw the pumpkin
Ｆ³«  »    Do this three times:
Ｐ↑⁵       Draw a 5-character line upward (using | by default); don't move the cursor
|_         Draw that string, rightward

After this loop, we have
| | |
| | |
| | |
| | |
|_|_|_

Next:
↑⁵         Draw a 5-character line upward
←I         Draw the stem leftward
←×_⁵       Draw 5 underscores leftward
‖Ｏ→       Reflect the canvas rightward, overlapping in the middle

Result:
 _____I_____
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
|_|_|_|_|_|_|

Draw the face
We will draw the face looking rightward and change it later if necessary.
↙↙←←ε      Move to the correct spot and draw the right eye (our right, pumpkin's left)
↙←^        Move to the correct spot and draw the nose
↖↓ε        Move to the correct spot and draw the left eye
↓→φθφθφ    Move to the correct spot and draw the mouth with alternating characters

Result (for input 31):
 _____I_____
| | | | | | |
| | |^| |^| |
| | | |^| | |
| | |VvVvV| |
|_|_|_|_|_|_|

Reflect if it's Halloween:
¿⁼β³¹      If beta equals 31:
‖←         Reflect canvas leftward

Final output:
 _____I_____
| | | | | | |
| |^| |^| | |
| | |^| | | |
| |VvVvV| | |
|_|_|_|_|_|_|

Pyth - 84 bytes
Manual base compression.
+dj\Im*5\_2Xjb@_MBsMc5@L"^|_V ve"jC"mËÝ8|0càvll+Ç²Sïë¬Ê"7qQ31"Vve"?>Q31"XXo""Vv^

Test Suite.

PHP, 178 176 171 bytes
$e="| | ";$b=($n=$argv[1]-31)?" |^":"^| ";$c=$n<1?VvVvV:XXXXX;$a=$n<1?$b:" |o";echo" _____I_____\n$e$e$e|\n| |$a|$a$e\n$e|$b$e|\n| |",$n?" |$c":"$c| ","$e\n|_|_|_|_|_|_|";

could save 5 bytes with physical linebreaks. Run with -r.

C++, 222 204 194 bytes
-18 bytes thanks to Kevin Cruijssen and -10 bytes for explicit top part
using S=std::string;S f(int n){char L[80],o=2*(n>30),i=-1;while(i++<80)L[i]=47<i&i<53?88:i%2?'|':i==20|i==24|i==36?n<32|i>35?94:'o':(i-o)%14?i-o<55?32:95:10;return" _____I_____ "+S(L+o,L+70+o);}

Ungolfed
#include <string>

using S=std::string;
S f(int n){
 char L[80];
 int o=2*(n>30);
 for (int i=0;i<80;i++){
  L[i]=
   (47<i && i<53) ?
   'X' :
   (
    (i%2) ?
    '|' :
    (
     i==20||i==24||i==36 ?
     (n<32||i>35?'^':'o') :
     ((i-o)%14?(i-o<55?' ':'_'):'\n')
    )
   );
 }
 return " _____I_____ " + S(L+o,L+70+o);
}

I've only programmed in C++ once many years ago so I can't really remember much of it, but are parenthesis mandatory for ternary checks? If not, you could remove a lot of them. Also, is it possible to change the && to & and || to |? As summary, does using S=std::string;S f(int n){char L[80],o=2*(n>30),i=-1;while(i++<80)L[i]=47<i&i<53?88:i%2?'|':i==20|i==24|i==36?n<32|i>35?94:'o':i-o%14?i-o<55?32:95:10;S t(5,95);return' '+t+'I'+t+' '+S(L+o,L+70+o);} (202 bytes) compile & run?

@KevinCruijssen Yes you are right. Only the parenthesis around i-o is mandatory, so 204 bytes,

PHP, 222 Bytes
for($s=" ".str_pad("I",11,_,2)." \n";$i<5;$i++)$s.=str_pad("",13,$i<4?"| ":"|_")."\n";$p=($a=$argv[1])<31||!($a%2)?2:0;$s=substr_replace($s,$a>31?XXXXX:VvVvV,$p+59,5);$s[$p+31]=$s[$p+35]=($a>31?o:"^");$s[$p+47]="^";echo$s;

Output
input:29
 _____I_____
| | | | | | |
| | |^| |^| |
| | | |^| | |
| | |VvVvV| |
|_|_|_|_|_|_|

input:30
 _____I_____
| | | | | | |
| | |^| |^| |
| | | |^| | |
| | |VvVvV| |
|_|_|_|_|_|_|

input:31
 _____I_____
| | | | | | |
| |^| |^| | |
| | |^| | | |
| |VvVvV| | |
|_|_|_|_|_|_|

input:32
 _____I_____
| | | | | | |
| | |o| |o| |
| | | |^| | |
| | |XXXXX| |
|_|_|_|_|_|_|

input:33
 _____I_____
| | | | | | |
| |o| |o| | |
| | |^| | | |
| |XXXXX| | |
|_|_|_|_|_|_|

input:34
 _____I_____
| | | | | | |
| | |o| |o| |
| | | |^| | |
| | |XXXXX| |
|_|_|_|_|_|_|

input:35
 _____I_____
| | | | | | |
| |o| |o| | |
| | |^| | | |
| |XXXXX| | |
|_|_|_|_|_|_|

JavaScript (ES6), 163 125 bytes

f=
n=>` _____I_____
3 5 4
30504
3 |^| 4
3121214
|_|_|_|_|_|_|`.replace(/\d/g,c=>(n>31?`oXX`:`^Vv`)[c]||(c-3^n>30?`| |`:`| | |`))
;
<input type=number oninput=o.textContent=f(this.value)><pre id=o>

Now shamelessly stealing @ETHproduction's trick for positioning the face. Encoding: 0 is an eye, 1 and 2 are teeth, 3 is the left side, 4 is the right side and 5 is the bridge of the nose.

V, 97 bytes
é|6i| Y5PÒ_r $.7|rIGÓ /_
3G3f r^jll.kll.5G3f RVvVvVLá
Àé*ñ30|l2GGkld$PñGñ31|l3GÓÞ/o
5GÓãv/XñÍª

Try it online!
I'm dissapointed with how long this turned out. It is more convoluted than usual since V can barely handle numbers, a lot of bytes come from creating hacky conditionals. I would post a detailed explanation, but it took a long time to come up with, so I might get around to it later. Here is a hexdump:
0000000: e97c 3669 7c20 1b59 3550 d25f 7220 242e  .|6i| .Y5P._r $.
0000010: 377c 7249 47d3 202f 5f0a 3347 3366 2072  7|rIG. /_.3G3f r
0000020: 5e6a 6c6c 2e6b 6c6c 2e35 4733 6620 5256  ^jll.kll.5G3f RV
0000030: 7656 7656 1b4c e10a c0e9 2af1 3330 7c6c  vVvV.L....*.30|l
0000040: 3247 1647 6b6c 6424 50f1 47f1 3331 7c6c  2G.Gkld$P.G.31|l
0000050: 3347 d3de 2f6f 0a35 47d3 e376 2f58 f1cd  3G../o.5G..v/X..
0000060: aa                                       .

FYI this will run very slowly. It will take about 10 seconds. I know why this happens, and I'm looking into fixes.

Pyth, 76 bytes
+dX*11\_5\IjbmX.<.[14d"| "yqQ31<G3?>Q31"XXo""Vv^"c"
|c| |c
|^
|ababa"bt*7"_|

Try it online.
Uses no compression. (I tried using some to a version of the face data string, but it ended up the same length.)

Java 7, 237 bytes
String c(int n){char a=n==31?94:n>31?'o':32,b=n<31?'^':32;return(" _____I_____ \n~~~~~~|\n~|"+a+"|"+b+"|"+a+"|"+b+"~|\n~~|"+(n>31?94:a)+"|"+b+"~~|\n~"+(n<31?"~|VvVvV|":n==31?"|VvVvV~|":"|XXXXX~|")+" |\n|_|_|_|_|_|_|").replace("~","| ");}

Ungolfed & test code:
Try it here.
class M{
  static String c(int n){
    char a = n == 31
              ? 94
              : n > 31
                 ? 'o'
                 : 32,
         b = n < 31
              ? '^'
              : 32;
    return (" _____I_____ \n~~~~~~|\n~|"+a+"|"+b+"|"+a+"|"+b+"~|\n~~|"
        +(n > 31
           ? 94
           :a)
        +"|"+b+"~~|\n~"
        +(n < 31
           ? "~|VvVvV|"
           : n == 31
              ? "|VvVvV~|"
              : "|XXXXX~|")
        +" |\n|_|_|_|_|_|_|")
      .replace("~", "| ");
  }

  public static void main(String[] a){
    System.out.println(c(12));
    System.out.println();
    System.out.println(c(31));
    System.out.println();
    System.out.println(c(100));
  }
}

Output:
 _____I_____
| | | | | | |
| | |^| |^| |
| | | |^| | |
| | |VvVvV| |
|_|_|_|_|_|_|

 _____I_____
| | | | | | |
| |^| |^| | |
| | |^| | | |
| |VvVvV| | |
|_|_|_|_|_|_|

 _____I_____
| | | | | | |
| |o| |o| | |
| | |^| | | |
| |XXXXX| | |
|_|_|_|_|_|_|

Isn't your golfed code only a function, not a full program?

ETHproductions's JavaScript solution is only a function, I don't see why it would be different for Java

Groovy Script, 273 265 216 202 198 bytes
i=args[0]as int
a=i<32?'^| |^':'o| |o'
b=i<32?'VvVvV':'XXXXX'
j=i>30
print" _____I_____\n| | | | | | |\n| |${j?"$a| ":" |$a"}| |\n| | |${j?'^| ':' |^'}| | |\n| |${j?"$b| ":" |$b"}| |\n|_|_|_|_|_|_|"

Ungolfed version
i = args[0] as int
a = i < 32 ? '^| |^' : 'o| |o'
b = i < 32 ? 'VvVvV' : 'XXXXX'
j = i > 30
print """ _____I_____
| | | | | | |
| |${j ? "$a| " : " |$a"}| |
| | |${j ? '^| ' : ' |^'}| | |
| |${j ? "$b| " : " |$b"}| |
|_|_|_|_|_|_|"""

Try it here
Edit
As Titus mentioned, I can save some size with i < 32 instead of i in 1..31
Edit 2
Removed all possible spaces around operators... Forgot to do so in the beginning
Edit 3
Rewrote ternary conditions to use the saved variable, replaced ; with newlines, removed explicit variable definition
Edit 4
As Otávio mentioned, I can save another 4 bytes if I switch from | |${j ? ' |^| | ' : ' | |^| '}| | to | | |${j ? '^| ' : ' |^'}| | |

How about i < 32 instead of i in 1..31?

You can't get rid of the spaces around the operators?

Yes, I can... Totally forgot about this, thank you

As Groovy statements can be separated either by newline or ; and both are 1 character long, I would suggest to prefer the newline for readability. And give up with good coding habits, get rid of those int and def.

In print's 1st ternary save the condition in a variable as (j=i>30), then in the next 2 use just j instead of repeating the same i>30 condition.

You can save 4 bytes by changing the line | |${j ? ' |^| | ' : ' | |^| '}| | to | | |${j ? '^| ' : ' |^'}| | |

You can do 'X'*5 for the mouth, probably for other repetition cases too.

Python 2, 167 bytes
i=input()
b='| |';e='^o'[i>31]+b;print'\n'.join(x[::[1,-1][i>30]]for x in[' _____I_____ ','| '*5+b,b+' |'+e+e,b+' | |^| '+b,b+' |'+['VvVvV','X'*5][i>31]+b,'|_'*6+'|'])

Ruby, 168 bytes
->i{s=(Zlib.inflate Base64.decode64 "eJxTiAcBTzDJVaOABCG8OCiGycUhyYWVASGYF48EuRTwGhmHZkgckhzMQBKNzIdibEZGgAA2IwFZA1N4").lines;puts i<31?s[0..5]:i<32?s[6..11]:s[12..17]}

Probably far from optimal. Requires the base64 and zlib libraries.
Call as a lambda function.

C# 6, 223 215 bytes
int d=int.Parse(args[0]);var x="| | |\n| |";var s=d<31?" |^| |^| |\n| | | |^"+x+" |VvVvV":(d==31?"^| |^"+x+" |^| "+x+"VvVvV| ":"o| |o"+x+" |^| "+x+"XXXXX| ");Write(" _____I_____\n| | | | "+x+s+"| |\n|_|_|_|_|_|_|");
Entire program ungolfed:
using static System.Console;
namespace Halloween
{
    public class Program
    {
        public static void Main(string[] args)
        {
            int d = int.Parse(args[0]);
            var x = "| | |\n| |";
            var s = d < 31 ? " |^| |^| |\n| | | |^" + x + " |VvVvV"
                           : (d == 31 ? "^| |^" + x + " |^| " + x + "VvVvV| "
                                      : "o| |o" + x + " |^| " + x + "XXXXX| ");
            Write(" _____I_____\n| | | | " + x + s + "| |\n|_|_|_|_|_|_|");
        }
    }
}

This is just some code not a function or program, you can compile it to a Func<int, string> which is usually the shortest way of doing it.

I bet you can save some bytes by moving the conditions to the Write instead of declaring and defining s.

And why \r\n instead of just \n?

no one stops you to do it better

They are just helping you!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Print some JSON
This challenge is straightforward, but hopefully, there are plenty of avenues you can approach it:
You need to print/return a valid JSON object of at least 15 characters, not counting unessential whitespace.  Your program should work without any input.
In the interest of clarity, a JSON object starts and ends with curly braces {}, and contains zero or more key:value pairs separated by commas.  The full JSON specification can be found at json.org, and the output of your code must pass this validator.
Therefore, any of the following would not be valid:
4                               //Too short, not an object
"really, really long string"    //A string, not an object
["an","array","of","values"]    //An array is not a JSON object
{"this":4      }                //You can't count unessential whitespace
{"1":1,"2":3}                   //Too short
{"a really long string"}        //Not valid JSON, it needs a value
{'single-quoted':3}             //JSON requires double-quotes for strings

However, the following would be valid:
{"1":1,"2":2,"3":3,"4":4}       //Long enough
{"whitespace      ":4}          //This whitespace isn't unessential

Non-programming languages are allowed on this challenge.  You may return a string from a function, or print it out.  This is a code-golf, so answer it with as little code as possible!

I like the variety of answers on this one

Hmmmm, your definition of JSON is limited. What about code that ouputs valid JSON but does not output curly braces?

@Konijn like I said, it must be a valid JSON object.  The object is defined by the curly braces.

Got it, with stress on object ;)

What exactly counts as a JSON object, because the JS code _=>_={100:_} would return a valid JSON object, just not in a string. Don't forget to put f= before the code and call like f()

@Masterzagh Unfortunately, a native JS object doesn't count.  "You may return a string from a function, or print it out"

@NathanMerrill Oh I'm blind, sorry

Python 2, 14 bytes
print{`str`:1}

Outputs:
{"<type 'str'>": 1}

The backticks get the string representation in Python 2. Usually, this outputs inside creates single quotes, which Python recognizes as delimiting a string, but JSON doesn't. But Sp3000 observes that when stringifying a type, the type description already contains single quotes, which forces the outer quotes to be double quotes.

@Sp3000 That's beautiful in an awful way.

And I thought JS was the only language you can truly abuse type casting in...

same approach works for py3 with 20 bytes print({repr(str):1})

@dahrens for Py3: print({"'"*9:9}) for 16 (print{"'"*9:9} is another 14 in Py2)

\id`` is one shorter, and outputs more JSON

@pxeger id gives {'<built-in function id>': 1} which isn't valid json

jq, 6 characters
(3 characters code + 3 characters command-line option.)
env

CW because I am sure this is not the kind of answer you intended to allow.
Sample run:
bash-4.3$ jq -n 'env'
{
  "GIT_PS1_SHOWDIRTYSTATE": "1",
  "TERM": "xterm",
  "SHELL": "/bin/bash",
  "GIT_PS1_SHOWUNTRACKEDFILES": "1",
  "XTERM_LOCALE": "en_US.UTF-8",
  "XTERM_VERSION": "XTerm(322)",
  "GIT_PS1_SHOWSTASHSTATE": "1",
  "GIT_PS1_SHOWUPSTREAM": "auto",
  "_": "/usr/bin/jq"
}

(Output obviously shortened.)

This is definitely a valid submission (and no need to CW)

Also, http://meta.codegolf.stackexchange.com/questions/9688/how-should-community-wikis-be-used

Certainly valid. But I see no way to make a relevant comparison with any other solution, in this question's context. That is why I feel it should stand aside.

This counts as offloading the solution to a built in, which is almost a forbidden loophole. Keyword: almost

@JanDvorak It is not always a loophole, because there are cases where it is interesting to see a built-in used. This is one of them.

I won't do it against your explicit wishes, but I agree that this should be unwikied. Also, current consensus is that interpreter flags have to count the difference between invocation with and without the flag, so -n and a space account for three extra bytes.

@Dennis, I still feel this is an unfair competitor. But after all, I also feel is unfair to count a space used due to shell syntax, that never reaches the interpreter. Whatever.

Jelly, 11 bytes
“Ɠɼ'ẸẠḌȷżÑ»

Try it online!
Output
{"Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch":0}

Is that one word, or multiple? o_o

Not a rickroll.

It has 6 consonants in a row twice (pwllgw and bwllll).  What even is this?

How does this even work...

@Oliver it's a compression of the whole output string (everything between “ and »). The long Welsh place name is in the dictionary Jelly has. See section 3.1.2 of the tutorial

@StevenH. "W" is sometimes a vowel in Welsh (for example in crwth)

@StevenH. As Robert says, w can be a vowel in Welsh. As for the llll, I believe it is supposed to be parsed as l-ll-l, ll being considered as a single letter.

Is there really no word with shorter compressed output?

@ETHproductions Sure, but I need at least 9 letters to comply with the limit. All words with 6+ letters are in the long dictionary, so it doesn't really matter which one you pick.

@Fatalize. Welsh letters are interesting.

@Dennis. Also not a rickroll, but a song nonetheless.

Wait, Jelly has a built-in for this?

@TheBitByte why do we even have that lever?

Definitely +1 for the craziest label name I have ever seen. I'd hate to have to work with one of your web services.

Notepad, 7 keystrokes
If you have a Windows computer with the Notepad program, type this:
{"F5":0}
On my Windows 7 computer, at least, this gives you something like:
{"3:42 PM 10/25/2016":0}

A programming language?

@cat It's a program, not a programming language, but then again, I believe Vim is the same.

Well, Vim is a programming "language", both in that it fulfills PPCG rules (not Turing completeness) but also in Turing completeness (at least, I'm pretty sure)

You should ping @DJMCMayhem in chat to learn more, for they are a Vim wizard and I am merely a mortal onlooker.

@cat I see. I'm not sure if Notepad is Turing-complete. I doubt it, but perhaps; after all, /// has been proven so, and Notepad can pretty well recreate its single feature.

Vim is different from Notepad - you can save a script and run it within the editor. There is no such feature in Notepad. Thus, the features in Notepad (rudimentary search-and-replace, copying, and pasting) that allow it to be TC require navigating dialogs each time - which means more keystrokes.

@Mego Yes, I'm aware of that. It doesn't make it any less TC, but it does make it terrible for golfing any non-kolgomorov-complexity challenges...

@cat btw, the OP has explicitly allowed non-programming-language entries.

@ETHproductions This was never debated but I think that was added after my comment.

@cat Yeah, sorry, I meant it has been allowed since our discussion.

Based on memories of keyboard parsing from old DOS days, I suspect this should be counted as 8 bytes. There are two-byte encodings for F5 in many character sets designed for communicating keypresses to an application, and these are commonly seen on DOS (thus indirectly Windows), but I'm not aware of a character set that uses a one-byte encoding.

Is " 1 byte?

Java (JDK 10), 20 bytes
v->"{\"\":"+1/.3+"}"

Try it online!
Output
{"":3.3333333333333335}

Java is the last language I would expect to overload + to String.concat >:^(

@cat Yes, it's actually the only overload that exists. The thing is it doesn't even overload String.concat! If you check the bytecode, this is what Java compiles into: ()->new StringBuilder("{\"\":").append(1/.3).append("}").toString(). Also, don't worry, this is still the longest answer on this page, bar the Brainfuck one and the Java 7 one. So Java holds its rank ;)

JavaScript, 17 15 bytes
Thanks to @Neil for this one. Call with no input.
_=>`{"${_}":0}`

Outputs {"undefined":0}
Old version, 16 bytes
Thanks to @kamoroso94 for -1 on this version
_=>`{"":${9e9}}`

Outputs {"":9000000000}

You could turn this into an arrow function to remove 4 bytes.

Can you have an empty key? (e.g. remove a)

_=>\{"a":${_}}`results in{"a":undefined}`, which is exactly 15 characters. Noted that you don't use any input when calling this function

@BassdropCumberwubwubwub Coincidentally, your code is also 15 characters. I'm not sure that undefined is a valid value in JSON, but that's readily fixed by making it the property name and using a zero value: _=>\{"${_}":0}``.

Remove the a to make the key the empty string, a valid key in JSON.  1 less byte.

Does it have to be a function at all? Can't it just be the `{"":${9e9}}`.

How does this print out anything? It's a function that isn't being called. You should at least add (...)() to it. And then you only have a return value, and not something printed out

@nl-x, oh yeah. I wasn't paying enough attention to the "print" part of the challenge. In a javascript console, it will implicitly return the result of any expression, so I was thinking that might be sufficient, but yeah... no so.

@nl-x The OP has edited to clarify that functions returning the string are allowed.

@RobertHickman ^

This is a lot similar to http://codegolf.stackexchange.com/a/97426/14732 (which was answered 1 hour before your last edit.) On a regular environment, without any library, both answers are identical. On a website that happens to have jQuery, both are different. I'm not accusing of anything, I'm just exposing this bit.

@IsmaelMiguel That's fair... not sure what I should do about it though. You can see the edit history to see that my original version was a bit longer, but I edited it to reflect Neil's suggestion

@jrich I know. I don't know what you should do either. I would upvote the other answer and show this on meta and ask for guidance.

PHP, 14 13 bytes
{"":<?=M_E?>}

Prints a nice mathsy object that one could almost pretend is useful:
{"":2.718281828459}

Uses the fact that php prints anything outside the tags verbatim to save on some quotation marks, M_E was the shortest long enough constant I could find.
edit: saved one byte thanks to Lynn. Sadly it's no longer a 'nice' mathsy object.

"" is a valid JSON key.

Brainfuck, 50 bytes
+[+<---[>]>+<<+]>>+.>>>--.<+++<[->.<]>>.<+.-.<<++.

Outputs {"999999999999999999999999999999999999999999999999999999999999999999999999999999999":9}. Assumes an interpreter that has 8-bit cells and is unbounded on the left. Try it online!

Pyth - 5 bytes
Prints {"'abcdefghijklmnopqrstuvwxyz'": 10}.
XH`GT

Try it online here.

JSON only allows double quotes unfortunetly

@Downgoat ah, fixing for one byte.

@Downgoat fixed.

Jolf, 9 bytes
"{¦q:¦q}"

Outputs: {"{¦q:¦q}":"{¦q:¦q}"}. Try it here!
"{¦q:¦q}"
"{  :  }"  raw string
  ¦q       insert the source code here
     ¦q    and here

Pyth, 7 bytes
.d],`G0

Creates a dictionary containing a single key "'abcdefghijklmnopqrstuvwxyz'" and value 0:
.d         Dictionary from:
  ]         The single-element list containing:
   ,         The two-element list containing:
    `G        The representation of the alphabet (the key)
      0       and 0 (the value)
          Implicitly print the stringification of this.

Batch, 16 bytes
Prints {"Windows_NT":0}.
@echo {"%OS%":0}

Could you please add the (example) output?

///, 15 14 characters
/a/{":1234}/aa

(At least the output is 1 2 characters longer than the code.)
Try it online!
Thanks to:

ETHproductions for reusing the object delimiters as part of key (-1 character)

Sample run:
bash-4.3$ slashes.pl <<< '/a/{":1234}/aa'
{":1234}{":1234}

Just to make it more readable:
bash-4.3$ slashes.pl <<< '/a/{":1234}/aa' | jq ''
{
  ":1234}{": 1234
}

That's a clever way to save bytes :-)

You can save another one with /a/{":1234}/aa (outputs {":1234}{":1234})

Amazing, @ETHproductions. Thanks.

05AB1E, 9 bytes
Unfortunately, 05AB1E doesn't have a dictionary object so we have to construct our own.
’{"èÖ":7}

Try it online!
Output
{"dictionaries":7}

R, 19 bytes
cat('{"',lh,'":1}')

Becomes a bit longer because the need to escape quotes \". Furthermore, lh is one of the built-in datasets in R and is (to my knowledge) the object with the shortest name that contains the 9 characters needed to fill the length of the key. (edit: turns out pi does the trick as well with the standard option and I was beaten by @JDL who was clever enough to escape using single quotes rather than the extra backslashes)
The description of lh in the R-documentation is:

A regular time series giving the luteinizing hormone in blood samples at 10 mins intervals from a human female, 48 samples.

which is a rather unexpected name of a key, but hey, it works and produces the output:
{" 2.4 2.4 2.4 2.2 2.1 1.5 2.3 2.3 2.5 2 1.9 1.7 2.2 1.8 3.2 3.2 2.7 2.2 2.2 1.9 1.9 1.8 2.7 3 2.3 2 2 2.9 2.9 2.7 2.7 2.3 2.6 2.4 1.8 1.7 1.5 1.4 2.1 3.3 3.5 3.5 3.1 2.6 2.1 3.4 3 2.9 ":1}

The answer can be compared to just padding the key with "random" letters to make the output at least 15 characters (24 bytes):
cat("{\"HeloWorld\":1}")

You can avoid the escaping backslashes by using single quotes in the R expression: cat('{"',lh,'":1}') as I did above (though I used pi instead of lh). In my search for two-letter variables I came across the function el which I never knew existed. Could be useful in future...

PowerShell 22 20 14 Bytes
'{"":'+1tb+'}'

Output
{"":1099511627776}

Using the constant defined for 1TB in bytes to reach the character limit and the value of a static integer to make for valid json. Thanks to TimmyD for reducing the characters by 5 by removing some redundancy.

Earlier Post 40 Bytes
"{$((1..9|%{'"{0}":{0}'-f$_})-join",")}"

Output
{"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9}

Takes a integer array and creates a key-value pair for each. Join with commas and wrap with a set of curly braces.

Dyalog APL, 9 bytes
⎕JSON⎕DMX

Try it online!
In a clean workspace on my PC the result is
{"Category":"","DM":[],"EM":"","EN":0,"ENX":0,"HelpURL":"","InternalLocation":["",0],"Message":"","OSError":[0,0,""],"Vendor":""}
⎕JSON convert to JSON
⎕DMX the (universally available) Diagnostic Message Extended object

V, 9 bytes
i{"¹*":0}

Try it online!
Very straightforward. Enters insert mode, enters the following text:
{"*********":0}

The reason this is so short is because ¹ repeats the following character 9 times.

I was expecting the 0 byte one :P

@maltysen I did post it. I deleted it because it used single quotes instead of double... :(

Retina, 11 bytes

{"9$*R":1}

Output
{"RRRRRRRRR":1}

Note: the leading newline is significant as nothing is replaced with the resultant output, I've used a non-breaking space to illustrate this!
Try it online!

Japt -Q, 1 byte
M

Try it online!
The output is {"P":3.141592653589793,"Q":1.618033988749895,"T":6.283185307179586}.
How it works
M is a shorthand for JS's Math object, with one-char aliases to existing functions/constants and some extra functions/constants. The constants shown here are:

M.P = Math.PI
M.Q = Golden Ratio = (Math.sqrt(5)+1)/2
M.T = Math.PI * 2

And the boring part: the -Q flag applies JSON.stringify to the output value. Some of the properties are lost (e.g. Math.E and Math.SQRT2), but we still have the above three values and the result is well over 15 characters.

JavaScript (ES6) + jQuery, 15 bytes
Because jQuery.
_=>`{"${$}":0}`

Outputs {"function (a,b){return new n.fn.init(a,b)}":0} when called. Try it here:

f=_=>`{"${$}":0}`
alert(f())
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

The assignment is to output something. without the alert() you are not outputting anything

@nl-x The OP has edited to clarify that functions that return the string are allowed.

Windows batch, 10 bytes
{"%OS%":5}

The environment variable OS contains the string Windows_NT (On all Windows operating systems since 2000, according to this question on Stack Overflow)

@ETHproductions Oops

Is this actually outputting anything? Neil's Batch answer certainly does, but can't remember about any implicit batch output.

@manatwork Yes it does, since echo is turned on, the current command is echoed, evaluating the OS variable in the process.

Oh. So actually it tries to execute that {"%OS%":5} as it would be a command and you benefit of the elementary tracing feature? That's tricky.

@manatwork Yes, exactly.

HQ9+, 15 bytes
{"Quineland":0}

Outputs itself. I thought an 8-byte answer would be possible, like so:
{":11QQ}

This outputs {":11QQ}{":11QQ}, which is almost valid JSON, but 11QQ is not a valid value.
HQ9+ is not a valid programming language by PPCG standards, but the OP has allowed non-programming languages.

This absolutely is not valid. All submissions must be in a valid programming language.

This is mostly kolmo complexity (mostly, because if it outputs something different it still counts), so I think this could be valid

@DestructibleWatermelon Using a non-programming language is a standard loophole.

@Mego OP has explicitly allowed non-programming languages now

Bash, 18 bytes
echo {\"$PATH\":1}
This works on Mac and Linux, unless your $PATH isn't set.

This is genius. +1. And welcome to the site!

Ruby, 19 bytes
puts'{"1":'+9**9+?}

Output:
{"1":387420489}

@NathanMerrill Fixed

Can you show what it outputs

Can't you save a byte by removing the space after puts?

I think that ?1*9 is still long enough.

@curiousdannii Done

@Oliver I did that

@LeeW Fixed it.

brainfuck, 83 bytes
--[-->+++++<]>.+[---->+<]>+++.>-[>+<-----]>.........<<.[----->+<]>.>.>--[-->+++<]>.

Outputs {"333333333":3}
There is likely another shorter solution, but I have not yet found it.
Explanation:
--[-->+++++<]>. {
+[---->+<]>+++. "
>-[>+<-----]>.  3
........
<<.             "
[----->+<]>.    :
>.              3
>--[-->+++<]>.  }

Try it online

R, 19 bytes
This works in British English locale; it may require +2 bytes in others. (Edit: it probably doesn't --- see comments.)
cat('{"',pi,'":1}')

I was hoping for something clever (perhaps plucking a line of code out of a pre-existing function like q) but couldn't find anything. The result:
{" 3.141593 ":1}

Note that you don't have to escape double quotes in R if you use single quotes to quote the string (and vice-versa). This behaviour is locale-dependent though. I would expect it to work in a US English locale as well though.
This also requires that your default digits option is at least six (which is the factory-fresh default) and that scipen is at least -digits (the factory-fresh default is zero).

Sorry, what? R's grammar changes with locale?

Yes, which characters need escaping depends on options(quote) which can be specified by the user, but the default is, as far as I know, locale-dependent.

@cat I think that’s a misunderstanding. The existence of options('quote') isn’t documented, changing it has no discernible effect, and though I’ve come across a great deal of shenanigans in R I doubt that runtime options would change the way it’s parsed. It may change the output of course — but not in the code in this answer.

@Konrad, you might be right. I think I was thinking of "useFancyQuotes" which only affects quote, squote etc.

Java 7, 36 bytes
String c(){return"{\"a\":"+1e6+"}";}

Java 8, 21 bytes
()->"{\"a\":"+1e6+"}"

Ungolfed & test code:
Try it here.
class M{
  static String c(){
    return "{\"a\":" + 1e6 + "}";
  }

  public static void main(String[] a){
    System.out.println(c());
  }
}

Output (length 15):
{"a":1000000.0}

Second solution  gives an error

@Numberknot Fixed and added to the test code

"length varies between 15 and 16 depending on the hash". Hashes can technically have a length as small as 1 (see System.identityHashCode(Object)).

Also, you can golf 1 byte by using "" as key and 1e7 as value. "" is a valid key when tried in the validator.

@OlivierGrégoire Ok, I'll remove the this code. As for the "" with 1e7, that won't work unfortunately. 1e6 outputs 1000000.0, but 1e7 outputs 1.0E7 instead.

Oh, my mistake, I didn't check.

PHP, 19 bytes
<?='{"'.(9**9).'":1}';

Output: {"387420489":1}
https://eval.in/665889
Thanks to manatwork for the tips!

Your output is 16 characters long, while the requirement is 15. So why not remove that “H”?

BTW, since PHP 5.6 there is a ** operator: pow(9,9) → (9**9).

15 chars (not really PHP): {"<?=9**9?>":1}

Perl 5, 16 15 bytes
Uses the unix timestamp of the moment the program was started as the content of a one-element object. It gives valid output if you run it later than 10:46:39 on 3rd of March 1973. But since we can't go back in time that seems legit.
say"{\"$^T\":1}"

Uses the FORMAT_TOP_HANDLE variable $^ which defaults to STDOUT_TOP.
say"{\"$^\":1}";

Run with -E flag at no additional cost.
perl -E 'say"{\"$^\":1}";'

Outputs is 16 bytes long.
{"STDOUT_TOP":1}

RIP time dependent answer :(

@CalculatorFeline hu?

Cheddar, 17 14 bytes
Saved 3 bytes thanks to @ConorO'Brien
->'{":1234}'*2

An anonymous function that returns {":1234}{":1234}, which is a valid JSON object:
{
  ":1234}{": 1234
}

Try it online!

Charcoal, 7 bytes
{"⁹":9}

Try it online!
Runs of printable ASCII characters in Charcoal form literal strings, and expressions lacking any explicit command are printed. So {" and ":9} are just output verbatim. ⁹, however, is an integer literal, and when you print an integer, you get an ASCII-art line that many characters long. The character used for horizonal lines is the hyphen, so the result is:
{"---------":9}

Conveniently, this is exactly 15 characters.

Jelly, 13 12 bytes
“{"":}”s2jȷ4

TryItOnline!
How?
“{"":}”s2jȷ4 - Main link: no arguments
“{"":}”      - literal ['{','"','"',':','}']
       s2    - split into twos -> [['{','"'],['"',':'],['}']]
         j   - join with
          ȷ4 - literal 10000 -> ['{','"',10000,'"',':',10000,'}']
             - implicit print -> {"10000":10000}

previous (13):
“"11”m0“{:}”j

Element, 18 bytes
\{\"a\"\:`9 9^`\}`

Try it online! Outputs {"a":387420489}
This is only three bytes shorter than the naive solution.  The first half of the output is hard-coded (too many escape characters to make any other approach feasible), while the value is calculated as 9^9 to make a number long enough.

q, 14 bytes
Prints memory usage information about the current process
-1@.j.j .Q.w`;

Sample output:
q)-1@.j.j .Q.w`;
{"used":127392,"heap":67108864,"peak":67108864,"wmax":0,"mmap":0,"mphy":16735457280,"syms":585,"symw":18925}

Could you provide sample output?

sure, updated post

You can just pass the entire .q namespace to .j.j for 7 bytes. This returns a JSON object: .j.j .q

Japt, 11 bytes
There are a multitude of 11-byte programs:
`\{"{O}":1}  // {"[object Object]":1}
`\{"{M}":1}  // {"[object Math]":1}
`\{"{@}":1}  // {"function (X,Y,Z){return }":1}
`\{"{_}":1}  // {"function (Z){return Z}":1}
`\{"{Ð}":1}  // {"Tue Oct 25 2016 12:15:24 GMT-0400 (Eastern Standard Time)":1}
`\{"":{+Ð}}  // {"":1477412000095}

The last two use the Date object; thus, they are non-constant, but always output more than 15 bytes. Explanation:
`\{"   ":1}` // Take this string,
    {O}      // inserting variable O here.
             // O is an Object, which stringifies to "[object Object]".
             // Implicitly output.

Test it online!
More interesting 12-byte version:
`\{":{L²}}`²

Prints {":10000}{":10000}. Explanation:
`\{":    }`   // Take this string,
     {L²}     // inserting 100 squared (10000) here,
              // (this yields {":10000})
           ²  // and double.
              // Implicitly output.

Test it online!

Common Lisp, 24 bytes
(format t"{~S:~f}""p"pi)

Prints the following to standard output (23 characters long):
{"p":3.141592653589793}

This is a simple string format which uses the predefined constant PI.

CoffeeScript, 18 16 bytes
Saved 2 bytes thanks to @Caffeinated.tech
->'{"":'+1/3+'}'

Outputs {"":0.3333333333333333}. Sadly, because of the required double-quotes, string interpolation is a byte longer:
->"{\"\":#{1/3}}"

You can use the fact that float division is default in Coffee, which let's us use 1/3 instead of undefined to give the length of the required output.
I got it to 16 chars: ->'{"":'+1/3+'}'

@Caffeinated.tech The main reason I didn't think of that was that I didn't realize that Coffee's functions could be arg-less, so thanks for teaching me that :)

Actionscript 3, 27 bytes
trace(JSON.stringify(int));
outputs
{"MAX_VALUE":2147483647,"length":1,"MIN_VALUE":-2147483648,"prototype":{}}

IBM/Lotus Notes @Formula, 24 23 bytes
Computed value in a Notes field.
"{\"\":"+@Text(@Pi)+"}"

Outputs:
{"":3.14159265358979}

Nothing clever - just uses the shortest possible function that outputs a number then converts it to text for display.

Useless? Why? You can still refer that value by its key and use it: http://pastebin.com/RqbbUBEt

I guess so. If it is considered acceptable then I'll edit my answer accordingly.

TSQL(2016 only), 50 BYTES
SELECT*FROM(VALUES(GETDATE()))AS A(a)FOR JSON PATH

You don't require the AS  for the alias and NEWID instead of GETDATE will save a couple as well.

PowerShell, 17 bytes
Slightly unclear on how strict the 'no input' thing is, if it's just no user input or of system input is also disallowed. While my best answer isn't shorter than the other PowerShell answer I think it is novel.
ps|ConvertTo-Json

Gets running processes (default return is an object) and converts that object to a json. Several other two and three letter aliases commands work.
Sample output omitted because it's 34115 lines long and trying to redact my username and computername was a pain.
gl|ConvertTo-Json

Gets your current filesystem location (as an object) and converts that object to a json
gci|ConvertTo-Json

Gets the files in your current path (as an object) and converts that object to a json
You can also take things like inherent type definitions (which are part of the language itself) and pipe them into the conversion function.
[xml]|ConvertTo-Json

Gets the definition of the xml datatype and converts that object to a json
[int]|ConvertTo-Json

Gets the definition of the 32bit integer datatype and converts that object to a json

So, ps is valid in my book, because you're depending on the fact that there are processes running in the system.  gl and gci depend on things that you can't necessarily assume, so are invalid IMO.

Java 8 (Full Program), 125 Bytes 123 Bytes 116 Bytes
Yes, I know there are shorter ways in Java, as posted above. I just wanted to approach it from a looping perspective.
Thanks to ais523 for saving 2 bytes.
Thanks to Manatwork for saving 7 bytes.
interface C{static void main(String[]a){for(int i=0;i++<9;)System.out.print(i<2?"{":"\""+i+"\":"+i+(i>8?"}":","));}}

Ungolfed
interface C{
    static void main(String[]a){
        //Loop from 0-8, add one to i at start of loop instead of end though
        for(int i=0;i++<9;)
            //If it is a start case simply print { otherwise print "i":i
            //If it is an end case also print } otherwise also print :
            System.out.print(i<2?"{":'"'+i+"\":"+i+(i>8?"}":","));
        }
}

Assuming you want to keep with this algorithm (which is almost certainly not the best for optimizing your score), you can nonetheless make the program a bit shorter by using < and > comparisons rather than ==.

Good idea, I'll update the code. I don't know why but I really wanted to make a loop.

You have an accidental \`` left at the end of your golfed code. While removing it, you could also remove the unnecessary {…}aroundfor's only statement and change """→'"'`.

There would be one more way to reduce it: i<2?"{":"\""+i+"\":"+i+(i>8?"}":","). With this the "1":1, part vanishes from the output, though it remains long enough to be valid.

Welcome to PPCG!

Sorry, @LlewVallis, but my suggestion only saved 7 bytes, as the last one is not compatible with the earlier '"'. But there would be another little trick to recover that 1 character saving: use i only in the key and hardcode the value. i<2?"{":"\""+i+"\":1"+(i>8?"}":",").

@manatwork Just realised, sorry.

Vim, 13 keystrokes
a{"<esc>9aa<esc>a":0}

Outputs
{"aaaaaaaaa":0}

Go, 47 bytes
import."fmt"
func f(){Print(`{"X":10,"Y":20}`)}

Attempt This Online!
To STDERR, 32 bytes
func(){print(`{"X":10,"Y":20}`)}

Attempt This Online!

K (ngn/k), 12 bytes
`0:`j@`a!1e9

Try it online!

jq -n, 12 bytes
""|match("")

Try it online!
env does not always satisfy the requirement. It depends on the environment, which could even be empty, outputting {}. This solution yields the same result every time:
{
  "offset": 0,
  "length": 0,
  "string": "",
  "captures": []
}

x86-64 machine code, 16 bytes
B8 7B 22 3A 20 AB AB AB AB C7 07 30 7D 7D 00 C3

Try it online!
Produces {": {": {": {": 0}}.
Following the standard calling convention for Unix-like systems (from the System V AMD64 ABI), this takes in RDI a memory address at which to place the result, as a null-terminated byte string.
In assembly:
f:  mov eax, '{' | '"'<<8 | ':'<<16 | ' '<<24
            # Put this value in EAX.
    stosd   # Write it to the output string, advancing the pointer.
    stosd   # Again.
    stosd   # Again.
    stosd   # Again.
    mov DWORD PTR [rdi], '0' | '}'<<8 | '}'<<16 | 0<<24
            # Add this value to the output string.
    ret     # Return.

Groovy, 43 Bytes
{groovy.json.JsonOutput.toJson([i:1..9])}

It gives the range 1-9 in JSON stored for i:
{"i":[1,2,3,4,5,6,7,8,9]}

Groovy on Grails, 31 Bytes
def v(){render(params as JSON)}

Controller method, renders the parameters which always include action, controller and a few other meta parameters which results in:
{"action":"v","format":null,"controller":"<Controller Name>"}

When you visit the URL:
http://localhost:8080/<Controller Name>/v

Your program should take no input.

@NathanMerrill fixed, the only cool part to my answer is the Grails part anyway.

Myth, 28 26 bytes
{"a":"{\":3141}","_":"aa"}

Saved 2 bytes by adapting the solution given by the /// answer.
Myth is a language similar to Thue, contained in a valid JSON object. How appropriate! Here, _ is the initial state, and replaces a with "****". Output:
{":3141}{":3141}

For clarity, I added some spaces:
{
  ":3141}{"  :  3141
}

Previous solutions
28 bytes: {"a":"\"****\"","_":"{a:a}"}. Outputs: {"****":"****"}
Running
I found the interpreter here:
function(m,y,t,h){m=JSON.parse(m);for(y=m._;h=1;){for(t in m)if(t!="_"&&~y.indexOf(t)){y=y.replace(t,m[t]);h=0;break}if(h)break}return y}

Test it out right here:

function myth(m,y,t,h){m=JSON.parse(m);for(y=m._;h=1;){for(t in m)if(t!="_"&&~y.indexOf(t)){y=y.replace(t,m[t]);h=0;break}if(h)break}return y}
b.onclick=function(){o.innerHTML="";o.appendChild(document.createTextNode(myth(q.value)));}
textarea {
  width: 90%;
}
*{font-family:Consolas,monospace;}
<textarea id=q>{"a":"\"****\"","_":"{a:a}"}</textarea>
<br>
<button id=b>execute myth code</button>
<br>
<textarea id=o disabled>output</textarea>

Addict, 200 167 bytes
Addict is a Turing tarpit where the only control flow is user-defined commands.
a A
 i 1
 i 1
 d
a B
 A 1
 A 1
 d
a C
 B 1
 B 1
 d
a D
 C 1
 C 1
 d
D b
D b
D b
D b
D b
D b
D b
C b
B b
d b
D q
D q
A q
c b
c q
c q
D q
C q
c q
n b
n q
n b
n q
A b
c b

This outputs {"":1235812358}. Try it in the online interpreter!
How it works
To golf answer space, I'm going to refer you to the sections Primer on Addict and Act I on "Hello, World!" in Addict. If you already know how that works, feel free to skip this part.
Act II
The rest of the program is devoted to outputting a valid JSON object in as few bytes as possible. In order to minimize the code, we can use the variables that are already set to output a number with the n command. The first step is then to set three variables to the two chars we need at first:

b to 123, the char code of {
q to 34, the char code of "

After these have been set, we output {"" one char at a time, then increment q by 24, resulting in 58, the charcode of :. We output that, then output the values of b and q twice, printing 1235812358. The last step is to increment b by 2 to change it to }, and then output it to finish.
If you can find any way to golf this program, please let me know!

Crystal, 23 bytes
puts %Q({"#{"a"*9}":0})

You can also avoid using %Q (and keep the same character count):
puts "{\"#{"a"*9}\":0}"

The above return:
{"aaaaaaaaa":0}

Which has exactly 15 characters.

Actually, 10 bytes
'}Qè;':@'{

Try it online!
Explanation:
'}Qè;':@'{
'}          push "}"
  Q         push this program's source code
   è        call Python's repr function (essentially just wraps the string in double-quotes)
    ;       duplicate
     ':@    push ":", swap with one copy of double-quoted source code
        '{  push "{"
            implicitly print each stack item, separated by newlines, starting with the top

Output:
{
"'}Qè;':@'{"
:
"'}Qè;':@'{"
}

Javascript, 14 bytes
'{"":'+1e9+'}'

Gives:
{"":1000000000}

I know that this doesn't actually print out anything, it merely returns. But so do all other Javascript solutions here.

You need to either define a function, or a full program (with printing).

@NathanMerrill allmost all other javascript/ecmascript solutions do no printing. The rule about function or program was added later.

I guess it's a REPL?

RAGE!!!, 41 bytes
<rant>SCREAM"{\"12345\":54321}"!!!</rant>

Since the interpreter compiler transpiler on the esolangs page converts the code to Python 2 via mere string substitution, escaping double quotes should be okay.

ECMAScript 2015, 16 bytes
_=>`{"":${9e9}}`

It will run in most modern ECMAScript environments (eg. Firefox, Chrome, MS Edge, Opera, Node…).

C#, 39 bytes
string j(){return"{\""+1.0/0+"\":42}";}

In C#, division of 0 with a double (hence the inclusion of .0), will result in Infinity.
Output:

{"Infinity":42}

Cool. Do you need the 0 in 1.0, or will 1./0 suffice?

1./0 is a syntax error in c#, namely "Identifier expected". Nice thought though :)

JavaScript, 17 bytes
_=>'{"'+{}+'":0}'

outputs

{"[object Object]":0}

passes validator at jslint
This works because {} will implicitly be cast to string with the + concatenation, and calling toString on an object returns "[object Object]".

Python 2, 13 bytes
print{"'":.1}

Outputs:
{"'": 0.10000000000000001}

Since tenths can't be stored exactly in binary Python outputs a 1 followed by 15 zeros followed by a 1 after the decimal point. Need double quotes around the single quote to not have the double quotes converted to single quotes (thanks to @JonathanAllan's comment to @xnor's answer).

Doesn't seem to work the same way here: http://pastebin.com/P5vau3WB

@manatwork Works with QPython on my android

@manatwork And Python 2.6.6 but not Python 2.7.1

Rust, 21 bytes
||"{\"a\":0.1234567}"

String substitution would be too verbose, but at least there's always terse lambdas with implicit returns.
With "test code":
fn main(){
    let f=||"{\"a\":0.1234567}";
    println!("{}", f());
}

Turtlèd, 15 bytes
'{r'"10:'"r":3}

Try it online
outputs {"         ":3}
Explanation
'{               write {
  r              move right, off {
   '"            write "
     10          put 10 in register
       :         move right that many characters (puts spaces in)
        '"r       write ", move right of that character
           ":3}   write :3}

SmileBASIC, 27 bytes
?"{
?CHR$(34)*2;":
?PI();"}

Printing quotation marks is a huge pain in BASIC. 8 bytes wasted!
Output:
{
"":
3.14159265}

Exactly 15 characters, without the whitespace.

Pushy, 12 bytes
`{"`A`":1}`"

Try it online!
This produces the output:
{"ABCDEFGHIJKLMNOPQRSTUVWXYZ":1}

Any text wrapped in backticks is a string literal. The A injects the whole uppercase alphabet. Then, the final " command prints it all.

05AB1E, 15 13 bytes
„{"A„":Jû¨'}J

Try it online!
{"abcdefghijklmnopqrstuvwxyz":"zyxwvutsrqponmlkjihgfedcba"}

Your code outputs single quotes instead of double

@user2428118 fixed at a -2byte cost. JSON with ' is parsable in some languages though.

@MagicOctopusUrn Doubt it. It's probably not actual JSON if single quotes are parsable, maybe you meant dictionaries?

@Makonede There's an extension of JSON called JSON5 that allows single-quoted strings, unquoted keys, trailing commas, and a whole host of other things that aren't part of standard JSON.

@Bbrk24 ok.. that's not JSON though

Tcl, 18 bytes
puts \{"[pwd]"\:4}

Try it online!

Prolog (SWI), 19 bytes
?-writeq({"":1e7}).

Try it online!

Nim, 21 bytes
echo "{\"\":",4/9,"}"

Try it online!
Boooring.

Brachylog, 14 bytes
"{~k:~k}"gj₃w₁

Try it online!

GNU nano, 9 keystrokes
{"              ":0}

{ " META+o Tab Tab " : 0 }
{ ": literal {"
META+o: switch to tabs-to-spaces mode
Tab Tab: Tab to the second tab stop (tab stops are 8 by default). Since we enabled tabs to spaces, these will be converted to 14 spaces.
" : 0 }: literal ":0}
It is a very interesting JSON string with a very interesting input method, if you ask me.
Video demo done in Termux to visualize keystrokes (ALT is META)

Vyxal, 8 bytes
`{"‹":0}

Try it Online!
Outputs {"https://www.google.com":0}.

Thunno KJ, \$ 13 \log_{256}(96) \approx \$ 10.70 bytes
":0}"'"AZ'"'{

Attempt This Online!
Prints {"ABCDEFGHIJKLMNOPQRSTUVWXYZ":0}
Explanation
Since Thunno's stack is reversed, we'll go right to left:
":0}"'"AZ'"'{  #                      STACK:
           '{  # Push "{"             {
         '"    # Push '"'             { "
       AZ      # Push the alphabet    { " ABCDEFGHIJKLMNOPQRSTUVWXYZ
     '"        # Push '"'             { " ABCDEFGHIJKLMNOPQRSTUVWXYZ "
":0}"          # Push ":0}"           { " ABCDEFGHIJKLMNOPQRSTUVWXYZ " :0}
               # Flags: join stack    {"ABCDEFGHIJKLMNOPQRSTUVWXYZ":0}
               # Implicit output

Trilangle, 26 bytes
"{"o:o"o,S"!So"o"o*}@o,o!o

Try it on the online interpreter.
Most of this is just spent shuffling punctuation around. Prints out
{"":58
,"":1972
}

Which, while not particularly useful, is accepted by JSON.parse. The first number is the value of ':' and the second number is '"' * ':'.
Trilangle, no duplicate keys, 30 bytes
"{:ooS"!oo""SS!o,oo"oooS*}@.",

Prints out:
{"":58
,":":1972
}

C++11, 30 bytes
As unnamed lambda, port of jrich's answer, -1 byte thanks to ETHproductions
[](){printf("{\"\":%f}",9e9);}

Usage:
int main(){
 [](){printf("{\"\":%f}",9e9);}();
}

Pyke, 11 10 8 bytes
~C`0]]1Y

Try it here!

C#, 76 bytes
using System;public class P{public void Main(){Console.Write("{\"\":"+1/3d+"}");}}

Output:
{"":0.333333333333333}

If I'm not mistaken, you can omit the using System; and use instead System.Console.Write(...). This can save you 6 bytes

@auhmaan: D'uh. You're correct. I had that, but I switched from Math.PI to 1/3d since it's shorter. And because I had to use System for both Console.Write and Math.PI it was shorter to use a using. But now I'm not using Math.PI anymore I can, indeed, get rid of the using system. Thanks for pointing that out!

Ruby (cheap), 22 bytes
->{'{"aaaa":"bbbbb"}'}

Lambda function that returns the String object '{"aaaa":"bbbbb"}'

"a":"b"*8 would be shorter.

@carusocomputing See my other post.

JavaScript (REPL)
10 chars:
{"":{}+''}

Output:

 {"": "[object Object]"}

Well, maybe. If it doesn't like the bare object:
12 chars:
({"":{}+''})

If it doesn't print returned objects the way we need:
This is cleaner (ES2015, 13 chars, borrowing from another solution):
`{"":${9e9}}`

{"": 9000000000}

Perl, 18 bytes
say"{'".[2]."':1}"

Prints an array reference in quotes as the name and 1 as the value.  Sample output:
{'ARRAY(0x60002b5c0)':1}

This isn't valid JSON because strings must be delimited with double quotes (not single quotes as you currently have it).

Chrome console accepts it just fine

@GabrielBenamy Unfortunately, standard JSON is different from Javascript objects, and doesn't allow single quotes. Source: http://www.json.org/

If you're changing the quotes anyway, you can remove the 2 in the [] and it'll still be an arrayref for -1!

Another alternative: say"{\"$~\":$]}"!

You can save one byte by using a scalar ref, but then you need commas. say"{'",\2,"':1}"

AFAIK is still invalid. -1.

Text, 15 Bytes
I'm pretty sure you know that language, and non-programming languages are allowed...
{"hi ":"world"}

ShellSoccar-jpn/Parsrs makrj.sh, 6 5 4 bytes
Tested with version Wed Sep 14 22:19:55 JST 2016, which is the latest version before this problem was created.
.../

outputs (18 bytes w/o LFs)
{
"":{
"":{
"/":""
}
}
}

Explained
makrj.sh is a POSIXism utility to generate a JSON object from a list of JSONPath-indexed values developed by ShellShoccar-jpn. The input shall be lines of <key> <value>.
.../  # define an implicit value "" with 3-level key whose
.     # 1st-level key name is ""
 .    # 2nd-level key name is ""
  ./  # and 3rd-level key name is "/"

Try this (bash+curl)
printf '.../' | sh <(curl https://raw.githubusercontent.com/ShellShoccar-jpn/Parsrs/666042eddeb41406ee4a1e4831a01b0aac5af211/makrj.sh)

Thunno 2, 10 bytes
ẠṘ"{%:0}"Œ

Attempt This Online!
Explanation
ẠṘ"{%:0}"Œ  # Full program
  "{%:0}"   # Template string "{%:0}"
         Œ  # With the "%" replaced by
 Ṙ          # A quoted version of
Ạ           # The lowercase alphabet
            # Implicit output

Boring answers with literals
Emotinomicon, 32 bytes
}1:"        r"{⏪⏬⏩

Minecraft, 19 bytes
say {"           ":0}

Or not so boring, but not guaranteed
say @p

And just use the JSON as username
Any texteditor, 15 bytes
Couldn't get it any shorter with copy-pasting
{"123456789":0}

Notepad, 7 keystrokes
{"F5":1}
Thanks to @ETHProductions

I forgot about the qoutes and noticed ah I need 11 chars as key.

{":1234}<ctrl+a><ctrl+c><right-arrow><ctrl+v> is 15 keystrokes, I suppose, but that's not any shorter, and I'm not sure it would count...

Yes I tries some copy-pasting but got the same problem you got. :(

In Notepad on Windows 7 (perhaps other OSs too), you can do {"<F5>":0} for a grand total of 7 keystrokes (F5 inserts the time/date, e.g 3:37 PM 10/25/2016). Not sure if that counts either...

Do you know this html tag which looks like keyboard buttons. You know the one that is sometimes uses in Vim answers. I already searched for it but couldn't find it.

I think it's <kbd>

say @p gives >= 15 bytes of JSON?!

@cat No. It prints your username. Which can be set to any string you want.

"{}: are not allowed in Minecraft usernames; therefore the result will never be valid. Even if, somehow, you were able to change your Minecraft username to {"           ":0}, it would count as 25 bytes as per this meta post. (It's about storing extra info in the file name, but I'm sure this counts as well.)

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Translate English Characters to the Emoji Flag Alphabet
Introduction
Emoji use a particular alphabet for their national flags, which allows one to put two symbols together to create the appropriate flag.

Your challenge, is to transform any uppercase letter into the appropriate Flag Identifier.
This may be much harder for languages that do not innately handle Unicode.
Each symbol is exactly 4 UTF-8 Bytes.
The Task
Given an input as one or more letters, output the same, with all letters replaced with their flag combinations.
Winner is the answer with the least Bytes, giving the tiebreaker to first answer posted.
Input / Output
Input and Output may use any standard method.
Letters in the input may optionally only support one case, Upper or Lower. Please specify in your answer what case your solution supports.
Your output may, intentionally or otherwise, output flag emoji instead of letter pairs.
Test Cases
FR
Hello, World! , !
Rules

Standard Loopholes Apply
Standard Input Output allowed
This is code-golf, however, All the Emoji Letters as provided above can be counted for a single byte each, instead of four. Least Bytes wins!

Test case number two transforms both cases, do we have to do this?

As stated, it's not required. It's just to show what would happen if supported.

bytes should be counted, someone can just pack data into dense Chinese characters and win.

I'll change it to count bytes, but let the flag letter emoji count as only one byte, to keep with the initial intention.

Is this a duplicate of this?

In the initial alphabet, by browser shows DE as a flag... Maybe add some sort of separator between the letters

Retina - 9 7 bytes
Supports uppercase.
I don't really know retina, so I'm not sure the question mark diamonds show up because of TIO limitations or because I did something wrong, if its the latter, please leave a comment.
T`L`-

Try it online here.

The obvious solution sometimes is also the best.

and  are 4 bytes each so it's actually 13 bytes.

Pyth - 18 16 bytes
Supports lowercase.
XzGsCMrF+BC\26

Test Suite.

Doesn't convert FR for me on online link?

@Downgoat FR is all uppercase, and this answer only supports lowercase

@ATaco did not see that will be golfing that

05AB1E, 9 bytes
Ties Steffan's Vyxal answer for #1.
A""ÇŸç‡

Try it online! Supports lowercase only.

The Retina answer is 7 bytes if we still want to go by the rules the challenge says: All the Emoji Letters as provided above can be counted for a single byte each, instead of four. Least Bytes wins! However, the Retina answer is broken; it displays question marks and not the correct characters.

Vyxal, 9 bytes
Cʀ»ƛ⁽ṗ»*+

Try it Online!

Scala, 75 bytes
(s:String)=>s.flatMap(c=>if(c.isLetter)Seq(55356,c+56741)else Seq(c))

Explanation:
(s:String)=>             //define an anonymous function taking a string
  s.flatMap(c=>            //map each char...
    if(c.isLetter)           //if it's a letter
      Seq(55356,c+56741)       //...to a sequence of 55356 and c+56741, this is the target char in UTF16 encoding as a surrogate pair
    else                     //else
      Seq(c)                   //..to a sequence of c
  )                        //and flatten

Only works for uppercase.
This returns a the output as sequence of integers in UTF16.

Lua 5.3, 76 bytes
Lua 5.3 newly has a UTF-8 manipulation library, which is useful in this case.
Lowercase only
print(arg[1]:gsub("%l",function(c)return utf8.char(c:byte()+127365)end).."")

x86-64, 17 bytes
Takes input as UTF-32LE string in rsi, and outputs in the same format to a buffer at rdi, and code point count in rcx. Only works for uppercase letters. This can be linked to C code with the function signature void f(int *output,int *input,int dummy,int count);. The dummy variable is just to put the count in the rcx register.
fff10100 is the UTF-32LE encoding for , and so only costs one byte.
ad 50 5a 2c 41 2c 19 8d 80 fff10100 0f 47 c2 ab e2 ed c3

Or, in assembly:
   0:   ad                      lodsd
   1:   50                      push   rax
   2:   5a                      pop    rdx
   3:   2c 41                   sub    al,0x41
   5:   2c 19                   sub    al,0x19
   7:   8d 80 ff f1 01 00       lea    eax,[rax+0x1f1ff]
   d:   0f 47 c2                cmova  eax,edx
  10:   ab                      stosd
  11:   e2 ed                   loop   0
  13:   c3                      ret

Uses the string manipulation instruction lodsd to load one code point into eax, checks if it's a capital letter using two successive subtractions, and adds the appropriate value to convert it to a flag if it is. Otherwise, it uses the conditional move cmova to restore its original ascii value. Finally, it uses stosd to put a code point in the buffer.

C (gcc), 125 111 bytes
main(c,v)char**v;{for(v++;c=**v;putchar(" Ee"[c]+*(*v)++))c=!isalpha(c)-~!islower(c),c%3&&printf(L"\x879ff0");}

-14 bytes thanks to @ceilingcat
Try it online!

Python 3, 68 bytes
lambda s:''.join(chr(x+127397*(64<x<91))for x in map(ord,s.upper()))

Usage (when assigned to f):
print(f("Hello, World!"))
print(f("A B C - X Y Z"))

Jelly, 13 bytes
e€ØA×“¢®Ƒ’+OỌ

Supports only uppercase letters.
Try it online!
Explanation
e€ØA×“¢®Ƒ’+OỌ  Input: string S
e€             Test if each char in S is an element of
  ØA             the uppercase alphabet 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
    ×          Multiply by
     “¢®Ƒ’       The codepoints of '¢®Ƒ' as a base 250 integer
                 This forms 127397
          +    Vectorized add with
           O     The codepoints of each char in S
            Ọ  Convert back to char from codepoints
               Return and print implicitly

PHP, 101 Bytes
supports both replace 64 with 96 to support only lowercase. input only ascii characters allowed
foreach(str_split($argv[1])as$c)echo($o=ord($c))>64&&$o%32<27?hex2bin("f09f87".dechex($o%32+165)):$c;

PHP, 112 Bytes
supports both remove i as modifier in the regex to support only lowercase
<?=preg_replace_callback("#[a-z]#i",function($t){return hex2bin("f09f87".dechex(ord($t[0])%32+165));},$argv[1]);

first version 205 Bytes
<?=preg_replace_callback("#[a-z]#i",function($t){return substr("",(ord($t[0])%32-1)*4,4);},$argv[1]);

The version with mb_substr is one Byte longer

JavaScript (ES6), 70 bytes

f=
s=>s.replace(/[A-Z]/g,c=>String.fromCodePoint(c.codePointAt()+127397))
;
<input oninput=o.textContent=f(this.value)>

Accepts upper case only. Mixed case version for 73 bytes:

f=
s=>s.replace(/[A-Z]/gi,c=>String.fromCodePoint(c.codePointAt()+5|127392))
;
<input oninput=o.textContent=f(this.value)>

Ruby -p, 17 bytes
Counting the letter symbols as one byte each, per OP. Works with uppercase letters.
$_.tr!"A-Z","-"

Attempt This Online!