In this challenge as a cop you will choose two programming languages A and B, as well as a non-empty string S. You are then going to write 4 programs:
- A program which outputs exactly S when run in both A and B.
- A program which outputs S in A but not in B.
- A program which outputs S in B but not in A.
- A program which doesn't output S in either A or B.
You will then reveal all 4 programs (including which number each program is) and S, but keep the languages hidden.
Robbers will try to figure out a pair of languages such that they print the correct results for the 4 programs, and cops will try to make posts that are hard to figure out while remaining as short as possible.
Warning: There is a slight difference in the rules from "normal" cops-and-robbers
Cops' posts here can have 4 different states:
All cops' posts start as vulnerable. If a robber finds and posts a solution to a vulnerable post they will receive 1 point and the post will become cracked. If a post lasts 10 days in vulnerable without being solved it automatically becomes safe. A cop with a safe post may choose to reveal A and B and their safe post will become revealed. A robber can still solve a safe post, if they do they receive a point and the post becomes revealed.
Only revealed posts are eligible for scoring. Robbers are only permitted to solve vulnerable and safe posts.
Cops will be scored on the sum size of all four programs as measured in bytes, with the goal being to have an answer with as low a score as possible. Answers that are not revealed effectively have infinite score by this measure until they become revealed.
Languages and Output
In the interest of fairness, we are going to require that languages are free and reasonably cross platform. Both languages you choose must be freely available on Linux and FreeBSD (the two largest foss operating systems). This includes languages which are free and open source.
Your selected languages must predate this challenge.
Since this challenge requires that A and B produce different outputs for the same program, there is no requirement for what "counts" as a different language, the fact that they produce different outputs is enough.
Programs do not have to compile, run without error or "work" in the cases where they do not need to output S. As long as S is not the output it is valid.
Programs here should be complete programs not functions, expressions or snippets.
Running a program is assumed to be done with no input. All four programs must be deterministic, within an environment. It is fine for example if as a part of an error the program outputs the name of the file or your host name, this is not considered non-determinism since it is determined by the environment running the program. However if it is included in the output please indicate what the file is named etc.