Skip to main content
Share Your Experience: Take the 2024 Developer Survey
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
29 votes

From Programming Puzzles to Code Golf

Jelly, 17 bytes “Ñ1ɦ+£)G“½ċṭ6 Ỵ»Ṃ Try it online! How it works As in the other Jelly answer, Ñ1ɦ+£)G and ...
Dennis's user avatar
  • 210k
27 votes

End the tabs versus space war

Vim, 37, 34, 33, 32 bytes :%s/\t/ /g|%norm ^hr/hv0r*r/ Try it online! Note that this requires a trailing carriage return (enter) in vim, although not in the ...
DJMcMayhem's user avatar
  • 59.2k
26 votes

From Programming Puzzles to Code Golf

C, 64 62 53 52 bytes f(){puts(*" "?"Programming Puzzles":"Code\40Golf");} Try it Online! Uses the fact that C strings end with a null character
math junkie's user avatar
  • 7,237
23 votes

Get rid of whitespace on otherwise empty lines

Retina, 5 bytes %G`\S Try it online! A not so obvious approach rewards us with a better score :) Explanation G indicates ...
Leo's user avatar
  • 12.7k
23 votes

Ungolf my tinylisp code

tinylisp, 1022 bytes ...
emanresu A's user avatar
  • 38.4k
22 votes

From Programming Puzzles to Code Golf

05AB1E, 15 bytes ”ƒËŠˆ”" "v”–±ÇÀ Try it online! Explanation ...
Emigna's user avatar
  • 53k
21 votes

Write a Stack Exchange compliant brainfuck explainer

brainfuck, 811 775 709 701 bytes ...
tjjfvi's user avatar
  • 7,350
20 votes

Figure and Ground

Jelly, 20 bytes Figure “¦ĠȮ“©ụd» Ṃ Nine trailing spaces. Try it online! Ground “ ¦ĠȮ“©ụd»Ṃ No trailing ...
Dennis's user avatar
  • 210k
18 votes

Significant Whitespace: Cops

Haskell, 100 bytes, cracked by nimi main=interact$iddoidlinesidwordsdoidoidoid=doiddoid<-dooiidoid<-dooiddoiddodoid This is a full program and a dadaistic ...
Laikoni's user avatar
  • 26.2k
18 votes

Get rid of whitespace on otherwise empty lines

sed, 6 bytes /\S/!g Try it online! ...
Riley's user avatar
  • 11.7k
17 votes
Accepted

Create a codeblock tool

V, 4 bytes Î4É Try it online! (Note the trailing space) V is encoded in Latin1, where this is encoded like so: ...
user41805's user avatar
  • 13.1k
15 votes
Accepted

Get rid of whitespace on otherwise empty lines

Japt, 10 8 6 5 4 bytes mx1R Try it online! Explanation ...
Tom's user avatar
  • 3,108
15 votes

From Programming Puzzles to Code Golf

CJam, 38 bytes " ""Programming Puzzles""Dpef!Hpmg":(? Try it online! or with spaces removed Explanation ...
Business Cat's user avatar
  • 9,167
14 votes

Figure and Ground

05AB1E, 15 14 bytes Figure 'ŠÂ,'í¶ Try it online! Ground ' ŠÂ,'í¶ Try it online! Uses the CP-1252 encoding. Note ...
Adnan's user avatar
  • 44.4k
14 votes

Figure and Ground

Python 2, 53 bytes Replace · with space in both answers: ···················· print'······figureground'[6:12]# Prints ...
lynn's user avatar
  • 68.7k
13 votes

Significant Whitespace: Cops

C, 475 bytes, cracked by Riley Certain parts of C make it really really easy to see where whitespace should go. The c pre-processor, however, does not. So this code is sort of in two halves: up to ...
rexroni's user avatar
  • 396
12 votes
Accepted

Implement a whitespace golfer

Retina, 9 bytes m`^\d $* Try it online! Note: Trailing space on last line.
Neil's user avatar
  • 171k
11 votes

End the tabs versus space war

Perl, 41 bytes s,␉, ,g;s,^ ( +),/@{[$1=~y| |*|r]}/, Run with the -p flag, like so: ...
lynn's user avatar
  • 68.7k
11 votes

Reversing of Words

Retina, 7 bytes O$^`\w+ Try it online! Match all words (\w+) sort them with sort key empty string (...
Martin Ender's user avatar
11 votes

Implement a whitespace golfer

Cubically, 69 66 bytes RBR3B~(+50<7?6{+54>7?6{-002+7~?6{(@5*1-1/1)6}}}(-6>7?6&@7+70-4~)6) Try it online! Explanation: First we do this initialization: ...
Kamil Drakari's user avatar
10 votes

Significant Whitespace: Cops

Octave, 69 bytes, SAFE! @(U)eval([85329685312682956148388531268295156241'']) Input format: Newlines can't be inputted directly in the command prompt. Create the ...
Stewie Griffin's user avatar
10 votes

From Programming Puzzles to Code Golf

Haskell, 48 bytes a _="Programming Puzzles";a4="Code\32Golf";f=a 4 a_="ProgrammingPuzzles";a4="Code\32Golf";f=a4 Defines function ...
nimi's user avatar
  • 35.8k
10 votes

From Programming Puzzles to Code Golf

Wolfram language, 62 bytes "Programming Puzzles"[ToExpression@"\"Code\\.20Golf\""][[0 1]] The space in [[0 1]] is implicit ...
Not a tree's user avatar
  • 3,206
10 votes

Reversing of Words

Haskell, 21 bytes unwords.reverse.words Try it online!
nimi's user avatar
  • 35.8k
10 votes

Reversing of Words

Python 3, 29 bytes print(*input().split()[::-1]) Try it online!
Rod's user avatar
  • 18.4k
9 votes

Figure and Ground

Retina, 31 bytes Figure: | figure |ground Ground: |figure | ground Figure and Ground. Both programs require that STDIN be left empty to be valid figure or ground programs.
FryAmTheEggman's user avatar

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