224 votes

Hyperprogramming: N+N, N×N, N^N all in one

Jelly, 12 bytes N+N “(ẹ+)‘FQṖṪỌv Try it online! N×N ““((ẹẹ++))‘‘FFQQṖṖṪṪỌỌvv Try it online! N^N ...
Dennis's user avatar
  • 210k
212 votes

Hello, World! (Every other character)

Python 3, 61 bytes rant="partisn't" print(("HHeelllloo,, WWoorrlldd!!"""[::2])) Try it online! Abusing the fact that print ...
vroomfondel's user avatar
  • 2,254
93 votes

Hyperprogramming: N+N, N×N, N^N all in one

><>, 41 bytes \< 1:: : &&* + i*n n c& %: 4l 0( .i n} &? Try it online: N+N, N*N, N^N. Assumes that the STDIN input is exactly one char. >&...
Sp3000's user avatar
  • 61.7k
75 votes

Inverse function

Haskell, 11 bytes f=log pxe=f and in reverse order: f=exp gol=f This works without the "comment" trick. Instead each ...
nimi's user avatar
  • 35.8k
73 votes

What did we forget?

zsh, 603 594 566 561 548 440 415 399 378 370 bytes ...
Doorknob's user avatar
  • 71.4k
63 votes

Source Code Metamorphosis

Befunge-98, 602 bytes ...
PurkkaKoodari's user avatar
62 votes

Hello, World! (Every other character)

Cardinal, 29 bytes % " H e l l o , W o r l d ! Try it online! Removing every other character removes all the linefeeds, which still results in ...
Martin Ender's user avatar
59 votes

From Programming Puzzles to Code Golf

Python 2, 48 47 bytes -1 byte thanks to Erik the Outgolfer print' 'and'Programming Puzzles'or'Code\40Golf' Try it online! ...
Rod's user avatar
  • 18.4k
53 votes

I reverse the source code, you negate the output!

05AB1E, 2 bytes (1 Try it online! !enilno ti yrT ( # negate nothing 1 # push 1 (and implictly output it) <...
Grimmy's user avatar
  • 15.6k
52 votes

Hello, World! (Every other character)

C, 125 bytes xpxuxtxs( ) { }xuxs ( ) { } main( ) {puts ( "Hello, World!" ) ; } mxaxixn ( ) {xpxuxtxs ( " H e l l o , W o r l d ! " ) ; } Try it online! With ...
Steadybox's user avatar
  • 16.5k
47 votes

I uppercase the source code, you reverse the input!

05AB1E, 1 byte r Try it online lowercase or uppercase! Finally a question which I (a dumb brain) can answer! Thanks for this easy, yet fun challenge! (I do feel ...
SunnyMoon's user avatar
  • 2,679
42 votes

Build a twisted "Hello world!"

Python 2, 59 bytes print " Hello, world!"[ 2::] #rint "T w i s t e r !"[ ::2] Twisted: ...
PurkkaKoodari's user avatar
42 votes

Inverse function

APL, 3 bytes *⊣⍟ This is a function train. Monadic * returns e^x, monadic ...
marinus's user avatar
  • 31.2k
42 votes

What are the five most powerful characters in your language?

Python3, 21 27 values Characters: 3479% Unique numbers: [1,2,3,4,5,6,7,8,9,11,12,19,20,21,24,29,34,35,36,37,39,43,46,47,49,73,74]...
Yytsi's user avatar
  • 3,762
42 votes

I uppercase the source code, you reverse the input!

Python 3,  61 50 49  48 bytes -1 thanks to benrg! r=-1;ʳ=1;ᵖʳᵢⁿᵗ(ᵢⁿᵖᵘᵗ()[::r]) lower-cased / upper-cased This works because PEP-3131 was implemented in Python 3....
Jonathan Allan's user avatar
41 votes

Code 3k to Codee k

Mathematica, 2 bytes 4! 4! returns 24 4!! returns 8
ZaMoC's user avatar
  • 24.4k
41 votes
Accepted

Create a square of increasing size by replicating the initial code

Pyth, 2 bytes 5 Try it online! Also Try it doubled, tripled! How does that work? \n is the command that prints its ...
Mr. Xcoder's user avatar
  • 42.3k
38 votes
Accepted

Coding Around The Clock

GolfScript, 11 10 bytes 21;;3#9];6 Uses # as padding character. 12 o'clock ...
Dennis's user avatar
  • 210k
38 votes

Letter, Number, Symbol, Space, Repeat

Haskell 300 bytes This code should have no trailing newline. The function m1 takes the input as a Char and returns the answer ...
Ørjan Johansen's user avatar
38 votes

Powerprogramming: O(1^N), O(N^1), O(2^N), O(N^2) all in one

Python 3, 102 bytes try:l=eval(input());k=1#)]0[*k**l(tnirp except:k=2#2=k:tpecxe print(k**l*[0])#1=k;))(tupni(lave=l:yrt Try it online! This is of O(1^n), ...
Leaky Nun's user avatar
  • 49.6k
37 votes

Program template for printing *any* string

Excel, 1 byte ' Ungolfed version ' <-- print the following text, and exit the current formula
Adam's user avatar
  • 601
37 votes

2 Cats in a Quine

V, 2 + 2 == 4 bytes 2i2i Try the quine! Try the cat! A is 2i B is also 2i How does it ...
DJMcMayhem's user avatar
  • 58.9k
36 votes

Error 404: Character Not Found

JavaScript, 228 bytes ...
jrich's user avatar
  • 4,126
36 votes

Hello, World! (Every other character)

Actually, 2 bytes HH Explanation: H, as you might expect, pushes Hello, World! to the ...
Okx's user avatar
  • 16.4k
36 votes

Code 3k to Codee k

Many languages, 4 bytes 16-1 Outputs 15. 16-11 Outputs 5. This is a CW answer for many languages it works for. Edit to ...
35 votes

Internal Truth Machine

Python 3, 29 bytes or~print(0) while 1:print(1) A full program, which if prefixed with 0 will print ...
Jonathan Allan's user avatar
34 votes

Palindrome Hello, World

///, 37 bytes Greetings, Planet!/!tenalP ,sgniteerG
Dennis's user avatar
  • 210k
34 votes

What are the five most powerful characters in your language?

Python, 18 numbers 237#- Produces as valid results: 1, 2, 3, 4, 5, 7, 16, 23, 24, 25, 27, 32, 35, 37, 69, 71, 72, 73 EDIT: ...
Leo's user avatar
  • 12.4k
34 votes

What are the five most powerful characters in your language?

05AB1E, 27 38 41 numbers 4·>Ìn Generates the unique numbers: ...
Emigna's user avatar
  • 52.9k

Only top scored, non community-wiki answers of a minimum length are eligible