CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 22:05:59 GMT
content-type: text/html; charset=utf-8
cf-ray: 965f70f89b0ff473-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=0e6ef983-cb6f-44be-a93a-72e3b9dd2279; expires=Mon, 27 Jul 2026 22:05:59 GMT; domain=.stackexchange.com; path=/; secure; httponly
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
content-security-policy: upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com
x-clacks-overhead: GNU Terry Pratchett
x-frame-options: SAMEORIGIN
x-request-guid: 38d106d7-344c-449f-ae02-d1411321f85d
x-worker-origin-response-time: 931000000
x-dns-prefetch-control: off
set-cookie: prov=0e6ef983-cb6f-44be-a93a-72e3b9dd2279; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=AvoYW7rT_xhqsY20_W4BQukmLIET1JQ_YF36wKEoxR8-1753653959-1.0.1.1-r0RbfapG_fdCrK3RTXD6.sFsmatzWaZKNKDMzRJASlZsc0J5Yw8zErij_nwHpgTi5LkUkslCfrAdLeV530od6stxHqCo_iRYOou4b5UqhRM; path=/; expires=Sun, 27-Jul-25 22:35:59 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=B.bnTTDLCqM5ZEf.MAi8oMlwhm2VsUE40brPhYA4QN8-1753653959439-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'code-golf' Questions - Code Golf Stack Exchange
Skip to main content
Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack ExchangeTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsQuestions tagged [code-golf]
Code-golf is a competition to solve a particular problem in the fewest bytes of source code.
12,304 questions
- Bountied 1
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
22
votes
15
answers
2k
views
Write two very different programs with the same characters
Your task is to write two programs/functions, in the same language.
Program 1: Verify that two inputs are anagrams of each other.
Program 2: Verify that two inputs differ from each other at every ...
6
votes
14
answers
1k
views
Make a Mulenère encryption program
Mulenère cipher is a version of Vigenère ciphers, which uses multiplication instead of addition.
Algorithm
It's simple. First, the password will repeated as much as reach a size bigger than length of ...
15
votes
8
answers
1k
views
Output shortest string containing all input strings
Given a list of words (letters only) in no particular order, output the shortest string containing every word (disregarding case). Output must be lowercase, except the first letter of each word is ...
2
votes
13
answers
516
views
List of prime distances
Task:
Write a code golf program that, given two positive integers n and m, returns a list of the distances between consecutive prime numbers in the range [n, m] ...
16
votes
12
answers
2k
views
Who was leading the race?
Your goal is to find out the order of the drivers in a race (1st, 2nd, 3rd, etc) each time the start / finish line is crossed. This would allow someone to see the progression of a driver throughout ...
11
votes
3
answers
2k
views
The shortest NP-complete problem
Find an NP-complete problem that covers all finite ASCII strings, and present a solver for the problem in the programming language of your choice.
By the definition, if there is a finite ASCII string ...
7
votes
4
answers
1k
views
Minimalist Pokemon Type Chart
We have a few questions related to pokemon types, but the only one that has you print the type chart requires you to take a parameter for dual typings which adds a ton of complexity, switches the axes ...
18
votes
14
answers
2k
views
Output 200 words
Output any 200 words from Wordnik without using external sources. Any case. No repeated or extra words. Code golf.
11
votes
4
answers
1k
views
Follow the glider
Generate four 2D arrays(2D string or whatever is fine) of same size that follows a glider in Conway's life of game.
Each cell is 3x3 plus 1-width border.
Each frame, it advances 1 cycle and shift the ...
5
votes
10
answers
1k
views
Genshin Elemental Aura Decay
There is this game Genshin Impact, when an element is applied to an enemy i.e. Electro it remains for some time causing decay to the enemy health. For this challenge, we'll simplify this to a single ...
18
votes
5
answers
1k
views
Hide from the "left-hand wall" robot
You need to hide in a maze from a robot which methodically follows the left hand wall rule. That is, it enters, immediately turns left, and will always move keeping its left hand on the wall. It only ...
14
votes
11
answers
628
views
Slender sub-lists
A somewhat interesting task came up for me recently which I thought would make a fun code-golf.
Given a number \$n\$ and a list of positive integers less than or equal to \$n\$, we call a sublist ...
15
votes
5
answers
976
views
Make a floor plan given the number of doorways
Output a floorplan of a house given the number of doorways of each room[1]. Every room is a square, and has 0 to 4 doorways. There are never doorways to the outside.
Given this input:
...
26
votes
38
answers
3k
views
+100
Does your source code contain this character?
Given a character as input, determine if your source code contains that character or not.
Shortest code wins. Though, I'd like to see some "normal" languages too.
UPDATE: the question ...
5
votes
5
answers
290
views
Calculate the Squadrat "yard"
Write a program/function to calculate the squadrat "yard" from a collection of squadrats.
Squadrats is a platform that gamifies outdoor activities by recording which large (~1.6 km square) ...
Welcome to Code Golf and Coding Challenges Stack Exchange! This is a site for recreational programming competitions, not general programming questions. Challenges must have an objective scoring criterion, and it is highly recommended to first post proposed challenges in the Sandbox.
- The Overflow Blog
-
-
- Featured on Meta
-
-
Related Tags
string × 2130
math × 1679
number × 1237
ascii-art × 1188
sequence × 899
array × 799
decision-problem × 772
kolmogorov-complexity × 663
arithmetic × 510
number-theory × 440
integer × 421
geometry × 359
grid × 352
tips × 334
random × 331
combinatorics × 329
primes × 305
matrix × 285
date × 280
graphical-output × 277
parsing × 250
game × 240
binary × 225
restricted-source × 210
quine × 203
more related tags
Hot Network Questions
- Were the Fantastic Four the only superheroes on Earth-828 in The Fantastic Four: First Steps?
- Blinded despite Blindsight?
- Math bolder than surrounding text in footnotes
- Are you required to protect trade secrets revealed to you even if you didn't sign an NDA?
- Why does Timor-Leste call itself a "Democratic Republic" despite little apparent Marxist-Leninist ideology?
- Dynamics from iterated averaging
- Story that taught cryptography in the form of a manga
- Has the Silver Surfer's clothing (or lack thereof) ever been addressed in the comics?
- Which prophecies was Jesus referring to in Luke 18:31?
- Translation of "mode"
- How can my dwarves keep humans from reverse engineering their technology?
- Sci-fi novel human-centered, with alien empire using stargates, humans try to avoid overruling
- Extensions of diagonalizable, respectively multiplicative-type, groups
- How do Japanese people understand the reading of a single kanji with multiple readings in their everyday life?
- Shimano 105 ST 5500 compatible with a triple front derailleur
- Will a reinforced 1" concrete slab be durable?
- Voltage-Controlled 555 Timer?
- rock paper scissors game with randomized system choices. NOT using rnd()
- How to change opamp variable resistor to fixed resistor?
- What is the parity of a neutrino?
- Lower bound on ratio of expected maxima of i.i.d. samples from distribution on [0,1]
- How does one justify the rationality of buying insurance?
- Book recommendations for theistic books about God's existence
- How do I set up a recursive algorithm to repeatedly square root a positive real number?