CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 20:41:18 GMT
content-type: text/html; charset=utf-8
cf-ray: 965ef4f26a649dfa-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=d87db791-b6f7-4c4e-a27f-14f9a253f963; expires=Mon, 27 Jul 2026 20:41:18 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: dd4c3769-3f4a-4013-8469-dc5b822e148f
x-worker-origin-response-time: 312000000
x-dns-prefetch-control: off
set-cookie: prov=d87db791-b6f7-4c4e-a27f-14f9a253f963; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=2WjEyZGLnmRKiL7F29KLt9BN3hYnEgrWrv.bdkuqhgs-1753648878-1.0.1.1-mWNwx6KJNV5w.9L18Va2o_S.OIWfNH2tOcXpFOmJ17uyyW1K_PkYzHXKqL6xuVAi8afJap2i1z0DeLndPynVUG8WsSLD1VJizd7k.N2qnKM; path=/; expires=Sun, 27-Jul-25 21:11:18 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=nOpEEaHFLXa0an0w0CKYN0gdS0v8qpnC6wKVDS7EBjY-1753648878792-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'self-referential' 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 [self-referential]
Used for challenges where answers make reference to themselves or their characteristics, such as length or character values. Since this is a subset of the [quine] tag, many of the same restrictions apply by default, such as not reading your own source code.
43 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 ...
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 ...
7
votes
1
answer
294
views
Brainfuck braggy busy beaver
Challenge
Write a brainfuck program that takes as many steps to halt. Non-halting program brainfuck programs are not allowed.
Not only does it have to be busy but it should also brag by printing the ...
8
votes
1
answer
366
views
Sequence of programs that prints the next one with length growth being equal to π
Challenge
You must produce an infinite sequence of programs \$P_0, P_1, P_2,\$ … such that each program \$P_n\$, when run, prints the exact source code of \$P_{n+1}\$ and then halts.
Each program \$...
9
votes
10
answers
2k
views
Figure out which of your friends reveals confidential information to the media!
Exposition
You send secret information to 100 of your friends, and the next day you discover that the information has been published! Who could have revealed it?
To determine that, you number your ...
14
votes
8
answers
796
views
Compress and decompress
Your task is to make a bidirectional compressor. It takes a list of bytes as input and returns a list of bytes as output. It has the property than whenever it is iterated twice it returns the original ...
10
votes
8
answers
877
views
Encode a Lenguage
The Len(language,encoding) family of languages is a variety of Lenguage derivatives. To encode a program into a Len language, you replace every character with its representation in a certain encoding, ...
12
votes
8
answers
1k
views
What is the link to your answer?
Goal
Your task is to create a program taking no input that returns the link to your answer. You can find a link to your answer by clicking at the share button on your answer.
Rules
Standard loopholes ...
1
vote
0
answers
174
views
Is this an anagram of its own source code? [duplicate]
I like anagrams. I like programs that reference their own source code. So this challenge combines them!
Input.
The input to the program could be anything, including letters, numbers, symbols, you name ...
31
votes
16
answers
2k
views
Substandard deviation
The mean of a population \$(x_1,\dots,x_n)\$ is defined as \$\bar x=\frac1n\sum_{i=1}^n x_i\$. The (uncorrected) standard deviation of the population is defined as \$\sqrt{\frac1n\sum (x_i-\bar x)^2}\$...
35
votes
30
answers
4k
views
Source Code Byte Frequency
Source Code Byte Frequency
Write a program that get a single byte character as an input and prints the frequency of that byte in the program's source code as an output.
Examples:
Assuming my program ...
28
votes
76
answers
8k
views
Average of your code
Inspired by this
Task
Your task is to output the average character of your code.
What is an average character?
Say we have a string golf().
We then take the ASCII ...
16
votes
12
answers
1k
views
Quines that print what their index is
We all know what a quine is. A quine is a program which prints its own source code. And we also know about the printable ASCII characters. Well... this challenge mixes both.
Your mission, should you ...
20
votes
27
answers
2k
views
Counting characters
Write a function or program that accepts one character (or a string of length 1) as input, and outputs the number of times that character occurs inside the code.
This program must be a Proper Quine, ...
31
votes
64
answers
4k
views
Triangular code, triangular output
For this challenge, submissions should be a program or function shaped like a right triangle, which produces a right triangle of the same size.
What is a right triangle?
For this challenge, a right ...
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
code-golf × 28
code-challenge × 12
string × 4
decision-problem × 4
source-layout × 4
compression × 2
quine × 2
pi × 2
printable-ascii × 2
hello-world × 2
permutations × 2
internet × 2
self-scoring × 1
encoding × 1
lost × 1
integer × 1
floating-point × 1
parsing × 1
code-generation × 1
busy-beaver × 1
brainfuck × 1
more related tags
Hot Network Questions
- Why did the Holy Spirit send Jesus to the wilderness to be tempted by Satan?
- How to deter wasps from an untreated larch fence
- How to avoid aligning the top of nested braces in cases environment?
- Sci-fi book where aliens make contact, ask humans to transport themselves to nearby portal
- Blinded despite Blindsight?
- What is the Greek word for God used in Codex Sinaiticus? John 1
- Book recommendations for theistic books about God's existence
- Meaning of 芭蕉 in Tang age
- Calculus Books Recommendation
- Why is time reversal not a natural part of the Galilean group?
- Not your ordinary affix riddle
- How many simple groups are there of a given infinite cardinality?
- Still learning electronics, can you explain this voltage protector failure?
- Is there any verse which says that throughout the Vedas the praise of Shiva is sung?
- Rec Letter from Professor (who I haven't done research with) or from Work Supervisor
- A word with five hundred of a single alphabet? That must be a myth.
- Balancing a Holy Water Bomb
- Were the Fantastic Four the only superheroes on Earth-828 in The Fantastic Four: First Steps?
- How to extend an MDF shelf?
- What were the two colored keys on a MUPID for?
- Kepler's first law proof error - can anyone help me see what the error is?
- Math bolder than surrounding text in footnotes
- When was the last time all humans were on the ground not in the air?
- Translation of "mode"