| Bytes | Lang | Time | Link |
|---|---|---|---|
| 354 | Mornington Crescent | 250408T020444Z | Andrew B |
| 022 | SAKO | 250321T112604Z | Acrimori |
| 016 | Bespoke | 250127T054206Z | Josiah W |
| 008 | Befalse quirkster | 240523T055349Z | Bubbler |
| 015 | Electra | 240309T100459Z | DolphyWi |
| 006 | Julia 1.0 | 230907T172108Z | Ashlin H |
| 005 | Vyxal | 230715T082101Z | The Empt |
| 025 | Swift | 230714T233811Z | macOSist |
| 002 | GNU calc | 230714T233459Z | macOSist |
| 012 | /// | 230714T175328Z | notaprot |
| 006 | ForWhile | 230712T194522Z | bsoelch |
| 002 | JavaScript REPL | 211018T043032Z | William |
| 004 | Vyxal | 230705T175218Z | The Empt |
| nan | 230531T055806Z | Dadsdy | |
| 004 | Python REPL | 230601T183606Z | The Empt |
| 013 | Python 3 PyPy | 230601T181228Z | Wallace |
| 008 | Rockstar | 230530T155811Z | Shaggy |
| 016 | Haskell | 230530T154523Z | Roman Cz |
| 008 | Desmoslang Assembly | 230529T160905Z | Dadsdy |
| 001 | Ly | 230530T031318Z | cnamejj |
| 002 | 2Col | 170524T110816Z | Mayube |
| 001 | Thunno | 230315T130037Z | The Thon |
| nan | Piet + asciipiet | 230228T164450Z | Parcly T |
| 030 | Aheui esotope | 230104T034909Z | Bubbler |
| 001 | Vyxal | 220705T215816Z | naffetS |
| 002 | in floop | 220130T193706Z | emanresu |
| 001 | Halfwit | 220221T075644Z | emanresu |
| 002 | Desmos | 220218T081337Z | Aiden Ch |
| 001 | Backhand | 211118T053336Z | Bubbler |
| 012 | Python 3 | 211025T113220Z | Zaid Al |
| 039 | 4 | 211113T193341Z | Pedro Ma |
| 063 | experimentaltypelang | 211113T012531Z | Merlin04 |
| 012 | INTERCAL | 211025T111722Z | user1004 |
| 019 | SNOBOL4 CSNOBOL4 | 211025T111138Z | user1004 |
| 009 | Javascript REPL | 211024T210603Z | john Smi |
| 016 | AWK | 211018T081718Z | cnamejj |
| 006 | Ruby 3 | 211019T225855Z | wibbuffe |
| 028 | Lean Mean Bean Machine | 211019T161558Z | Mayube |
| 005 | JavaScript | 211018T222340Z | William |
| 005 | Klein 110 | 170517T163232Z | Wheat Wi |
| 003 | tinylisp | 210623T151336Z | DLosc |
| 001 | Pip | 210623T150859Z | DLosc |
| 014 | C# Visual C# Interactive Compiler | 170517T121427Z | LiefdeWe |
| 002 | Knight | 210604T224029Z | EasyasPi |
| 036 | Swift | 210604T215946Z | Eric Xue |
| 032 | Red | 210602T130045Z | Aaroneou |
| 003 | Pxem | 210602T121257Z | user1004 |
| 064 | Scratch | 210401T094129Z | Bo_Tie |
| 004 | HTML w3m dump | 210401T074046Z | tsh |
| 001 | MAWP | 200808T104438Z | Dion |
| 001 | Deadfish | 210331T215312Z | emanresu |
| 054 | PowerShell | 210304T101501Z | wasif |
| 028 | Rust | 201117T172417Z | Aiden4 |
| 006 | Bash | 210304T101145Z | wasif |
| 001 | 05AB1E | 201116T232938Z | Makonede |
| 001 | GolfScript | 170624T110141Z | Koishore |
| 013 | MAWP | 200808T093357Z | Razetime |
| 006 | Perl 5 | 200808T234606Z | Xcali |
| nan | Well | 200502T193056Z | Cloudy7 |
| 029 | Python 3 | 200121T115258Z | Mukundan |
| 002 | naz | 200121T054942Z | sporebal |
| 002 | W | 191208T072059Z | user8505 |
| 2014 | Wren | 191208T071852Z | user8505 |
| 005 | Or | 191017T134331Z | user8505 |
| 022 | Go | 191014T063510Z | Purple P |
| 001 | Keg | 191014T002558Z | lyxal |
| 002 | Actually | 191013T083916Z | user8505 |
| 005 | Dash/Bash/ksh/fish | 190818T025944Z | GammaFun |
| 008 | AsciiDots | 190821T121043Z | Edgex42 |
| 084 | C# | 190820T004401Z | canttalk |
| 005 | Zsh | 190818T023535Z | GammaFun |
| 006 | Bash on Linux | 170517T160212Z | Digital |
| 010 | Python 3 | 190430T172045Z | movatica |
| 009 | Zsh | 190815T040449Z | roblogic |
| 042 | Pyramid Scheme | 170517T141416Z | Conor O& |
| 002 | Keg | 190814T150240Z | user8505 |
| 032 | Pyramid Scheme | 190815T002600Z | Jo King |
| 013 | Python 3 | 190815T003815Z | Dat |
| 015 | TSQL | 170517T214942Z | mbomb007 |
| 002 | Keg | 190810T093755Z | Edgex42 |
| 036 | brainfuck | 190801T181322Z | Kamila S |
| 006 | 8086/8088 machine code | 190731T192905Z | Sophie S |
| 001 | 33 | 190731T060404Z | TheOnlyM |
| 024 | brainfuck | 190731T020156Z | Jo King |
| 009 | Alchemist | 190730T175245Z | Nitrodon |
| 032 | brainfuck | 190726T074458Z | Dorian |
| 007 | Perl6 | 190729T091824Z | Scimon P |
| 001 | Ohm v2 | 190726T075747Z | Cinaski |
| 006 | Underload | 190725T153451Z | Edgex42 |
| 002 | Runic Enchantments | 190513T014203Z | Draco18s |
| 023 | SNOBOL4 CSNOBOL4 | 190503T193946Z | Giuseppe |
| 025 | R | 190503T134040Z | Robin Ry |
| 122 | TinCan | 190503T155353Z | Dehodson |
| 006 | R | 190503T135150Z | Criminal |
| 005 | Javascript ES6 | 190503T100132Z | user8371 |
| 004 | Ahead | 190503T043915Z | snail_ |
| 058 | C++ gcc | 190430T172845Z | movatica |
| 001 | Gol><> | 190430T174740Z | KrystosT |
| 012 | Bash | 190430T174455Z | Beefster |
| 002 | TIBASIC | 190429T192347Z | absolute |
| nan | 190429T162140Z | Ishaq Kh | |
| 006 | C# Visual C# Interactive Compiler | 190429T033814Z | Gymhgy |
| 002 | Husk | 190328T211438Z | Unrelate |
| 004 | PowerShell | 181208T215252Z | GMills |
| 001 | MathGolf | 181206T115544Z | maxb |
| 003 | Z80Golf | 180813T053051Z | Bubbler |
| 002 | R | 180719T184702Z | ngm |
| 008 | Flobnar | 180813T063016Z | Jo King |
| 022 | Pascal FPC | 180813T204830Z | AlexRace |
| 008 | Attache | 180719T204555Z | Conor O& |
| 005 | Red / Rebol | 180719T202628Z | HappySpo |
| 001 | VBA | 170709T132919Z | Taylor R |
| 001 | POSIX bc | 180330T200131Z | Jared K |
| 604 | JsFuck for Firefox 31+ REPL | 180304T043656Z | l4m2 |
| 009 | x86 .COM opcode | 180304T042531Z | l4m2 |
| 001 | Stax | 180303T182250Z | Weijun Z |
| 003 | SmileBASIC | 180303T162041Z | 12Me21 |
| 001 | Pushy | 171220T153649Z | FlipTack |
| 001 | Aceto | 171220T152620Z | qqq |
| 003 | ><> | 171220T063742Z | Jo King |
| 001 | GNU sed | 171220T051758Z | Jordan |
| 004 | NodeJS REPL | 170518T033914Z | Steve Be |
| 001 | Implicit | 170910T035645Z | MD XF |
| 020 | Fourier | 170517T180417Z | Beta Dec |
| 011 | Java OpenJDK 8 | 170518T143025Z | Olivier |
| 001 | MY | 170918T112909Z | Adalynn |
| 007 | Perl | 170521T003501Z | Matt Clo |
| 004 | Google Sheets | 170724T115244Z | Taylor R |
| 002 | Recursiva | 170912T034954Z | 0xffcour |
| 002 | J REPL | 170519T020610Z | Bijan |
| 007 | ROOP | 170905T203419Z | DarkPhan |
| 002 | Cubically | 170809T020559Z | Kamil Dr |
| 011 | Python 3 REPL | 170809T012537Z | totallyh |
| 032 | Pyramid Scheme | 170806T031942Z | Wheat Wi |
| 309 | ArnoldC | 170726T123741Z | V. Court |
| 003 | j | 170721T214610Z | Richard |
| 002 | Common Lisp REPL | 170722T071535Z | dmh |
| 018 | Tcl/Tk | 170721T233436Z | sergiol |
| 002 | j | 170721T215630Z | Richard |
| 019 | C modern Linux | 170517T215451Z | MD XF |
| 010 | Python 3 | 170715T144045Z | Mr. Xcod |
| 002 | Cubically | 170616T183400Z | MD XF |
| 009 | Triangular | 170615T045443Z | MD XF |
| 005 | PowerShell | 170708T195911Z | root |
| 005 | Common Lisp | 170709T093920Z | Renzo |
| 013 | HQ9+ | 170709T014114Z | LyricLy |
| 005 | cQuents | 170708T191444Z | Stephen |
| 007 | R | 170625T110517Z | Ivanneke |
| 012 | C# | 170624T115122Z | Horv |
| 053 | C# | 170624T102115Z | Adola |
| 003 | Check | 170618T050712Z | Esolangi |
| 002 | Add++ | 170609T065737Z | caird co |
| 035 | JavaScript | 170602T153212Z | Raven Co |
| nan | Chip | 170531T215406Z | Phlarx |
| 007 | TIBasic | 170527T141313Z | Timtech |
| 013 | Python 3 | 170527T130312Z | user6986 |
| 036 | Whitespace | 170526T144122Z | Ephphath |
| 006 | MainRamCounter | 170526T190706Z | PowPingD |
| 014 | C Ideone | 170525T080517Z | Anders K |
| 001 | MarioLANG | 170525T193738Z | user6933 |
| 011 | ><> | 170524T192002Z | AGourd |
| 002 | PowerShell | 170525T182259Z | Matt |
| 007 | Perl 5 | 170525T163025Z | Chris |
| 003 | SmileBASIC 3 | 170525T124319Z | snail_ |
| 032 | JavaScript | 170525T120038Z | Jamie Ba |
| 002 | Mathematica | 170525T084731Z | vapor |
| 005 | BotEngine | 170525T005537Z | SuperJed |
| 048 | bash | 170524T173030Z | MD XF |
| 004 | Forth gforth | 170524T113927Z | 2xsaiko |
| 336 | Klein | 170524T062234Z | Martin E |
| 017 | C gcc | 170523T044504Z | Dennis |
| 001 | Microscript | 170523T190935Z | SuperJed |
| 009 | dc bash command line under Linux | 170523T174826Z | Wossname |
| 019 | C modern Linux | 170522T165352Z | MD XF |
| 001 | ZX Spectrum BASIC | 170523T120736Z | Radovan |
| 002 | Bean | 170523T093333Z | Patrick |
| 001 | Pyke | 170523T091334Z | Blue |
| 016 | Ruby | 170523T085606Z | Zaw Hlai |
| 005 | Bash + coreutils | 170523T070235Z | Dennis |
| nan | 170523T041121Z | MD XF | |
| 006 | Batch 6 Bytes | 170522T183546Z | undo |
| 013 | Python 2 | 170522T143746Z | Animesh |
| 001 | charcoal | 170522T034954Z | Destruct |
| 008 | Bash builtins only | 170522T032614Z | Anders K |
| 004 | Carrot | 170521T124653Z | user4180 |
| 010 | Frink | 170518T211358Z | maybeso |
| 008 | REXX 8 Bytes | 170520T221447Z | theblitz |
| 007 | Excel | 170519T134712Z | OpiesDad |
| 002 | Python 3 REPL | 170520T092624Z | boboquac |
| 002 | PARI/GP | 170519T185430Z | Charles |
| 006 | shortC | 170518T021151Z | MD XF |
| 001 | braingasm | 170519T170346Z | daniero |
| 007 | R | 170519T091424Z | user2390 |
| 001 | Aceto | 170518T150716Z | L3viatha |
| 001 | 7 | 170519T021926Z | user6213 |
| 003 | Ruby | 170519T000022Z | addison |
| 001 | Japt | 170518T161400Z | Shaggy |
| 008 | R | 170518T192249Z | MickyT |
| 009 | Brian & Chuck | 170518T195420Z | Martin E |
| 002 | Basic Arithmetic Calculator | 170518T002744Z | AAM111 |
| 010 | Javascript | 170518T175404Z | user6858 |
| 540 | Taxi | 170518T175513Z | Engineer |
| 004 | Cubix | 170517T150729Z | user4854 |
| 022 | OCaml | 170518T160249Z | juloo65 |
| 002 | VBA Immediate Window | 170517T152942Z | Greedo |
| nan | Excel | 170517T160335Z | Greedo |
| 038 | Powershell | 170518T135855Z | Danko Du |
| 009 | Perl 5 | 170518T125924Z | jhx4mp |
| 011 | Bash | 170517T133625Z | Baldrick |
| 001 | Pyth | 170517T163556Z | Jim |
| 001 | V/vim | 170517T164438Z | DJMcMayh |
| 009 | Scala | 170518T051711Z | corvus_1 |
| 070 | Java | 170518T045452Z | Arnaud |
| 001 | TacO | 170518T024329Z | ATaco |
| 005 | Bash + coreutils on 32bit Linux | 170518T022421Z | pizzapan |
| 003 | Python 3 REPL | 170518T002128Z | AAM111 |
| 016 | C# | 170517T221315Z | milk |
| 009 | Python 2 | 170517T120317Z | Luis Men |
| 002 | APL | 170518T001552Z | Uriel |
| 007 | WinDBG | 170517T224000Z | milk |
| 006 | Forth | 170517T212513Z | mbomb007 |
| 011 | Python 2 | 170517T113023Z | Yytsi |
| 010 | Lua | 170517T211735Z | Felipe N |
| 001 | brainbool | 170517T203559Z | Zack C. |
| 011 | Excel | 170517T195801Z | pajonk |
| 008 | MSM | 170517T195504Z | nimi |
| 016 | Haskell | 170517T193724Z | Laikoni |
| 006 | Underload | 170517T193650Z | Martin E |
| 005 | Selfmodifying Brainfuck | 170517T193449Z | Zack C. |
| 009 | Python 2 | 170517T191324Z | Dennis |
| 009 | Stacked | 170517T190818Z | Conor O& |
| 002 | Somme | 170517T190342Z | Conor O& |
| 021 | AWK | 170517T181250Z | Robert B |
| 002 | Befunge | 170517T173812Z | Martin E |
| 015 | Rexx 15 Bytes | 170517T164851Z | theblitz |
| 012 | BrainFlak | 170517T162357Z | Wheat Wi |
| 004 | Fission | 170517T161916Z | Martin E |
| 021 | GNU Make | 170517T133441Z | eush77 |
| 004 | TIBasic TI84 Plus CE OS 5.2+ | 170517T155146Z | pizzapan |
| 005 | Alice | 170517T154522Z | Martin E |
| 007 | Octave | 170517T153537Z | Luis Men |
| 025 | brainfuck | 170517T134315Z | Zack C. |
| 002 | Jellyfish | 170517T144024Z | Martin E |
| 028 | S.I.L.O.S | 170517T143513Z | Leaky Nu |
| 001 | Actually | 170517T143242Z | Leaky Nu |
| 012 | yup | 170517T143209Z | Conor O& |
| 072 | Minimal2D | 170517T142823Z | Conor O& |
| 032 | SQLite | 170517T140146Z | Conor O& |
| 134 | Stack Cats | 170517T140613Z | Martin E |
| 003 | Ruby | 170517T131351Z | G B |
| nan | 170517T134236Z | Brad Gil | |
| 032 | BrainFlak | 170517T133125Z | Riley |
| 030 | brainfuck | 170517T130604Z | Business |
| 002 | QBIC | 170517T114925Z | steenber |
| 001 | Jelly | 170517T112256Z | Jonathan |
| 001 | Fourier | 170517T113344Z | Beta Dec |
| 001 | Bash | 170517T114138Z | Steve Be |
| 001 | Braingolf | 170517T112417Z | Mayube |
| 020 | C | 170517T123151Z | Doorknob |
| 002 | dc | 170517T123047Z | Max Mikh |
| 053 | Python 3 | 170517T122705Z | Leaky Nu |
| 001 | Deadfish | 170517T122657Z | Uriel |
| 001 | TAESGL | 170517T112235Z | Tom |
| 012 | /// | 170517T121729Z | steenber |
| 004 | Pip | 170517T122218Z | steenber |
| 044 | C# | 170517T115048Z | Mayube |
| 002 | Mathematica | 170517T121739Z | ZaMoC |
| 007 | PHP | 170517T113103Z | Mayube |
| 033 | brainfuck | 170517T121033Z | Leaky Nu |
| 003 | Powershell | 170517T120536Z | Danko Du |
| 002 | Charcoal | 170517T114146Z | ASCII-on |
| 017 | JavaScript ES6 | 170517T113519Z | Arnauld |
| 010 | Python 2 | 170517T112318Z | Dead Pos |
| 004 | ><> | 170517T120650Z | Emigna |
| 006 | J | 170517T120458Z | Leaky Nu |
| 003 | Hexagony | 170517T120447Z | Martin E |
| 001 | QBasic 4.5 | 170517T120411Z | steenber |
| 002 | Retina | 170517T115935Z | Martin E |
| 060 | Go | 170517T115539Z | totallyh |
| 012 | Batch | 170517T115557Z | Neil |
| 011 | JavaScript ES6 | 170517T112322Z | Shaggy |
| 082 | Java | 170517T114831Z | Leaky Nu |
| 009 | Javascript ES6 | 170517T112648Z | Weedoze |
| 005 | Ohm | 170517T114523Z | Linnea G |
| 001 | Brachylog | 170517T114045Z | Fatalize |
| 001 | 05AB1E | 170517T112034Z | Okx |
| 017 | PHP | 170517T113550Z | Okx |
| 004 | Labyrinth | 170517T113512Z | Martin E |
| 001 | Cjam | 170517T113450Z | Linnea G |
| 009 | JavaScript ES6 | 170517T112146Z | Stephen |
| 002 | MATL | 170517T111950Z | Luis Men |
Mornington Crescent, 1537 1354 1084 449 354 bytes
Take Northern Line to Bank
Take Circle Line to Great Portland Street
Take Circle Line to Paddington
Take District Line to Paddington
Take District Line to Paddington
Take District Line to Paddington
Take District Line to Paddington
Take Circle Line to Paddington
Take Circle Line to Bank
Take Circle Line to Bank
Take Northern Line to Mornington Crescent
SAKO, 22 bytes
1)LINII22
STOP1
KONIEC
Prints 22 newlines. I believe this is the shortest possible version, because LINIA is the shortest output instruction I can think of.
Subroutine version is the same length
PODPROGRAM:F()
LINII22
Bespoke, 16 bytes
Bespoke program.
Prints Stack underflow. to STDERR.
Alternate version, 47 bytes
"Hey, so can I do some modified way?" stated I.
Prints 31^31, which is 47 digits long.
Befalse (quirkster), 8 bytes
:::: 9.;
Prints eight tab characters. 9. is the "loop body", and the leading :s increase the loop count as in the Fibonacci sequence (similar to Hello world trick). A space before 9 is necessary to ensure the last : executes the loop body twice in full.
Swift, 25 bytes
for i in 0...11{print(i)}
Prints the numbers 0 to 11 with trailing newlines.
GNU calc, 2 bytes
~3
Outputs -4, the logical NOT of 3.
There's actually a ridiculous amount of quines in GNU calc (any plain number will do the trick), and a slightly fewer amount of non-quines that meet this challenge's requirements. This is a short non-quine.
///, 12 bytes
/a/bb/aaaaaa
Outputs bbbbbbbbbbbb. Explanation:
/a/bb/ Replace each a with bb
aaaaaa 6 a's -> 12 b's (Implicit output)
Alternate program, also 12 bytes with same output:
/a/bbbbbb/aa
ForWhile 6 bytes
6(48#)
prints 6 zeros
5(9#)
would print 5 tabs (but tab is not an allowed character)
Explanation
6( \ start for-loop with 6 iterations
48# \ print 0
) \ end for-loop
JavaScript REPL, 2 bytes
~0
So, apparently there is a limit to how small your submissions can be. Typing words here so I can submit. \$\$
Vyxal, 4 bytes
kSĖ
There’s a trailing space.
Click the sus image below to Try It Online!™

Explanation
kSĖ
kS # Push the character 'ඞ'.
Ė # Execute the top of the stack as Vyxal code.
# Just a space
# When 'ඞ' is run as Vyxal code, it prints the string 'sus' with a newline.
💎 Created with the help of Luminespire at https://vyxal.github.io/Luminespire
(,) 81 65 48 Chars or \$48\log_{256}(3)\approx\$ 9.51 Bytes
Thanks to @Leo for -17? chars!
(,,(),,(),,((),()()()()()()()(),,,(),,()()()()))
(Assuming by same number of bytes you mean same number of chars)
Tio
Python REPL, 4 Bytes
9**4
\$9^4=6561\$
Ly, 1 byte
y
Pushes the size of the stack onto the stack, then exits. Entries on the stack are printed as numbers by default. Outputs 0.
2Col, 2 bytes
=0
Output:
0
Zero, with a trailing newline
Explanation:
No input, therefore Cell initializes at 0
=0 Set Cell value to 0 and return Cell value
Implicit: Print return value followed by a newline
Thunno, 1 byte
+
Prints \$0\$. Also works in Thunno 2: Attempt This Online!
Thunno, \$ 2 \log_{256}(96) \approx \$ 1.65 bytes
Z1
Constant for \$10\$
Others include:
aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR
which are constants for \$10\$, \$15\$, \$20\$, ..., \$95\$.
Aheui (esotope), 30 bytes
받발땨희빠챠뎌뱧볗멍
Prints 15 copies of -1.
Aheui (esotope), 30 bytes
밤발땨희빠챠명뱧뼈더
Prints 191817161514131211109876543210, i.e. a countdown from 19 to 0 without spaces.
How these work
Aheui is a 2D language with Hangul characters. Each Hangul character consists of an initial consonant, a vowel, and an optional final consonant. In Aheui, the initial consonant defines the instruction, the vowel defines the next movement, and the final consonant provides an argument to the instruction (when necessary).
Aheui comes with multiple stacks and a queue, but the programs above are simple enough that they only operate on a single stack.
Relevant consonants:
- Initial consonant ㅂ: Pushes a constant or a value from stdin.
- Final consonant ㄷ, ㄹ, ㅁ: Pushes 3, 5, 4 respectively.
- ㅎ: Reads a UTF-8 character from stdin and pushes its value. On EOF, pushes -1.
- Initial consonant ㄷ, ㄸ: Pops two values and pushes the sum and product respectively.
- ㅃ: Duplicates the top value.
- ㅁ: Pops a value, and prints as integer if the final consonant is ㅇ.
- ㅊ: Pops a value. If it is 0, the next movement is reversed.
- ㅎ: Halts the program.
Relevant vowels:
- ㅏ, ㅓ, ㅗ, ㅜ: Move in the direction of the short stroke by 1 cell.
- ㅑ, ㅕ, ㅛ, ㅠ: Move in the same direction, but by 2 cells (jumping over a cell).
The two-cell movements allow simple loops to be encoded in a single line, and each character encoding both the instruction and the movement allows more flexible arrangement of code fragments.
받발땨희빠챠뎌뱧볗멍
받발땨
push 3; push 5; mul (i.e. push 15); enter loop with this loop counter
빠챠
if the current loop counter is 0, direct to 희 and halt
뱧 멍 볗 뎌
push -1, print, push -1, add
밤발땨희빠챠명뱧뼈더
밤발땨
push 4; push 5; mul (i.e. push 20); enter loop
빠챠 (same as the other program)
뱧 더 뼈 명
push -1, add, dup, print
More info can be found in the language spec.
in floop, 2 bytes
;;
I seriously doubt it's possible to do anything more complex than this, as in floop's only output method is by halting.
Halfwit, 1 byte
><
The compressed integer 0, which currently prints 0n.*
*I'm going to change this soon
Other interesting approaches:
Halfwit -A, 2 bytes
4+
The -A flag turns characters into bytes. 4 is a predetermined constant [0, 1] and + is a NOP here.
Halfwit -A, 3 bytes
>;<M>f
This is Mapping 3 (>;<) (converted to a range 1, 2, 3 on map) to 8 (>f), which then gets turned into characters and output.
Backhand, 1 byte
h
Immediately halts, printing the top of the stack (if empty, 0) as a number.
Backhand, 4 bytes
v11H
Somewhat more interesting one which actually uses Backhand's execution nature. Prints four copies of ASCII 1; the 1s can be changed to any of 0-9a-f to print ASCII 0-15 characters.
v11H initial step = 3
v → reduce step size to 2
1 → push 1
1 ← bounce off and push 1
v reduce step size to 1
11 → push 1 twice
H halt, printing the entire stack as a string
Python 3, 13 12 bytes
print(2**-9)
Output:
0.001953125
Old:
print([1]*4);
Output:
[1, 1, 1, 1]
-1 Thanks to aeh5040! With this, the unneeded semi-colon could be removed as the output is 11 bytes + white space
A list printed in python would have the length of 2 + 3 for each extra element plus the new-line, thus with 1*n we can have any multiple of 2+3n. A semi-colon is added because unfortunately print adds a new-line character, and I've yet to find a better solution
4, 39 bytes
3.6003960133602328000000002500100000194
How it works:
3. Start of the program.
6 00 39 Sets cell 00 to 39.
6 01 33 Sets cell 01 to 33.
6 02 32 Sets cell 02 to 32.
8 00 While cell 00 is not zero:
0 00 00 02 Sets cell 00 as the addition of cells 00 and 02.
5 00 Gets the value of cell 00 and prints it as UNICODE character.
1 00 00 01 Sets cell 00 as the subtraction of cells 00 and 01.
9 End loop.
4 End of the program.
I avoided printing ASCII characters below 0x20, as the rules demanded. Otherwise, if one does not care for the nonprintable ASCII chars, it could be as simple as follows:
4, 27 bytes
3.60056 60101 800 500 1000001 9 4
Spaces kept for readability. Prints 0x56 to 0x00.
experimental-type-lang (63 bytes)
Here's a solution in a weird (and not very good) language I made:
type R<E,C>=C extends63?E:R<[...E,32],[...C,_]>;[51224,R<[],0>]
Output:
0> " "
I'm not counting the 0> output prefix and quotes as part of the program output in this case (the quotes appear whenever the output is a string, and the output prefix is added for every evaluated expression), but if I wanted to count that I could just adjust the value 63 to be the desired output string length.
Explanation
Here's an expanded version:
type Loop<Result = [], Counter = 0> = Counter extends 63
? Result
: Loop<[...Result, 32], [...Counter, _]>;
// The evaluated expression
[51224, Loop<>];
In this language, strings are arrays where the first item is a magic number indicating to the evaluator that it should be displayed as a string, and the second item is an array of character codes. The Loop function (called a type because I wanted to make the syntax resemble the TypeScript type system) is responsible for generating this array of characters. It does this by recursively calling itself, adding 32 (the code for a space) to a result array with the spread operator, until a counter reaches the desired output length. In experimental-type-lang, numbers are just arrays of "items" (represented by a _) with the length being the numerical value; because there is no language-level add operator and importing the Add type from the standard library would take too many characters, I increment the counter by spreading it into an array and adding an _.
Javascript REPL, 9 bytes
`${8**9}`
outputs the string
134217728
console.log(`${8**9}`)
Well, i like it
Javascript REPL, 8 Bytes
same approach 1 byte less
`${8e7}`
outputs the string
80000000
console.log(`${8e7}`)
AWK, 19 16 bytes
END{print 69**8}
Thanks to Jo King for the pointer that cut 3 chars...
AWK is a bit of a pain for this one since the minimum code required to run without any input and print something is END{print }. So this one just prints a number that's enough digits to match the program size less one, since the print adds a linefeed. The output is 513798374428641\n.
Ruby 3, 6 bytes
p ?c*3
Prints "ccc" with a trailing newline to get a 6-byte response.
Lean Mean Bean Machine, 28 bytes
/O
)O4
?7/
*
_~
o
~ :
u
Outputs 27 1s followed by a trailing newline.
Unfortunately I had to fix a bug in LMBM with the o peg for this answer to work. The link above links to the entire LMBM interpreter, with the fix, contained in TIO's header/footer, with the LMBM code in the code section.
Explanation
The code is a loop. Here's the setup:
/O
O4
7/
*
~
This creates 2 marbles, sets one to 4 and the other to 7, then multiplies them into a single marble with a value of 28. Finally the ~ pushes the marble up to the top of that column, where the top / pushes it into the loop.
)
?
_
o
~ :
u
This is the loop. ? is a conditional that sets the marble's spin to right if its value is truthy (non-zero), and 0 otherwise.
) decrements the marble's value. We do this before the conditional to account for LMBM's trailing newline.
_ pushes the marble in the direction of its spin. This is the exit condition for the loop. If the marble's value was not truthy, ie 0, this pushes the marble to the left, out of bounds. Out of bounds marbles are automatically destroyed. When all marbles are destroyed, the program terminates.
o is a split. It splits the marble, pushing one copy left and the other right.
The left marble hits ~, which pushes it back up to the top of the loop.
The right marble hits :, which sets its value to its spin (1 for right, 0 for left), then it falls into u, which prints the marble's value and destroys it.
JavaScript, 5 bytes
f=
x=>!1
console.log(f());
Klein 110, 7 5 bytes
Thanks to Martin Ender for saving two bytes!
1.
2@
If we unfold the topology here we get
1.122@
This outputs 1 1 2 2 with a trailing newline.
tinylisp, 3 bytes
(q(
Explanation
After parenthesis autocompletion, the code is (q()). The q macro prevents evaluation of its argument, which in this case is the empty list (). So the program outputs (), with a trailing newline.
C# (Visual C# Interactive Compiler), 14 bytes
_=>new[]{1}+""
Found interesting way to shave some bytes. Outputs: System.Int32[]
First way: 23 bytes
()=>new string('@',23);
Creates a new string consisting of 23 @ characters
Swift, 36 bytes
print(String(repeating:" ",count:36))
Red, 32 bytes
i: 1 until[prin i: i + 1 i > 20]
Sets i to 1, then increments i and prints it without trailing newlines until i is greater than 20. This prints the numbers [2..21] without delimiters, an output 32 characters long.
Pxem, 0 bytes (content) + 3 bytes (filename).
- Filename:
d.n - Content is empty.
- Outputs
100(if ascii-compatible environment).
Scratch, 64 bytes
define
set[a v]to[
repeat[4
set[a v]to(join(a)([e ^ v]of[2
say(a
Uses scratchblocks syntax.
HTML (w3m -dump), 4 bytes
<s>
It outputs
[S:
Both source code and output contains a trilling new line.
Deadfish, 1 byte
o
Outputs 0. In Deadfish~, c outputs a NULL byte.
Rust, 30 28 bytes
fn main(){print!("{:28}",0)}
Prints zero, padded with enough spaces so that it is 28 bytes long.
Perl 5, 6 bytes
say $~
From the Perl documentation:
$~The name of the current report format for the currently selected output channel. The default format name is the same as the filehandle name. For example, the default format name for the STDOUT filehandle is just STDOUT .
Well, uh...
Mornington Crescent, 1731 bytes
Take Northern Line to Stockwell
Take Victoria Line to Seven Sisters
Take Victoria Line to Green Park
Take Piccadilly Line to Green Park
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to Russell Square
Take Piccadilly Line to King's Cross St. Pancras
Take Metropolitan Line to King's Cross St. Pancras
Take Hammersmith & City Line to King's Cross St. Pancras
Take Hammersmith & City Line to King's Cross St. Pancras
Take Hammersmith & City Line to King's Cross St. Pancras
Take Hammersmith & City Line to King's Cross St. Pancras
Take Hammersmith & City Line to King's Cross St. Pancras
Take Hammersmith & City Line to King's Cross St. Pancras
Take Hammersmith & City Line to King's Cross St. Pancras
Take Hammersmith & City Line to King's Cross St. Pancras
Take Circle Line to King's Cross St. Pancras
Take Circle Line to King's Cross St. Pancras
Take Circle Line to Bank
Take Circle Line to Bank
Take Northern Line to Mornington Crescent
Prints out the value of 7^2048, which is 1731 digits long. Try it online! Verify that it's actually 1731 digits long!
Python 3, 29 bytes
s='s=%r;print(ss)';print(s%s)
Output
s='s=%r;print(ss)';print(ss)
A more quine-like answer than this answer
naz, 2 bytes
2o
Outputs 00.
Quite similar to my answer for Create output twice the length of the code.
Wren, 2014 bytes
Fn.new{"1"*14}
Explanation
Fn.new{ } // Anonymous function
"1"*14 // Returning the string "1" repeated 14 times
Or, 5 bytes
fals
This returns false (this should be a five-character constant) onto the stack, which can be used later in the program (or not really, none of the current known instructions in Or access non-top items).
Explanation
From the IRC log:
14:01 < fungot> mroman_: the command to push false is ' f'
Since fungot had not yet presented the full language, all that we know in the current interpreter is that extra instructions do nothing.
f Push false onto the stack
als All of those are recognized as NOPs in the current implementation.
Go, 22 bytes
func f(){print(0., f)}
On my machine, this prints
+0.000000e+0000x477c88
But the compiler could conceivably allocate f at an address other than 6 hex digits. If you don't like an implementation detail like that, the next best thing is the 26-byte
func f(){print(0.,1<<34)}
which prints
+0.000000e+00017179869184
Keg, 1 byte (SBCS)
🄂
Now before you say "Hang on a second, that's 2 bytes: a 1 and a ,", it isn't. Unicode has these really nice symbols where they have a number and a comma combined. It push'n'prints the number 1, the length of the program.
Just don't go pasting this into programs like IDLE and tkinter... they don't particularly like 🄂.
Dash/Bash/ksh/fish, 5 bytes
umask
Try it online (Dash) | Try it online (Bash) | Try it online (Ksh) | Try it online (Fish)
umask is a builtin in most unix shells, not an external command! It prints the 4-octal-digit umask followed by a newline for a total of 5 bytes.
Does not work in Zsh or Tcsh: Zsh will only print one leading zero (e.g.: 02 instead of 0002), and Tcsh will print no leading zeroes (2 instead of 0002)
AsciiDots, 8 bytes
.v.
(*$#
This starts with two dots, then duplicates them both, and then outputs all of their values. Might be golf able down to 6 bytes
C#, 84 bytes
public class P{public static void Main(){System.Console.Write(new string('_',84));}}
Zsh, 5 bytes
<<<$-
Prints 569X followed by a newline.
Try it online!
The parameter $- outputs the current flags supplied to the shell. By default, it is set to 569X:
5: NOTIFY6: BG_NICE9: AUTO_LISTX: LIST_TYPES
When unsetting these options, $- is empty.
Bash on Linux, 6
uname
(followed by a newline)
Outputs Linux followed by a newline.
Pyramid Scheme, 74 43 42 bytes
Saved 31 bytes thanks to Khuldraeseth na'Barya! Saved 1 byte thanks to JoKing's redesigned solution!
^
/^\
^---^
-^ ^-
-^-
/2\
/ 8 \
-----
Try it online! Outputs the 41-digit number 28^28 = 33145523113253374862572728253364605812736, followed by a trailing newline.
Old version
^
/ \
/out\
-----^
/^\
^---^
/1\ /9\
/606\---
/51015\
-------
Outputs 71277303925397560663333806233294794013421332605135474842607729452115234375 = 160651015 ** 9, or about 1074.
Pyramid Scheme, 32 bytes
^ ^ ^
-^-^-
^-^-
-^-^
^-^-
- -
Outputs 16 zeroes and newlines. I can find a lot of alternative 32 byters with varying amounts of extra padding, but the closest I can come to something shorter is this 27 byte program that outputs 26 bytes
8086/8088 machine code, 6 bytes
b8 21 21 mov ax, 2121 Load 0x2121 into AX.
ef ef ef out [dx], ax (x3) Output AX (2 bytes) to port [DX], 3 times.
Assumptions:
- The output may be sent to I/O port 0.
- DX is initialized with 0.
Joke answer:
ee out [dx], al Output AL (1 byte) to port [DX].
Assumptions:
- The output may be sent to I/O port [DX], whatever that is.
- AL is initialized with an ASCII character.
33, 1 byte
o
Prints 0, the default value of the accumulator.
i also works, printing a trailing newline.
brainfuck, 24 bytes
-[>+<---]++++++[->....<]
Prints 24 Us.
Explanation:
-[>+<---] # Generate a U
++++++[ # Loop 6 time
->....<] # Printing U 4 times each
Alchemist, 9 bytes
_->9Out__
Uses up the initial _ atom to output the number of _ atoms remaining (0) nine times.
brainfuck, 15 32 bytes
++++++++[>++++>++++<<-]>+>[<.>-]
Illegal version (no ascii), 15 bytes
->+++++[<...>-]
Perl6 12 7 bytes
say |^6
Prints the number from 0-5 and a newline for 7 bytes. Suggested by Jo King.
Original
.say for ^7
Ohm v2, 1 byte
‰
‱
or
Ohm, 1 byte
º
or
°
Explanation
In Ohm if a component requires an input but no inputs are provided a 0 is implicitly pushed to the stack, so the output is 20 for the first program (in each version) and 100 for the second.
Underload, 6 bytes
()aaaS
Outputs ((())), since a just puts brackets around the top item of the stack.
Runic Enchantments, 2 bytes
m@
One of several possible programs that satisfies the challenge. This one is just the least obvious. Rather than pushing a value literal (a-f) to the stack, instead push the current value of the IP's energy/mana to the stack (which is initially 10).
1 byte solutions are impossible as Runic requires an output byte and a termination byte (both satisfied by @) as well as a Thing-To-Print byte (m).
R, 25 bytes
sprintf("%.23f",runif(1))
Outputs (as a string) a random number between 0 and 1 with 23 decimal places, e.g.
0.84327139146625995635986
This is 25 characters overall, counting the initial 0.
There are shorter R solutions, but I wanted to post one with randomness since the challenge allows it explicitly.
TinCan, 122 bytes
# 31135, A, & #
# -256, A, -1 #
# 0, A, 1 #
Outputs 122 'a's.
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Explanation:
Lines have a minimum length of 40 characters in TinCan, and there is only one instruction, so 40 bytes would be the shortest feasible TinCan program other than an empty file.
TinCan's interpreter is written in PHP and uses the PHP chr function to output the character value of each number on the stack when the program ends. This also works for values outside the range of 0 to 255, using bitwise and with 255 to get the result.
For this program, I multiplied the length of the program (122 bytes), minus one for the positive case, times 256 and added (256 - 97), 97 being the ASCII value of 'a'. This gives 31135.
The loop then generates a sequence of values starting at -31135 and counting upwards by 256 each iteration. Each value in sequence when processed by chr produces another 'a'. When the variable A becomes positive, the program exits and prints 122 'a's.
With the fixed line length, golfing this down would require removing one whole instruction, which I don't believe is possible. But I'd be happy to be proven wrong!
R, 6 bytes
seq(1)
I think we've covered all the other types of R answer already, but this one counts the print method's [1] and trailing newline. There might be some counting technicalities here.
Javascript (ES6), 5 bytes
!1+''
outputs the string "false".
Ahead, 4 bytes
Prints 0000.
4kO@
4k 4 times
O pop stack and print
@ end
The empty stack always pops 0.
Gol><>, 1 byte
h
Surprisingly easy, "h" pops off a number from the stack and prints that number, then ends the program. If there is no number then by default outputs 0.
Bash, 12 bytes
yes|head -n6
outputs 6 lines of ys (6 ys, 6 newlines)
Python 3 only 3 bytes.
Type 01. in Python 3 interpreter and get 1.0 output.
MathGolf, 1 byte
!
For MathGolf, there is an implicit pop if nothing is on the stack and nothing is in the input. The operator will pop the default value for the type it's requesting, which is either 0, [] or "". That means that a lot of operators will pop implicit zeros from the empty stack, and transform them either into 0 or 1. There are 15 1-byte programs which satisfy the criteria of this challenge, most of them output 0. The rest output 1.
Output 0
*: 0
+: 0
,: 0
-: 0
.: 0
<: 0
>: 0
f: 0
i: 0
w: 0
x: 0
Output 1
!: 1
#: 1
): 1
=: 1
Z80Golf, 5 3 bytes
00000000: 3e76 34 >v4
The output is vvv. Yay for ASCII-printable machine code!
Disassembly
start:
ld a, $76 ; 3e 76
inc (hl) ; 34
Uses the same concept as the 5-byte one: edit the running code on the fly, and abuse stack underflow.
The program initially loads 'v' to register a, and increments the value at the memory address (hl), which is $0000 where the code $3e is located. Then the code becomes:
ccf ; 3f ; Complement carry flag, effective no-op in this program
halt ; 76
inc (hl) ; 34
So the halt is uncovered right away. The stack underflow magic takes the next job; putchar's ret returns to $763f, $0034, and $0000 in the order, and three vs are printed in the process. Now pc is back at the start of the program. ccf is no-op, halt is executed, and the program terminates.
A variation, 4 bytes
00000000: 3e76 343b >v4;
The output is vvvv.
Disassembly
start:
ld a, $76 ; 3e 76
inc (hl) ; 34
dec sp ; 3b
The added dec sp makes things slightly more convoluted; the stack is arranged so that putchar is run 4 times instead of 3. Without the instruction, the return addresses are $763f - $3b34 - $0000; with it, the addresses are $3e00 - $3476 - $003b - $0000.
Leaving this solution here, in case someone finds the "stack misalignment" technique useful.
Previous solution, 5 bytes
00000000: 2e0a 3e76 34 ..>v4
Disassembly
start:
ld l, $0a ; 2e 0a
ld a, $76 ; 3e 76
inc (hl) ; 34
The second instruction sets up the character to print, which is 'v'. The rest increases the value at the memory address $000a.
The output is vvvvv. Too bad it's not in uppercase (and it's not six v's), otherwise I'd reference the game VVVVVV.
How it works
For no-input challenges, underflowing the stack into the code is a standard technique in Z80Golf. It is done by letting the PC flow beyond the end of the code, so that putchar at address $8000 is reached, a char is printed, and ret is executed.
- When the code section is run the first time, the instruction at memory
$000abecomesld bc, $0000 (opcode $01 $00 $00). Pretty much no-op, since all registers are zeroed when the program starts.putcharis reached andvis printed once. Then it returns to$0a2e. putcharis run again,vis printed, and the next return address is$763e.- Same thing again, return to
$0034. - Same thing again, finally return to
$0000, the start of the code. - The code is run again; the instruction at memory
$000ais nowld (bc), a (opcode $02).ais$76, so the value is written to memory$0000. Afterputcharis reached this time, return to$0000again, and PC meets the new instruction$76which is...halt! The program ends.
R, 3 2 bytes
-T
Outputs:
-1
Old 3 byte answers:
Many examples, such as:
1/0
F/F
3^6
Outputs respectively:
Inf
NaN
729
Flobnar, 9 8 bytes
*<*@
9*<
Outputs 43046721, which is 98. This uses the -d flag to output in decimal. Thanks to Esolanging Fruit for this solution
Pascal (FPC), 22 bytes
begin write('':22)end.
:22 pads the write value to be at least 22 characters in length. Here, the write value is an empty string, so this prints 22 spaces.
Attache, 8 bytes
!11|Echo
Other programs
9^8|Echo
!11|Echo
3|Echo//3
$A*10|Echo
Echo[$A*11]
$A*10|Print
Print[$A*11]
Echo//3 <|[]
Print//3 <|3
{_!_[0:1]}!Print
Red / Rebol 5 bytes
1 > 2
Prints:
false
VBA, 1 Byte
A surprisingly short answer for VBA
Anonymous VBE immediate window function that takes no input and outputs a single linefeed (vbLf) to the immediate window
?
Output
(A single linefeed)
POSIX bc, 1 Byte
a
output:
0
Explanation: If you type a variable name it prints the value. Variables you haven't yet defined have the value zero.
JsFuck for Firefox 31+ REPL, 604 bytes
[][([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]+[+[]]
]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[!![]+!
![]+!![]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!
![]+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]
])[+!![]+[+[]]]+([][[]]+[])[+!![]]+(![]+[])[!![]+!
![]+!![]]+(!![]+[])[+[]]+(!![]+[])[+!![]]+([][[]]+
[])[+[]]+([]+[][(![]+[])[+[]]+([![]]+[][[]])[+!![]
+[+[]]]+(![]+[])[!![]+!![]]+(![]+[])[!![]+!![]]])[
!![]+!![]+!![]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+
[]]+([![]]+[][[]])[+!![]+[+[]]]+(![]+[])[!![]+!![]
]+(![]+[])[!![]+!![]]])[+!![]+[+[]]]+(!![]+[])[+!!
[]]](+(!![]+!![]+!![]+!![]+!![]+!![]+[+[]]+(+[])))
+![]
x86 .COM opcode, 9 Bytes
0100 B409 MOV AH,09
0102 BAFF00 MOV DX,00FF
0105 CD21 INT 21
0107 C3 RET
0108 24 DB '$'
Stax, 1 byte
æ
Bytes counted in CP437.
Just the packed version of the program 1. Not surprisingly the output is also 1. Since it is packed it is not a quine and is a valid answer.
SmileBASIC, 3 bytes
?#Y
Output:
128
#Y is a constant used for checking the (Y) button, and has a value of 128.
Pushy, 1 byte
_
Outputs a newline and nothing else.
This works not just with an underscore, but any character from: Qq'_"# (because these are all printing based commands, but there is nothing to print).
NodeJS REPL, 4 bytes
Did someone say REPLs are languages?
*;;;
→ ..._
(the underscore is actually a space character).
For anyone not familiar with the Node REPL, it thinks my program isn't complete, so it's prompting for the rest of the line.
Implicit, 1 byte
#
Pushes the length of the stack to the stack. Implicit output. Try it online!
1 byte alternatives
ßprints a space.±,$,+,-,*,/,_, and^all push 0 if the TIO input box is empty.
Fourier, 26 22 20 bytes
5^(`na`&i)` Batman!`
Outputs:
nananananana Batman!
For proper capitalisation, it's 4 extra bytes:
`N`7^(`an`i^~i)`a Batman!`
Nanananananananana Batman!
Java (OpenJDK 8), 11 bytes
o->1e8-1+""
Output:
9.9999999E7
Just a tad more elaborate than the obvious answer, ()->"".format("%23s",0).
Saves
- 18 -> 16 bytes: More advantageous combination of rounding and power of 10, thanks to PunPun1000
- 16 -> 13 bytes: better formula, thanks to JollyJoker
- 13 -> 11 bytes: improved formula, thanks to Kevin Cruijssen
Perl, 8 7 bytes
print$␖
The seventh byte of this program is the control character \x16, which I can't put literally into the writeup. A hexdump of the source is 70 72 69 6e 74 24 16.
Output is something like v5.20.2 on the standard output. The exact output depends on the exact version, but almost always 7 characters in practical situations. There is no newline or whitespace in the source code or output.
Note that running this code also prints a long mandatory warning message to the standard error. If I understand correctly, that message is ignored by the golf rules.
One byte longer (but all printable) is this program:
;print**
The semicolon is there to pad the code to the same length as the output. The output is *main::*
Google Sheets, 9 4 Bytes
Google Sheets spreadsheet formula that takes no input and outputs a string of length 4 (output value := 1024 or 1000) to the spreadsheet cell that holds the formula.
=4^5
Or
=XE3 '' s.t. `x` is an integer in the range 1 To 9
--
Alternatively, 9 Bytes
Google Sheets spreadsheet formula that takes no input and outputs a string of length 9 to the spreadsheet cell that holds the formula.
=Rept(1,9
ROOP, 7 bytes
/rn/
ha
print IVXLCDM
The constant rn represents the string containing the Roman numerals.
The h operator terminates the program and prints all existing objects. The a operator is only to reach 7 bytes (there is no constant that has 6 characters).
Cubically, 2 bytes
%5
Prints the sum of all values on face 5. Face 5 is initialized to
555
555
555
so this prints
45
(Other valid answers: %2,%3,%4)
Python 3 REPL, 11 bytes
str(...)[:]
Try it online! The header and the footer emulate a REPL.
This prints:
'Ellipsis'
Pyramid Scheme, 32 bytes
^ ^
-^-
^-^
-^-
^-^
-^-
^-^
- -
Explanation
This may not look like pyramid scheme but it is. Each triangle looks like:
^
-
This performs one of three operations
If it has 2 args it pairs them together
If it has 1 arg it returns it
If it has 0 args it returns
0
So at the bottom we have two zeros, those are linked on the next level. On the next level two different pyramids grab the pair and then those pairs are paired together. This continues all the way up the pyramid. When we get to the top we have:
((((0,0),(0,0)),((0,0),(0,0))),(((0,0),(0,0)),((0,0),(0,0))))
Pyramid scheme's implicit output converts this to 16 zeros separated by newlines. That's 32 bytes.
ArnoldC, 309 bytes
Easy.
IT'S SHOWTIME
HEY CHRISTMAS TREE S
YOU SET US UP 1
HEY CHRISTMAS TREE T
YOU SET US UP 0
STICK AROUND S
GET TO THE CHOPPER T
HERE IS MY INVITATION T
GET UP 1
ENOUGH TALK
TALK TO THE HAND "SS"
GET TO THE CHOPPER S
HERE IS MY INVITATION 103
LET OFF SOME STEAM BENNET T
ENOUGH TALK
CHILL
YOU HAVE BEEN TERMINATED
Note the double space between HERE IS MY INVITATION and 103 to have the good amount.
Golfable.
j, 3 bytes
i.2
output...
0 1
(3 bytes including space)
Common Lisp REPL, 2 bytes
'a
returns a followed by a newline
Tcl/Tk, 18
pack [text .txt 1]
ouputs
unknown option "1"
j, 2 bytes
!4
returns 24 (factorial 4)
C (modern Linux), 19 bytes
main(){puts('s');}
When compiled and run, this prints:
Segmentation fault
Cubically, 2 bytes
%5
Try it online! Boring. Outputs 45. Also works with %4 (36), %3 (27), and %2 (18).
Cubically, 7 bytes
+5*66%6
Try it online! Outputs 4100625 by adding 45 to the notepad, then squaring it twice.
Cubically, 9 bytes
+5*5555%6
Try it online! Outputs 184528125 by adding 45 to the notepad, then multiplying it by 45 four times.
Triangular, 9 bytes
9.(,%<>d]
Formats into this triangle:
9
. (
, % <
> d ] ÿ
Triangular auto-inserts ÿ wherever there is no source code to fill the smallest triangle.
Without control flow, the program looks like 9(%d]. Explanation:
9- push 9 to the stack(- open loop%- print top of stack as integerd- decrement top of stack]- jump back to(if top of stack is truthy
Common Lisp, 5 bytes
1e+01
in the Common Lisp REPL it produces 10.0 plus linefeed, for a total of 5 bytes.
Thanks to @MartinEnder for noting an error in the previous 4 bytes version!
HQ9+, 13 bytes
haaaaaaaaaaaa
Prints:
Hello, world!
The instruction "h" in HQ9+ will print "Hello, world!" and any instruction that is not "h" "q" "9" or "+" will be ignored.
You might want to know why this language exists, and why I'm answering this question with it.
Why not?
cQuents, 5 bytes
#3::$
Outputs 1,2,3. This works because of the mode, ::. :: prints the sequence up to n, which in this case is hardcoded in as 3. $ prints the current index - it could be replaced with any single digit. So, the interpreter prints out the first three items in the $ sequence, separated by the default delimiter, ,.
R, 7 bytes
mode(T)
Prints "logical"
C#, 12 bytes
()=>1e11+"";
It returns 10^11, which is a 1 followed by 11 0-s, so 12 bytes long.
C#, 53 bytes
Not short, but good enough:
string a="1";for(int i=0;i<53;i++){Console.Write(a);}
Some Facts I can't resist to post:
Fifty-three is the 16th prime number. It is also an Eisenstein prime, and a Sophie Germain prime.
53 cannot be expressed as the sum of any integer and its base-10 digits, making 53 a self number.
53 is the smallest prime number that does not divide the order of any sporadic group.
JavaScript, 35 bytes
Source:
console.log(([]+[])["constructor"])
Output:
function String() { [native code] }
Chip, 78+3 = 81 bytes
Flag: -w
Code (Try it online!):
g*
,xZ.
`@'|
,xZ<
`@'|
,xZ<
`@'|
,xZ<
`@'`.
,xZ~<
`@','
,xZ^.
`@'t{*
,xZ~'
`@'
Out: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
This uses a binary counter to halt at the correct time.
11+3 = 14 bytes (uses version string)
Flag: -V
Code (anything will do, just need to fill the length):
gibberishes
Out (current interpreter, has trailing newline):
chip.py 0.1.2
40+3 = 43 bytes (error message, uses stderr)
Flag: -w
Code (apparently some of this is filler?):
!*T :Hello you! That shirt looks great!;
Out: 1:1 WARN: '!' (33) is not a valid character
TI-Basic, 7 bytes
(Ab)using the fact that Done is displayed when nothing is evaluated on the last line. Lowercase letters are two bytes each in TI-Basic.
Repeat 1337:End
Python 3, 13 bytes
print("a"*13)
Outputs "aaaaaaaaaaaaa"
Whitespace, 36 bytes
Generates the output "-15-14-13-12-11-10-9-8-7-6-5-4-3-2-1" (36 characters without quotes, no trailing newline)
Explanation
Pushes the number -15 onto the stack (encoded in binary as 01111, with a leading 0 for padding to match the output) then counts toward 0 outputting the current number each iteration.
Starting from a negative number gives an extra byte of output per iteration and also allows me to use a jump while negative instruction to fall through the loop and exit implicitly. That single padding byte in the code is a downer though but solutions without it are longer.
MainRamCounter, 6 bytes
"a"e6R
This is a new language I am currently developing. It is based off of 3 storage spaces: Main (which does comparisons and math), Ram (which stores values), and counter (which is a counter).
Breakdown:
"a" push 97 to ram
e6 duplicate current ram 6 times
R output ram as string
Output:
aaaaaa
C (Ideone), 14 bytes
f(){warn(0);}
On Ideone, which names its executable prog, this outputs the following with a trailing newline.
prog: Success
C (GCC), 15 bytes
f(){warn(00);}
Because GCC writes an executable named a.out by default (in the absence of additional flags that would cost bytes), this outputs the following with a trailing newline.
a.out: Success
PowerShell, 2 bytes
+1
The upvote program. This give the output of 1 and a trailing newline to get 2 bytes. I am unsure if the operation is adding 1 to nothing or if it is rendering the positive integer of 1. Either way the result is the same.
Perl 5, 7 bytes
say$"x6
$" contains a space by default, and x6 duplicates it six times. say prints and adds a newline, so this prints six spaces followed by a newline.
SmileBASIC 3, 3 bytes
?@A
Prints the string @A, plus a trailing newline, so output is 3 bytes.
JavaScript, 32 bytes
Code: btoa(01234567891011121314151617)
Output: MS4yMzQ1Njc4OTEwMTExMjEzZSsyNA==
console.log(btoa(01234567891011121314151617))
console.log(btoa(01234567891011121314151617).length)
console.log("btoa(01234567891011121314151617)".length)
Mathematica, 2 bytes
Code:
.0
Output:
0.
This is the output of Wolfram kernel from command line, and the plaintext output from the front end. If you must argue about the extra number tick added when copying directly from the front end, then 0.0 will do.
BotEngine, 5 bytes
TIRES
(Or any other program of the same length which starts with a T)
Prints TRUE, followed by a trailing newline (which apparently counts for this question).
bash, 48 bytes
bash bash bash bash bash bash! bash! bash! bash!
Output:
/bin/bash: /bin/bash: cannot execute binary file
Forth (gforth), 4 bytes
.S \
Prints <0> (that's <, 0, >, and space). Stack must be empty (for example if gforth was just started)
How it works: .S prints the stack depth enclosed in brackets and then the stack contents seperated with a space. \ is the beginning of a comment, it does nothing.
Forth (gforth), 8 bytes
8 SPACES
Well, it prints 8 spaces. Not much to see here.
Klein, 3 + 3 = 6 bytes (non-competing)
Non-competing because " was added after this challenge. +3 bytes for the 000 topology flag.
"@.
Prints 64 46 and a trailing linefeed.
Explanation
With the 000 topology the source code just wraps around like in many other fungeoids.
"@." Push the code points of '@', 64, and '.', 46, to the stack.
@ Terminate the program.
At the end of the program, the stack contents are printed as decimal integers with space-separation and a trailing linefeed.
I also tried for 5 with "@ and a suitable topology that lets the IP traverse more cells before hitting the " again, but the implicit cells (used to pad the code to a square) are ., so we can only ever print 2-digit numbers, and therefore we can't possibly get to 5 bytes of output with this technique.
C (gcc), 18 17 bytes
f(){puts('@C');}
Note that there's an STX byte (0x02) between @ and C.
Portability
This has been tested with gcc 6.3.1 and clang 3.9.1 on Fedora 25, gcc 4.8.4 on Ubuntu 14.04.4, and gcc 4.8.3 on openSUSE 13.2, where it prints the following output.
inux-x86-64.so.2
I expect this to produce the same output with all versions of gcc, as long as it compiles to an executable of the following type.
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2
Different platforms will require a different memory address and possibly a different order for the bytes in the multi-character character constant.
For example, replacing @\2C with @\2\4 prints exec/ld-elf.so.1 and a newline on FreeBSD 11 with clang 3.8.0.
Offline verification
$ printf "%b\n" "f(){puts('@\2C');}main(){f();}" > quine.c
$ gcc -w -o quine quine.c
$ ./quine
inux-x86-64.so.2
$ ./quine | wc -c
17
How it works
By default, ld uses 0x400000 as the base address of the text segment, meaning that we can find the ELF's content starting at memory address 0x400000.
The first 640 bytes of the ELF are largely independent of the actual source code. For example, if the declaration of f is followed by main(){f();} and nothing else, they look as follows.
00000000: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 .ELF............
00000010: 02 00 3e 00 01 00 00 00 00 04 40 00 00 00 00 00 ..>.......@.....
00000020: 40 00 00 00 00 00 00 00 e8 19 00 00 00 00 00 00 @...............
00000030: 00 00 00 00 40 00 38 00 09 00 40 00 1e 00 1b 00 ....@.8...@.....
00000040: 06 00 00 00 05 00 00 00 40 00 00 00 00 00 00 00 ........@.......
00000050: 40 00 40 00 00 00 00 00 40 00 40 00 00 00 00 00 @.@.....@.@.....
00000060: f8 01 00 00 00 00 00 00 f8 01 00 00 00 00 00 00 ................
00000070: 08 00 00 00 00 00 00 00 03 00 00 00 04 00 00 00 ................
00000080: 38 02 00 00 00 00 00 00 38 02 40 00 00 00 00 00 8.......8.@.....
00000090: 38 02 40 00 00 00 00 00 1c 00 00 00 00 00 00 00 8.@.............
000000a0: 1c 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 ................
000000b0: 01 00 00 00 05 00 00 00 00 00 00 00 00 00 00 00 ................
000000c0: 00 00 40 00 00 00 00 00 00 00 40 00 00 00 00 00 ..@.......@.....
000000d0: 04 07 00 00 00 00 00 00 04 07 00 00 00 00 00 00 ................
000000e0: 00 00 20 00 00 00 00 00 01 00 00 00 06 00 00 00 .. .............
000000f0: 08 0e 00 00 00 00 00 00 08 0e 60 00 00 00 00 00 ..........`.....
00000100: 08 0e 60 00 00 00 00 00 1c 02 00 00 00 00 00 00 ..`.............
00000110: 20 02 00 00 00 00 00 00 00 00 20 00 00 00 00 00 ......... .....
00000120: 02 00 00 00 06 00 00 00 20 0e 00 00 00 00 00 00 ........ .......
00000130: 20 0e 60 00 00 00 00 00 20 0e 60 00 00 00 00 00 .`..... .`.....
00000140: d0 01 00 00 00 00 00 00 d0 01 00 00 00 00 00 00 ................
00000150: 08 00 00 00 00 00 00 00 04 00 00 00 04 00 00 00 ................
00000160: 54 02 00 00 00 00 00 00 54 02 40 00 00 00 00 00 T.......T.@.....
00000170: 54 02 40 00 00 00 00 00 44 00 00 00 00 00 00 00 T.@.....D.......
00000180: 44 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 D...............
00000190: 50 e5 74 64 04 00 00 00 b0 05 00 00 00 00 00 00 P.td............
000001a0: b0 05 40 00 00 00 00 00 b0 05 40 00 00 00 00 00 ..@.......@.....
000001b0: 3c 00 00 00 00 00 00 00 3c 00 00 00 00 00 00 00 <.......<.......
000001c0: 04 00 00 00 00 00 00 00 51 e5 74 64 06 00 00 00 ........Q.td....
000001d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000001e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000001f0: 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 ................
00000200: 52 e5 74 64 04 00 00 00 08 0e 00 00 00 00 00 00 R.td............
00000210: 08 0e 60 00 00 00 00 00 08 0e 60 00 00 00 00 00 ..`.......`.....
00000220: f8 01 00 00 00 00 00 00 f8 01 00 00 00 00 00 00 ................
00000230: 01 00 00 00 00 00 00 00 2f 6c 69 62 36 34 2f 6c ......../lib64/l
00000240: 64 2d 6c 69 6e 75 78 2d 78 38 36 2d 36 34 2e 73 d-linux-x86-64.s
00000250: 6f 2e 32 00 04 00 00 00 10 00 00 00 01 00 00 00 o.2.............
00000260: 47 4e 55 00 00 00 00 00 02 00 00 00 06 00 00 00 GNU.............
00000270: 20 00 00 00 04 00 00 00 14 00 00 00 03 00 00 00 ...............
Using, e.g., main(int c, char**v){f();} instead changes some bytes, but not the offset of the string /lib64/ld-linux-x86-64.so.2, which we'll use to produce output.
The offset of said string is 0x238 and it is 27 bytes long. We only want to print 17 bytes (and the last one will be a newline if we use puts), so we add 11 to the offset to get 0x243, the offset of inux-x86-64.so.2. Adding 0x400000 and 0x243 gives 0x400243, the memory location of inux-x86-64.so.2.
To obtain this memory address, we can use multi-character character constants, which exhibit implementation-defined behavior. 0x400243 is (64)(2)(67) in base 256 and gcc's multi-character character constants use big-endian byte order, so '@\2C' yields the memory address of the desired string.
Finally, puts prints the (null-terminated) sting at that memory location and a trailing newline, creating 17 bytes of output.
Microscript, 1 byte
E
Prints 100=1. e will also work, printing 20=1.
dc (bash command line under Linux), 9 bytes
(inc newlines on both the math expression and the answer)
2 24 ^ p
Prints:
16777216
I wanted to make sure RPN wasn't forgotten about :)
C (modern Linux), 19 bytes
main(){raise(11);}
Output (with newline):
Segmentation fault
How it works:
SIGSEGV is defined as 11 in /usr/include/asm-generic/signal.h. Therefore, raise(11) raises SIGSEGV, and when SIGSEGV is raised on Linux, all execution stops and Segmentation fault is printed.
20 bytes
main(){raise(2*2);}
Output (with newline):
Illegal instruction
22 bytes
main(){raise(2*3-1);}
Output (with newline):
Trace/breakpoint trap
22 bytes
main(){raise(5*2+5);}
Output (with newline):
User defined signal 1
22 bytes
main(){raise(1?26:0);}
Output (with newline):
Virtual timer expired
24 bytes
main(){raise(12*(1+1));}
Output (with newline):
CPU time limit exceeded
25 bytes
main(){raise(5*5?5*5:0);}
Output (with newline):
File size limit exceeded
25 bytes
main(){printf(raise(8));}
Output (with newline):
Floating point exception
ZX Spectrum BASIC, 1 byte
PRINT
(which is 1 byte) prints a single newline.
Bean, 2 bytes
00000000: 253b %;
Explanation
Implicitly prints a 2 followed by a newline. I arbitrarily decided it should output the amount of bytes the program is, but this will work with many single characters in the printable range.
Ruby, 16 bytes
puts (1..8).to_a
returns
1
2
3
4
5
6
7
8
Can I use this to enter challenge?
Try it Online!
Bash + coreutils, 5 bytes
id -u
Technically depends on the user ID, but the default user has id 1000 on all major distros, and unless you set up 9,000+ additional users, all others will also have a four-digit id.
Finally, this works on TIO, so I'd argue it meets our must work in one implementation rule.
shortC on modern Linux
8 bytes
Araise(6
Output (with a newline):
Aborted
10 bytes
Araise(7);}
Output (with a newline):
Bus error
11 bytes
Araise(14);}
Output (with a newline):
Alarm clock
11 btyes
Araise(15);
Output (with a newline):
Terminated
12 bytes
Araise(16);}
Output (with a newline):
Stack fault
13 bytes
Araise(29);}
Output (with a newline):
I/O possible
24 bytes
main(){raise(9*(1+1+1));
Output (with a newline):
Profiling timer expired
Batch - 6 Bytes
xcopy^
Not sure if this counts, but the typing this in cmd will give the output:
More?
(With a trailing space)
Python 2, 13 bytes
Code:
print 10**12
Output:
1000000000000
Character Count: 13
charcoal, 1
⎚
Explanation:
⎚ Clears the empty screen
[implicitly print nothing plus a trailing newline]
Bash (builtins only), 8 bytes
{e,,}cho
Prints cho cho and a newline.
Carrot, 4 bytes
.^*3
Prints .... (4 .s).
Explanation
.^ Sets the stack-string to "."
*3 Append three duplicates of the stack-string to itself
Implicit output
Frink, 9, 11, 10 bytes
print[13!]
Outputs:
6227020800
Such a ... boring solution, sigh.
*no trailing newlines.
*Although Frink parses unicode exponents {+- 0-9}, print[9⁹] is 11 bytes, not 9.
Frink has a large data file of constants, but I haven't yet found a < 4 char one that outputs < 11 bytes.
(constants have units, and frink is very verbose by default)
REXX 8 Bytes
say 9**8
Prints 43046721
Excel, 7 bytes
=9^7&""
Produces a 7 digit number and then appends empty string
Uses general idea from pajonk in their answer [although obviously not the language trick :)]
Python 3 REPL, 2 bytes
1#
Prints 1 followed by a newline (\n)
PARI/GP, 2 bytes
4!
Prints 24. (This is using the REPL, which is essentially the only way the language is used.)
shortC, 15 10 8 7 6 bytes
AR"%6d
Output: A random integer x with y spaces before it. y = strlen(itoa(x))
R, 7 bytes
stop( )
Prints Error: (with a trailing space)
16 bytes (only works in version 3.3.1)
version$nickname
Prints Bug in Your Hair.
Not nearly as good but I like it anyway.
Aceto, 9 1 byte
p
Prints the top value on the stack, an implicit 0.
Old solution (9 bytes):
p
¥×
19
Push a 1, push a 9. Multiply the (remaining) stack (by 9; → [1,1,1,1,1,1,1,1,1]).
Implode and print (prints 111111111).
The code is 9 bytes long in UTF-8 because ¥ and × take 2 bytes each.
7, 3 characters, 1 byte
Seen as individual characters:
723
Or as a hex dump, proving that it runs from a file that's one byte long:
00000000: e9 .
Outputs the characters 23 in 7's encoding. This also happens to be a single byte long, and a printable ASCII byte at that:
00000000: 4f O
Explanation
This is a literal that pushes two stack elements: an empty stack element (7 separates stack elements), and 23, 7's print statement. When the end of the program is reached, the top stack element is copied and evalled, meaning that an attempt is made to print 23; because this contains characters that don't exist in 7's encoding (the active versions of the 2 and 3 commands, shown in bold in the explanation), the printed value gets escaped (into 723), and the 7 is interpreted as a request to format the output in the same encoding as the input, with the 23 getting printed.
It can be observed that the leading 7 on the program is entirely pointless, except to make the output and input distinct.
Ruby, 3 bytes
p""
Prints this, plus a newline
""
Here's another 3 byte one:
p:a
Prints this, plus a newline
:a
Japt, 1 byte
Outputs a string containing a single ".
Q
Or this will output a string containing a single \n.
R
R, 8 9 bytes
cat(8^8)
Prints 16777216 to stdout. cat(F) would have been better, but there isn't a trailing newline on the output. Thanks to @user2390246 for a byte.
Brian & Chuck, 9 bytes
?{-?
.{?
Prints ?????????.
The first character on the second line is a tab.
Explanation
The tab's code point is 9 and it's just used as a counter to loop the correct number of times.
The program starts by immediately switching to Chuck with ?. The . prints that ?, { currently does nothing and ? switches back to Brian.
We now start the main loop which runs 8 times. { moves the tape head on Chuck back to the first cell, i.e. the tab. - decrements this counter. Once the counter hits zero, ? does nothing and the program ends. But until that happens it switches control back to Chuck. Then . prints another ?, { resets the tape head on Brian to the beginning and ? hands control back to him. This way, the two instances alternate between decrementing the counter on Chuck and printing a ? on Brian.
Basic Arithmetic Calculator, 2 bytes
1=
prints 1., or:
|
|
| .
on those silly seven-segment displays.
To reproduce, pick up any random calculator; they all have this programming language installed somehow.
Javascript, 10 bytes
alert(1e9)
Nodejs repl (maybe breaking rule)
1
Taxi, 540 bytes.
62 is waiting at Starchild Numerology.Go to Starchild Numerology:w 1 l 2 r 1 l 1 l 2 l.Pickup a passenger going to The Underground.Go to The Underground:w 1 r 2 r 1 r 2 l.[r]Switch to plan "e" if no one is waiting.Pickup a passenger going to Cyclone.Go to Cyclone:n 3 l 2 l.Pickup a passenger going to The Babelfishery.Pickup a passenger going to The Underground.Go to The Babelfishery:s 1 l 2 r 1 r.Pickup a passenger going to Post Office.Go to Post Office:n 1 l 1 r.Go to Fueler Up:n 1 r 1 l.Go to The Underground:n.Switch to plan "r".[e]
Ungolfed:
62 is waiting at Starchild Numerology.
Go to Starchild Numerology: west 1st left 2nd right 1st left 1st left 2nd left.
Pickup a passenger going to The Underground.
Go to The Underground: west 1st right 2nd right 1st right 2nd left.
[r]
Switch to plan "e" if no one is waiting.
Pickup a passenger going to Cyclone.
Go to Cyclone: north 3rd left 2nd left.
Pickup a passenger going to The Babelfishery.
Pickup a passenger going to The Underground.
Go to The Babelfishery: south 1st left 2nd right 1st right.
Pickup a passenger going to Post Office.
Go to Post Office: north 1st left 1st right.
Go to Fueler Up: north 1st right 1st left.
Go to The Underground: north.
Switch to plan "r".
[e]
It prints the integers 61 through 1 in descending order and with a decimal and 6 trailing zeros:
61.00000060.00000059.00000058.00000057.00000056.00000055.00000054.00000053.00000052.00000051.00000050.00000049.00000048.00000047.00000046.00000045.00000044.00000043.00000042.00000041.00000040.00000039.00000038.00000037.00000036.00000035.00000034.00000033.00000032.00000031.00000030.00000029.00000028.00000027.00000026.00000025.00000024.00000023.00000022.00000021.00000020.00000019.00000018.00000017.00000016.00000015.00000014.00000013.00000012.00000011.00000010.0000009.0000008.0000007.0000006.0000005.0000004.0000003.0000002.0000001.000000
Cubix, 6 4 bytes
@"Ou
Cubified
@
" O u .
.
This pushes the string Ou. to the stack, Outputs the top character (.) as a character code (46), does a u-turn to the right, Outputs again, and exits with @.
OCaml, 22 bytes
List.find ((=) "") []
Outputs
Exception: Not_found.
It search for "" (empty string) in the empty list []
VBA Immediate Window, 9, 2 bytes
?,
Prints a tab followed by a newline according to this answer in meta
Old answer
?space(6)
Entered in the immediate window, space(n) repeats the space character n times, ? is short for Print & Debug. is implicitly prepended in the immediate window. Printing also gives a space after the function and 2 newlines so only 6 spaces needed
Excel, 13 (12/11) bytes
=TEXT(9^13,0)
Genetrate a number, convert to text, simple!
Alternatively: =1=1 evaluates to TRUE (4bytes)
TRUE is boolean not text
Update
Very debateably for 12 and 11 bytes respectively
=TEXT(9^12,0
Leaving off the close bracket evaluates without a fuss
=REPT("a,11
Leaving out a bracket and " still evaluates although you get a "did you mean...?" prompt correcting the formula. I think the 1st is probably fine, the 2nd probably isn't.
Powershell, 38 bytes
Just for fun, an answer that returns different output each time it's called.
[System.Guid]::NewGuid().ToString("B")
Prints a GUID surrounded with braces ("B"), such as:
{24cc14a3-ada4-4fcd-8a08-ec419b00f22d}
Perl 5, 9 bytes
print$"x9
Prints 9 spaces, no newline.
Explanation
$" contains a " " by default. x9 uses the repetition operator to "multiply" the string by 9.
Bash, 11 bytes
printf %11s
prints:
" "
(without the quotes)
If the newline counts, then printf "%10s" will print 10 characters plus the newline.
I did consider echo $0 (7) which works when saved with a filename 7 characters long, but I think that falls under the common set of unaccepted answers
Pyth, 1 byte
k
It prints a new line character.
Explanation: k is just a variable initialized to '' (empty string), and by default Pyth prints the values of instructions which do nothing, followed by a new line character. In this case, it prints an empty string and then the new line character.
Test it online! (the online interpreter doesn't show the \n, you will have to install Pyth on your computer to actually see it)
V/vim, 1 byte
o
This prints a single newline.
There are a bunch of variants on this that would work too. For example,
O
in vim, and
Ä
ä
ï
Ï
in V.
There are also many many many three byte solutions. For example:
3ii
i³i
¬ac
These are all specific to V.
Java, 70 bytes
interface M{static void main(String[]a){System.out.format("%70d",0);}}
Prints 69 spaces and a zero.
TacO, 1 byte
@
Outputs a single newline.
Taco's default behaviour is to print out a newline, for some reason. But, the code needs an entry point, @, to work. So this works.
Bash + coreutils (on 32-bit Linux), 5 bytes
arch
(trailing newline)
Prints
i686
(trailing newline)
Old solution:
sed s/e/a $0
Save (without trailing newline) in filename, and run with bash filename.
Prints
sad s/e/a $0
with no newline. Really you could replace any character in the file with a different character, but s/e/a/ makes the output sad. :(
Other solution (10 bytes):
sort $0
a=
(no trailing newline)
Prints:
a=
sort $0
Python 3 REPL, 3 bytes
1e0
Prints 1.0.
If trailing newline counts,
5*2
Prints 10, then a trailing newline.
C#, 22 16 bytes
()=>$"{1L<<50}";
-6 bytes thanks to Orjan Johansen, using long instead of int.
Outputs
1125899906842624
Alternately, if you allow an arbitrary parameter to be passed into the lambda:
C#, 21 15 bytes
_=>$"{1L<<49}";
Outputs
562949953421312
APL, 2 bytes
-1
Prints ¯1 (the - is the Minus monad, whereas ¯ is the High minus negative indicator).
WinDBG, 7 bytes
??1;$$$
Outputs:
int 0n1
How it works:
??1; Evaluate (and implicit print) 1 as a C++ expression
$$$ Comment, ignored
Python 2, 11 bytes
print 4**16
Beep boop.
brainbool, 1 byte
.
brainbool is like brainfuck, except cells can only contain 0 or 1. Outputting in brainbool always produces an ASCII 0 or 1. All cells start out as 0, so . will output 0.
Excel, 11 bytes
Norwegian language version:
=SMÅ(13^9)
English language version (12 bytes):
=LOWER(17^9)
Generates n-digit number and converts to text by converting to lowercase.
MSM, 8 bytes
'.;;.;.;
Output:
........
MSM operates on its own source and takes commands from the left and treats the right as a stack. Stack trace:
' . ; ; . ; . ; # ' pushes the next char on the stack
; ; . ; . ; . # ; is dup
; . ; . ; . . # dup again
. ; . ; . . . # . is concat
; . ; . .. # dup
. ; . .. .. # concat
; . .... # dup
. .... .... # concat
........ # MSM stops if there's only one element in the stack
Haskell, 16 bytes
main=print[0..6]
Try it online! Output:
[0,1,2,3,4,5,6]
(Note the trailing newline.)
Underload, 6 bytes
()aaaS
Prints ((())).
() pushes an empty string to the stack. a "stringifies" it by wrapping it in (...) so after aaa we get (((()))). S prints that string (without the outermost parentheses, so we get only three pairs).
Self-modifying Brainfuck, 5 bytes
<[.<]
Output:
]<.[<
Explanation:
Really simple, prints the source in reverse. In SMBF, the content of the program is stored on the tape, to the left of the initial position of the pointer. Gliding left and printing will output the source code backwards.
Since reading source is allowed in this challenge, this should definitely be within the rules.
Stacked, 9 bytes
$put:+put
Outputs [put put]. $put pushes a function literal to the stack, : duplicates it, + concats the two functions, and put outputs the representation of the top of the stack.
Somme, 2 bytes
:.
Outputs 42. Explanation:
:.
: duplicate; no input, so popping from an empty stack pushes `42`
. output as a number
AWK, 21 bytes
BEGIN{printf"%21s",0}
Simply prints:
0
The 0 could of course be any digit. No new line is printed, since that would add 2 bytes.
Fission, 4 bytes
R"N;
Prints N;R with a trailing linefeed.
The R creates a right-going atom. " toggles string mode which traverses an immediately prints N;R (wrapping at the end of the line). Then N prints a linefeed and ; destroys the atom, terminating the program.
GNU Make, 24 21 bytes
$(sort $(value $(0)))
returns
$(0))) $(sort $(value
Complete makefile:
X=$(sort $(value $(0)))
$(info $(call X))
TI-Basic (TI-84 Plus CE OS 5.2+), 4 bytes
toString(10^(3
tostring( is a two-byte token, 10^( is a one-byte token. This returns the string "1000" which is 4 bytes long.
Alice, 5 bytes
g/@O
Prints:
103
g
Explanation
This was quite fun to figure out. :)
g Pop two implicit zeros from the stack and retrieve the code point at that
location in the code. That's the 'g' itself, so we're pushing 103.
/ Reflect to SE. Switch to Ordinal. The IP bounces diagonally up and down
through the code.
O Implicitly convert the 103 to "103" and print it with a trailing linefeed.
Bounce off the top right corner and move back.
/ Reflect to W/ Switch to Cardinal.
g Push 103 again.
The IP wraps back to the last column
O Interpret the 103 as a code point and print the corresponding character.
This prints 'g'.
@ Terminate the program.
brainfuck, 25 bytes
--[-->+<]+++++[->-.....<]
Try it online! Note: Requires an implementation with 8-bit unsigned cells
Output:
~~~~~}}}}}|||||{{{{{zzzzz
Explanation
--[ 254
-->+<] /2 = 127 into the second cell
+++++[ Five times
->-.....<] Print the second cell - 1 five times
yup, 12 bytes
0e:::::{0##}
Pushes 6 1s, and, while there are 1 on the top of the stack, output a 0 followed by a 1.
Minimal-2D, 72 bytes
/D+++++++++L
R/D /LR/>>D /LR
R->++>+++<</UU R->..</UU
Outputs 72 6s. This is BF in a 2D layout.
Stack Cats, 1 + 3 = 4 bytes
+
Requires either the -o or -n flag for numeric output. Prints two zeros, with a linefeed each.
Explanation
Stack Cats has a tape of stacks which are all initialised to an infinite wells of zeros, but the starting stack has a -1 on top (which acts as a terminator when input is given). The + command swaps the first and third element on the current stack. So:
-1 0
0 0
0 + -1
0 ----> 0
. .
. .
. .
At the end of the program, the current stack is printed from top to bottom. Since the -1 is again treated as a terminator, it's not printed itself. Due to the -o flag, the values are printed as decimal integers with trailing linefeeds.
Perl 6, 4 bytes
{?1}
Returns True
Explanation
&prefix:« ? » is a Bool conversion operator
{ and } can be used to create a bare block lambda.
Brain-Flak, 32 bytes
(((()()()){}){}()){(({})[()])}()
Prints:
0
1
2
3
...
13
Explanation:
# Push 13
(((()()()){}){}())
# While TOS != 0
{
# Push TOS, TOS - 1
(({})[()])
# End While and pad with 2 bytes
}()
QBIC, 8 2 bytes
?z
Prints 10, to which z is auto-initialised.
Original brainfart answer
?A+@1234
Explanation:
? PRINT
A+ A$ (which is undefined, but hold on!), plus
@1234 The string literal 1234, which we now call A$
Outputs 12341234, which is also 8 bytes. We save a byte by putting the string lit at EOF, because we now don't need to use the delimiter. The definition of the literal is moved to the top of the QBasic code by the interpreter, ensuring it existst at the moment of the first call to A$.
Jelly, 1 byte
V
Quite a few Jelly one byters - this is one - it evaluates the left argument which, when nothing is provided as input, defaults to zero which in turn evaluates to zero and the result is implicitly printed, a 0.
In fact, of the 256 bytes in the code-page there are only 95 that do not currently produce a different one byte output within the specified range when run as a full program; these are (as code-page characters in byte order):
¡¢£¦©½¿€ÇÑÞßçıȷñ÷þ"#&',-./0123456789:;?@IMRTVZ\`dmpstxyz{}~°³⁴⁵⁹ƓƈɠḶỌṬḊĖİĿṄȮṖṘẆẊṃọṣṭḃḟḣŀṁṗṡẋż’“
Notes:
Most of the 1-byte programs print a
0(no-ops / yielding a list with a single zero in, which prints a0), most others print a1(0=0and the like)Ọis the one program which does yield a different byte, but one which is out of range as per the specification - it produces the null-byte (casts the0to character)⁶produces a space (a literal)⁷produces a line feed (a literal)Some bytes that do work now may not do so in the future - there are a fair few bytes being reserved (I believe) for niladic values which, when assigned, are almost certainly not going to produce one-byte output.
Fourier, 1 byte
o
Note, TIO.run outputs a trailing newline
Outputs the value of the accumulator, 0.
More interesting programs:
2P15o
Outputs 215, 32768.
4^do
Outputs the current year (doesn't work if used before 1000 AD).
999**999o
Outputs 997002999. The ** is undefined behaviour in Fourier. The way I think it works is A**B = A*A*B.
Bash, 1 byte:
#
It sort of outputs a newline...although I don't know if the program gets credit for that or the Bash interpreter.
I'm a bit dubious that this counts, so:
Bash, 21 bytes
x=12345;echo $x$x$x$x
This is really terrible, I know. Are you allowed to call any standard program with Bash?
Braingolf, 1 byte
l
Prints 0 (the current length of the stack)
Braingolf, 2 byte
4*
Prints 16. 4 can be replaced by any number n where 3 < n < 10
Explanation:
4*
4 Pushes 4 to the stack
* Monadic multiplication, squares the last item on the stack
Implicit output of the last item on the stack
C, 20 bytes
f(){printf("%20d");}
Outputs some number, padded with spaces to a length of 20. (What number? Whatever happens to come next in memory.)
Some sample runs on my system:
llama@llama:...code/c/ppcg121056samelen$ ./a.out
-666605944
llama@llama:...code/c/ppcg121056samelen$ ./a.out
-1391039592
llama@llama:...code/c/ppcg121056samelen$ ./a.out
1727404696
llama@llama:...code/c/ppcg121056samelen$ ./a.out
10717352
llama@llama:...code/c/ppcg121056samelen$ ./a.out
1485936232
It's a shame that the output can't be arbitrary bytes, because that would have allowed this 19 byte solution:
f(){write(1,f,19);}
which outputs 19 bytes of junk, starting at f's address.
dc, 2 bytes
Kp
Pushes the current precision on the stack (which is 0) and prints it with a trailing newline.
Python 3, 53 bytes
s='s=%r;print("0"*~-len(s%%s))';print("0"*~-len(s%s))
This must be the most quine-like answer ever.
Deadfish, 1 byte
o
Outputs the accumulator, which is 0 before any action takes place.
note: deadfish prints the accumulator as a number, not as a character code,
so the output is "0" (0x48)
TAESGL, 1 byte
S
Outputs a single space character
Other solutions
"≠ 2 bytes, "≠" converted to "!="
«Ā» 3 bytes, decompresses "Ā" which is equal to "the"
SŔ4) 4 bytes, " " repeated 4 times
5ē)ĴT 5 bytes, first 5 Fibonacci numbers joined
G→6,"A 6 bytes, draws a line to the right of "A" for 6 characters
///, 12 bytes
/a/bcd/aaaa/
This prints bcdbcdbcdbcd, and because this is 12 bytes, I've added a harmless / to the end of the code to pad it out.
C#, 57 49 47 44 bytes
()=>{for(int i=0;i<44;i++)Console.Write(7);}
-8 bytes thanks to Martin
Not 100% on whether lambdas like this are accepted answers, but my previous submission in this format was accepted just fine, so I'm gunna go with it.
Same as the java answer, but better because it's not Java
Mathematica, 2 bytes
4!
factorial
24
brainfuck, 33 bytes
>+[-->---[-<]>]>+[->+>+<<]>[->.<]
Output:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I could do it in 32 bytes but I decided this is better.
Powershell, 3 bytes
1E2
Prints 100
JavaScript (ES6), 17 bytes
Edit: I overlooked the rules. This is now returning a string, but is much longer than initially intended.
Returns "Infinity,Infinity".
let f =
_=>`${[1/0,1/0]}`
console.log(f())
Python 2, 10 bytes
print 9**9
Outputs 10 bytes:
387420489
*newline*
There are other 10-byte answers with decimals and power. I like this one for e in the output:
print.3**8
Output:
6.561e-05
*newline*
Same 10 bytes, but for division (there are 5 versions):
.1/64 = 0.0015625
.3/64 = 0.0046875
.5/64 = 0.0078125
.7/64 = 0.0109375
.9/64 = 0.0140625
print.1/64
outputs:
0.0015625
*newline*
Hexagony, 3 bytes
o!@
Prints 111.
Unfolded:
o !
@ . .
. .
But the code is really just run in the order o!@.
o Set the memory edge to 111, the code point of 'o'.
! Print this value as a decimal integer.
@ Terminate the program.
QBasic 4.5, 1 byte
?
This prints nothing. Followed by a newline.
Retina, 2 bytes
no
Prints 0 and a linefeed.
There are a lot of 2-byte solutions, but I believe this is optimal. Retina by default always prints a trailing newline and getting rid of it takes too many bytes. So we'd have to find a 1-byte program that leaves the empty input unchanged. I believe the only program which does this is the program containing a single linefeed, which is therefore equal to the output and hence not permitted by the challenge.
The next simplest thing to do is to live with Retina outputting a single digit (the number of matches of some regex against the empty input), and we can do that with a lot of failing (or matching) 2-byte patterns.
Go, 60 bytes
I don't know if this is hard in Go or if I'm failing to see something obvious.
import(."fmt"
."strings")
func main(){Print(Repeat("a",60))}
Batch, 12 bytes
@echo %OS%
Byte count includes trailing newline for both script and output, which is
Windows_NT
JavaScript (ES6), 17 11 bytes
f=_=>"g="+f
Try it
f=_=>"g="+f
console.log("Function source: f="+f)
console.log("Function length: "+(""+f).length+" + 2 (for variable assignment) = "+((""+f).length+2))
console.log("Function output: "+f())
console.log("Output length: "+f().length)
console.log("Output type: "+typeof f())
Java, 82 bytes
interface M{static void main(String[]a){for(int i=0;i++<82;)System.out.print(1);}}
Output:
1111111111111111111111111111111111111111111111111111111111111111111111111111111111
Javascript ES6, 9 bytes
Using Template Strings
_=>`${_}`
f=
_=>`${_}`
console.log(f());
console.log(typeof f());
Ohm, 5 bytes
αvssL
Explanation
αvssL
αv push 'aeiou'
ss convert to string two times (NOP)
L print without newline
Brachylog, 1 byte
w
Explanation
w is the built-in "write". Here, it will write the Input. Since the Input is a free variable, w will label it as an integer before printing. The first integer it tries is 0.
05AB1E, 1 byte
õ
Outputs a single newline. õ pushes an empty string, and it is implicitly outputted with a newline.
Some other 2 byte solutions, for your viewing pleasure (the output is in the brackets, and all output has a trailing newline):
X, (1)
Y, (2)
¾, (0)
¼, (1)
¶, (newline)
ð, (space)
Î, (0)
There are way more 2 byte solutions though.
Labyrinth, 4 bytes
!!>@
Prints 0000
Explanation
! Print an implicit 0 from the stack.
! Print an implicit 0 from the stack.
> Rotate the source code right by one cell, so the code now becomes
@!!>
The IP is moved along, so it's now at the end of the line, which is
a dead end. So the IP turns around and starts moving left.
! Print an implicit 0 from the stack.
! Print an implicit 0 from the stack.
@ Terminate the program.
Cjam, 1 byte
N
Explanation
N e#Push '\n' and implicit print
JavaScript (ES6), 9 bytes
_=>""+1E8
Returns 1 * 10^8, or 100000000.
If I can return a number instead of a string, _=>1E5 is 6 bytes.
f=
_=>""+1E8
console.log(f())
MATL, 2 bytes
H
There is a trailing newline.
Explanation
Clipboard H contains number 2 by default. H pushes that content to the stack, which gets implicitly displayed with a trailing newline.