Linked Questions

22
votes
11answers
2k views

Narcissistic Quine [duplicate]

Write a program/method that: Becomes a quine when the input matches the source code; Doesn't halt otherwise. This is code-golf, so shortest solution wins. Avoid any standard loopholes.
1
vote
1answer
495 views

Write a self-aware program [duplicate]

A standard (but disputed) test of self-awareness is the mirror test: An animal is considered self aware if it can recognize itself in the mirror. Your task is to write a program that is self-aware ...
1
vote
1answer
167 views

Simple “hyena” program [duplicate]

Write a program that takes a string as an input. For the input: If the input doesn't match the source code, the program shall output the input intact. (Hence a cat) Otherwise, the program shall fall ...
1
vote
1answer
239 views

Write a narcissist program! [duplicate]

A narcissist program is simple. It is related to a quine. If the input is equal to it's source code, it prints a truthy value, if not it prints a falsy one. That is it. Rules: It can't read it's ...
1
vote
0answers
134 views

“Know Thyself” Program [duplicate]

Challenge Write a program that takes as input a text and output "That's me!" if the input is equal to the program own source code, and "That's not me!" otherwise. Notes This is codegolf, in each ...
221
votes
393answers
53k views

Golf you a quine for great good!

Using your language of choice, golf a quine. A quine is a non-empty computer program which takes no input and produces a copy of its own source code as its only output. No cheating -- that means ...
354
votes
1answer
113k views

Regex that only matches itself

There are some pretty cool challenges out there involving regex (Self-matching regex, Regex validating regex) This may well be impossible, but is there a regex that will ONLY match itself? NOTE, ...
21
votes
11answers
1k views

Cross-matching regular expressions

Your task here is to write two regular expressions, each of which matches the other one but does not match itself. Both regular expressions should have this form: ...
21
votes
11answers
2k views

Interpret your lang, but not yourself?

There are many challenges that say "interpret X", where X is a simple language. In my opinion, that is way too boring. To give all the procrastinating people on the internet something ...
21
votes
11answers
3k views

Is it a substring of itself?

Given a string, return whether the string is a substring of the program's source code. Standard quine rules apply, meaning you cannot read your own source code. The length of the input is guaranteed ...
11
votes
15answers
856 views

Transformers in Disguise (Cops' Thread)

The robber's thread is here The cops task is to write a function or program that, when given an input of itself, outputs a finite deterministic string. If the program is given a different input, it ...
3
votes
1answer
217 views

Check if input is permutation of source [duplicate]

Inspired by Input ∩ Source Code. Task Your task is to determine whether the input is a permutation of the source code. Input A string. Input is flexible; it should be able to handle the character ...
1
vote
1answer
124 views

Self-loathing program/function [duplicate]

Simple task, write a program/function that returns error if and only if presented with itself. The program must give a valid output for any input other than itself. For the error part, you can only ...
0
votes
0answers
122 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 ...