6
A narcissist program is a program that only accepts its own source code. A bigotous program is a program that only accepts the source code of programs semantically equivalent to itself. A gang member is somewhere in between.
In particular, we will define a gang as set of programs G
, which may or may not be in the same programming language, such that each program, when executed, will only accept members of its gang, and reject everything else (since they all do the same thing, this means that are semantically equivalent). A gang member is a program that is part of a gang, and the set of programs that it accepts is its gang.
So, a narcissist program is a gang of size 1, and a class of bigots is a maximally sized gang (every equivalent program gets to be part of the gang).
Your job is to create a gang of programs. It must be of size at least 2, and can have programs in different languages (you can even count the same program multiple times if it's a polyglot).
Your score is (average length of gang member)/(# of unique programming languages), which you are trying to minimize (so you are rewarded for using different languages). It is considered cheating to use built in language features that allow a program to access its own code.
Note: We'll define acceptance v.s. rejection via https://codegolf.meta.stackexchange.com/a/12685/16842 or https://codegolf.meta.stackexchange.com/a/12684/16842, your choice.
5What does "accept" mean? Can acceptance and rejection be the output of two different values? – L3viathan – 2017-06-01T20:57:04.663
1Full programs only, or are functions allowed? – Stephen – 2017-06-01T20:58:20.783
@L3viathan I think using this criteria would be best.
– PyRulez – 2017-06-01T22:13:41.720@StephenS functions are fine – PyRulez – 2017-06-01T22:13:47.947
IMHO, you should explicitly define exactly what "accept"/"reject" mean in the question; it's unclear as it currently stands. – ETHproductions – 2017-06-01T23:44:22.430
Questions should be self-contained in case the linked ones are deleted or something in the future. Please copy your definitions of accept/reject into your question description. – mbomb007 – 2017-06-02T02:43:34.737