21
2
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 to be less than or equal to the length of the program. You may return any two distinct values, not necessarily truthy and falsey values. You may also submit a function, rather than a full program.
This is a code-golf so shortest code wins!
An example
If your source code is print(input() = False)
, it should return True for nt(i
but False for tupn
.
1Related – James – 2017-11-14T16:09:55.863
Is a function allowed? – totallyhuman – 2017-11-14T16:12:16.070
2@totallyhuman as with most challenges, yes. – caird coinheringaahing – 2017-11-14T16:13:09.500
1Also related. – AdmBorkBork – 2017-11-14T16:22:57.733
guys mentioning all related questions that don’t make it a duplicate is unnecessary. – Stan Strum – 2017-11-14T17:24:49.423
10@StanStrum It is not to point out duplicates, it is to show related challenges that people might be interested in and to show them on the sidebar to the right. – totallyhuman – 2017-11-14T17:25:42.170
1Can the input be empty? (Actually, can the code be empty?) – Lynn – 2017-11-14T22:10:31.283
@Lynn No, the code cannot be empty – caird coinheringaahing – 2017-11-14T22:39:39.117
-1 because this is a generalized narcissist
– Esolanging Fruit – 2017-12-19T04:16:51.537