Stack Exchange
log in sign up chat discuss faq users badges

Area 51 » Technology

definition commitment beta
123
followers

Code Golf & Programming Puzzles

Launched Q&A site for code golfers and for those who interested in code golfing (from beginners to experts), and programming puzzles.

Announcements

2  
@Charles, discussion about techniques on code golfing would be more meta, so if we cannot have seperate meta site, those discussions can be post on site but probably CW, while normal golf contests are main and on-topic, non-CW. how about that? – YOU Jun 8 '10 at 15:26
6  
Wouldn't it be nice to broaden the subject a little bit and open it for programming puzzles in general? Code Golf would be one tag along with code obfuscation, mathematical problems etc. – Lucas Jun 17 '10 at 14:45
2  
I would want this to be a "Programming Challenge" Stack Exchange. Anything that would be considered a programming challenge, such as golf, puzzles, "coolest demo in 2048 bytes of HTML, JavaScript, and CSS with these ingredients...", obfuscated code contests, fastest code to complete task x, ICFP type contests, etc. I love programming challenges, and definitely support a SE for them, but I'd want it to be inclusive of pretty much any programming challenge. – Brian Campbell Sep 18 '10 at 5:21
show 12 more announcements
no discussions yet discuss this proposal

43 Example Questions (8 closed)

active newest votes
up vote 21 down vote
What's the shortest code by character count to detect a palindrome?
added by Mark Elliot Jun 9 '10 at 20:22
link
up vote 20 down vote
What's the shortest Mathematical Expressions Evaluator?
added by YOU Jun 8 '10 at 8:55
link
ref: stackoverflow.com/questions/928563/… – YOU Jun 8 '10 at 8:55
up vote 19 down vote
What is your shortest solution to the FizzBuzz problem?
added by YOU Jun 8 '10 at 8:48
link
ref: stackoverflow.com/questions/437/… – YOU Jun 8 '10 at 8:49
up vote 19 down vote
Shortest Sudoku solver
added by Tom Savage, edited by WikiSpeedia hang-around Oct 4 '10 at 19:18
link
up vote 17 down vote
What's the shortest program to cause a stack overflow?
added by Master Of Disaster Jun 8 '10 at 4:13
link
this is on-topic, I think. – YOU Jun 8 '10 at 4:21
Just a copy of one of the higher-voted golf questions from stackoverflow.com. – Master Of Disaster Jun 8 '10 at 4:33
1  
That's one of the higher-voted ones? Seems like a particularly bad code-golf, but I'd accept it as valid, on-topic, belongs on this site. – Roger Pate Jun 8 '10 at 5:09
stackoverflow.com/questions/62188/… – Master Of Disaster Jun 8 '10 at 5:50
up vote 12 down vote
Is there a way to prove that a given program is the shortest possible?
added by srcerer Jul 17 '10 at 0:09
link
up vote 12 down vote
Write a "Hello World" program in 'C' language without using a semicolon.
added by chanchal1987 Aug 7 '10 at 19:25
link
While not exactly a code golf puzzle, tricks like this are very relevant to code golf. – finnw Aug 9 '10 at 22:18
up vote 10 down vote
What is smallest program that takes a sentence as input and converts it to Pig Latin?
added by thyrgle, edited by WikiSpeedia hang-around Oct 4 '10 at 18:07
link
Ref: stackoverflow.com/questions/3190914/… – thyrgle Jul 23 '10 at 23:45
up vote 9 down vote
Best quality encoder to compress image into 140 characters.
added by KennyTM Jun 8 '10 at 7:41
link
2  
As in stackoverflow.com/questions/891643/… – KennyTM Jun 8 '10 at 7:41
up vote 9 down vote
SPIDER WEBS The shortest code by character count to output a spider web with rings equal to user's input.
added by Master Of Disaster Jun 9 '10 at 2:10
link
stackoverflow.com/questions/1646887/… – Master Of Disaster Jun 9 '10 at 2:10
(Meant to be a) good example of an actual code golf challenge – Master Of Disaster Jun 9 '10 at 2:10
up vote 7 down vote
Smallest C function that performs divide, multiply, and remainder using modulus math for 32 bit signed and unsigned integers?
added by Adam Davis Jun 8 '10 at 5:34
link
up vote 5 down vote
Is code golfing the practice of elegance or obfuscation?
added by srcerer Jul 17 '10 at 0:04
link
up vote 5 down vote
Algorithm to solve 9 digit factorials as quickly as possible
added by Nathan Taylor Aug 26 '10 at 4:12
link
Good question, but 4 digits is too short. <6 digits can be counted in a second in several languages. – Nakilon Oct 8 '10 at 18:48
@Nakilon updated per your suggestion – Nathan Taylor Oct 11 '10 at 22:26
How do you measure quickness? – moala Oct 16 '10 at 9:05
up vote 4 down vote
Algorithm/program to generate shortest PCRE matching all integers between two given integers.
added by KennyTM Jun 8 '10 at 9:30
link
Golfing the output, not the program size. – KennyTM Jun 8 '10 at 12:47
up vote 4 down vote
Write a C++ program without using any loop (if, for, while etc) to print numbers from 1 to 100 and 100 to 1.
added by chanchal1987 Aug 7 '10 at 19:27
link
please clarify: gotos allowed? – moala Oct 15 '10 at 17:13
@moala: You don't need to answer this question here. This is just an example question. – chanchal1987 Oct 18 '10 at 12:53
@chanchal1987: I know ;-) though the question would have been more precise, answerable. – moala Oct 18 '10 at 15:19
No "goto" is not allowed here... – chanchal1987 Oct 19 '10 at 6:36
This is an instructive problem--by which I mean, once you understand both the solutions you know something about c++--but in some ways not a good puzzle. It will attract multiple variants of the same two solution (recursion and allocate an array of objects that do the work in the constructor/destructor), which isn't particularly interesting. – dmckee Oct 19 '10 at 19:01
up vote 3 down vote
Smallest code (cycle time) to divide a 16 bit signed integer by the literal 39034 on a PIC 8 bit processor?
added by Adam Davis Jun 8 '10 at 5:31
link
Isn't code golf supposed to be about code size not execution time? Measuring code in machine code bytes is fine but when you start introducing other metrics it ceases to be code golf. – finnw Aug 9 '10 at 22:23
up vote 3 down vote
Write a program to encode a string in ROT13, using minimal number of 1-bits.
added by KennyTM Jun 8 '10 at 17:51
link
Unconventional golfing goal. Taking from stackoverflow.com/questions/1501176/… (sorry, you need 10k to view it.) – KennyTM Jun 8 '10 at 17:52
1  
"Number of 1-bits" means e.g. 'A' = 65 = 0b01000001 has 2 bits, '\' = 92 = 0b01011100 = 4 bits, etc. – KennyTM Jun 8 '10 at 17:54
holy crap, that's really hard and kind of fantastic – coffeepac Jun 25 '10 at 2:29
up vote 3 down vote
Write a program whose printed output is an exact copy of the source. Needless to say, merely echoing the actual source file is not allowed.
added by chanchal1987 Aug 7 '10 at 19:26
link
I think a lot of quine questions will find their way onto this site, whether you like it or not. You might as well accept it and have a tag for it. – finnw Aug 9 '10 at 22:16
up vote 1 down vote
Smallest compiled "Hello World" program (bytes in binary for intel compatible 32 or 64 bit processors using win, linux, or OSX os)?
added by Adam Davis Jun 8 '10 at 5:35
link
up vote 1 down vote
Shortest matrix multiplier
added by Tom Savage Jun 9 '10 at 21:34
link
It is hard to create a good control environment to find which program is fastest. – KennyTM Jun 10 '10 at 10:09
1  
True. I'll just make it just shortest then. – Tom Savage Jun 10 '10 at 16:24
up vote 1 down vote
What's the best language for code-golf? [closed]
added by Brian Campbell Sep 18 '10 at 6:09
link

closed as off topic by Dheer, Steve Claridge, apaderno, dmckee, Noctrine Oct 18 '10 at 18:28

This question does not relate to the topic of the proposal.
It was closed as part of an automated migration of off-topic to close votes on September 29, 2011.

Too subjective. – Nakilon Oct 13 '10 at 11:22
up vote 1 down vote
Write a program to generate the first n Fibonacci numbers?
added by Ryan Berger Oct 6 '10 at 3:42
link
up vote 0 down vote
Is there a tool to automatically remove unnecessary whitespace in [language] source code? [closed]
added by sth Jun 8 '10 at 6:02
link

closed as off topic by finnw, cmcculloh, HoLyVieR, Dheer, Vrki Sep 28 '10 at 10:16

This question does not relate to the topic of the proposal.
It was closed as part of an automated migration of off-topic to close votes on September 29, 2011.

this would seem to be cheating at golf, using an automated helper. or if you're looking to remove whitespace for readability, that wouldn't be relevant at all. – coffeepac Jun 25 '10 at 2:25
@coffeepac: Using an automated helper is perfectly legitimate! In fact, if you go to golf.shinh.org you'll find a program there called Caddy, which does this job for a small handful of languages (it's open-source, so feel free to extend it with more). – Chris Jester-Young Jun 28 '10 at 23:36
Having an automated whitespace&comments stripper would presumably encourage people to write documented, readable version of the code that are easier to digest. I do that for SO code-golfs, but the hassle of hand-minifying is also a consideration. – dmckee Jul 30 '10 at 2:04
What is off-topic in this question, is that this question is asking for a tool/program, which is more appropriate for Super User. The question would have been fine if it was asking for "What tool are useful for Code-Golf to reduce the number of character ?" – HoLyVieR Sep 11 '10 at 1:05
up vote 0 down vote
Anti-golf on “Hello World”? [closed]
added by KennyTM Jun 9 '10 at 15:25
link

closed as off topic by YOU, Chris Jester-Young, A J, Paul B, Mark Elliot Jul 6 '10 at 3:00

This question does not relate to the topic of the proposal.
It was closed as part of an automated migration of off-topic to close votes on September 29, 2011.

Things that aren't really golfing for an objective nontrivial limit should be off-topic. Taken from stackoverflow.com/questions/2052137/…, and also stackoverflow.com/questions/2296664/…. – KennyTM Jun 9 '10 at 15:25
I agree. Anti-golf was fun but you can only really do it once. – Tom Savage Jun 9 '10 at 21:31
up vote 0 down vote
How can I do [something] with GolfScript? [closed]
added by Tim Post Jun 11 '10 at 14:03
link

closed as off topic by YOU, KennyTM, Charles Stewart, Lucas, sepp2k Jun 24 '10 at 22:20

This question does not relate to the topic of the proposal.
It was closed as part of an automated migration of off-topic to close votes on September 29, 2011.

up vote 0 down vote
How do I solve the traveling salesman problem in PHP? [closed]
added by cmcculloh Aug 2 '10 at 2:37
link

closed as off topic by Shawn Chin, AShelly, morfu, Nathan Taylor, Mark Trapp Aug 29 '10 at 9:20

This question does not relate to the topic of the proposal.
It was closed as part of an automated migration of off-topic to close votes on September 29, 2011.

up vote 0 down vote
Euler #xxx - so, what you think of it?
added by Max Gontar Aug 6 '10 at 5:46
link
up vote 0 down vote
Best [visual effect] written in [JavaScript] in 2048 characters contest [closed]
added by naugtur, edited by WikiSpeedia hang-around Oct 4 '10 at 17:55
link

closed as off topic by KennyTM, Nathan Taylor, Mark Trapp, Thomas Owens, AShelly Aug 29 '10 at 22:55

This question does not relate to the topic of the proposal.
It was closed as part of an automated migration of off-topic to close votes on September 29, 2011.

up vote 0 down vote
Write a program that plays 9-men's morris; the program that wins a tournament will win the bounty
added by Brian Campbell Sep 18 '10 at 6:08
link
up vote 0 down vote
Shortest code to convert a datatype to a binary represented string?
added by snmcdonald Oct 21 '10 at 3:12
link
up vote -1 down vote
Tiny code to format given text into given image shape (caligram)
added by Max Gontar Aug 6 '10 at 18:14
link
up vote -1 down vote
Shortest code to Find most efficient way between any 2 people in any social network?
added by Max Gontar Aug 6 '10 at 18:17
link
up vote -1 down vote
How do you find the 2nd largest number in a list using the fewest comparisons?
added by lillq Aug 11 '10 at 22:51
link
up vote -1 down vote
Project Euler problem <#XX> in <lang>. [closed]
added by lillq Aug 17 '10 at 15:51
link

closed as off topic by Thomas Owens, AShelly, Daenyth, Brian Campbell, Vrki Sep 28 '10 at 10:15

This question does not relate to the topic of the proposal.
It was closed as part of an automated migration of off-topic to close votes on September 29, 2011.

up vote -1 down vote
Hints for problem <XXX> in <ProjectEuler || SPOJ || UVa || TopCoder>
added by MAK Sep 14 '10 at 11:42
link
up vote -1 down vote
Write an obfuscated rot-13 program
added by Brian Campbell Sep 18 '10 at 6:04
link
up vote -1 down vote
Rate this <language>implementation of <algorithm> in <x> <lines/characters> of code
added by Jaime Soto Oct 20 '10 at 13:59
link
up vote -1 down vote
What's the fastest algorithm for x?
added by Brian Campbell Oct 21 '10 at 3:45
link
up vote -3 down vote
I'm planning to write a golf game. What would be a good physics engine to use? [closed]
added by sth Jun 8 '10 at 5:36
link

closed as off topic by KennyTM, Charles Stewart, Blorgbeard, Robert Harvey, flicken Jun 22 '10 at 16:56

This question does not relate to the topic of the proposal.
It was closed as part of an automated migration of off-topic to close votes on September 29, 2011.

Is confusing "golf" to mean the sport really a good example? – Roger Pate Jun 8 '10 at 19:28
@Roger: It's "Golf Code," not "Code Golf." – Robert Harvey Jun 8 '10 at 19:33
up vote -3 down vote
Code Golf: Scrabble-able Input: a list of words Output: a legal arrangement for the words on a scrabble board
added by Master Of Disaster Jun 9 '10 at 2:08
link
stackoverflow.com/questions/2261681/… – Master Of Disaster Jun 9 '10 at 2:09
Deliberate bad example – Master Of Disaster Jun 9 '10 at 2:09
Its not off-topic I think, but I don't have any votes left, so not voting here. – YOU Jun 9 '10 at 3:37
Code golf which needs too much logic generally tends to be not much fun. OK, maybe that is not the same as "off topic" though. Bad example? – Master Of Disaster Jun 9 '10 at 3:46
Ah, that "not a good example" button takes -2, (which shouldn't imho), so I'm rarely do that. – YOU Jun 9 '10 at 4:32
show 1 more improvement suggestion
1 2 next

This site has

Launched!

This Stack Exchange site's beta was successful, so it launched 6 years ago.

proposed by

YOU
182k●53●361●569

11 years ago (edited 11 years ago)

viewed

23,586 times

latest activity

11 years ago

followers

users also following

12.2% Sports
11.4% Project Management
10.6% LEGO
10.6% Cryptography
12.2% only this proposal

followers active in

88.6% Stack Overflow
59.3% Super User
55.3% Software Engineering
52.8% Meta Stack Overflow
48.0% Server Fault
35.0% Web Applications

recent followers

added Aug 14 '11 at 2:12
Black Square
79●3
added Jun 14 '11 at 8:47
VMAtm
53.3k●31●188●335
added Jun 8 '11 at 0:25
swilliams
963●6●10
added May 26 '11 at 13:22
J-_-L
9,607●2●45●54
added Apr 21 '11 at 7:00
YOU
182k●53●361●569
added Apr 18 '11 at 9:31
ralu
11.1k●3●39●86
added Jan 27 '11 at 10:23
Kos
74.5k●25●214●339
added Jan 25 '11 at 11:41
red-X
5,397●1●24●40
added Jan 24 '11 at 15:21
Denis Otkidach
32.1k●9●83●132
added Jan 23 '11 at 16:07
David Glass
2,474●1●26●39
added Jan 21 '11 at 17:16
Sean Lynch
2,696●24●59
added Jan 20 '11 at 18:23
user30998
51●1
added Jan 19 '11 at 21:49
Robert S Ciaccio
11.6k●10●89●136
added Jan 17 '11 at 14:12
admalledd
579●3●12
added Jan 16 '11 at 9:22
boos
3,265●5●27●64
added Jan 2 '11 at 7:50
Tianyi Cui
4,683●4●21●41
added Dec 31 '10 at 11:36
Johnner
3,699●1●22●30
added Dec 31 '10 at 9:23
Martin Tóth
3,647●5●42●91
added Dec 31 '10 at 5:42
Dwev
1,557●11●22
added Dec 29 '10 at 11:28
François Cassin
1,433●2●13●22
added Dec 22 '10 at 21:33
julien
5,871●9●52●80
added Dec 20 '10 at 18:24
Jim McKeeth
66.8k●70●373●626
added Dec 19 '10 at 22:50
mootinator
34.9k●11●157●283
added Dec 18 '10 at 2:34
John
60k●57●293●526
added Dec 17 '10 at 19:44
Mnementh
86.6k●71●395●723
added Dec 11 '10 at 7:22
curious
10.7k●15●79●148
added Dec 9 '10 at 19:02
RegDwight ♦ 1
152k●64●486●756
added Dec 8 '10 at 14:59
Dan McClain
24k●18●119●201
added Dec 8 '10 at 12:13
zm1
6,318●12●48●76
added Nov 30 '10 at 18:06
gusbro
21.3k●33●46
added Nov 26 '10 at 16:36
kyoto
51●2
added Nov 22 '10 at 9:20
Zaz
5,273●3●39●85
added Nov 19 '10 at 16:19
Dom
4,378●4●34●89
added Nov 16 '10 at 23:29
nibot
45.8k●32●247●404
added Nov 15 '10 at 18:07
Juan
6,704●1●42●55
added Nov 13 '10 at 19:41
hallvabo
1,871●14●21
added Nov 8 '10 at 15:37
jsternberg
8,576●8●54●87
added Nov 8 '10 at 14:37
layalk
1,061●6●15
added Nov 8 '10 at 10:31
Mark Davidson
18.2k●16●107●185
added Nov 7 '10 at 6:27
st0le
35.3k●8●104●116
feed icon proposal feed
faq | blog | legal | privacy policy | contact us | feedback always welcome
site design / logo © 2022 Stack Exchange Inc; user contributions licensed under cc by-sa; see the licensing help page for more information.
rev 2022.3.23.593