[Question]
  [
*This is the cops' thread of a [cops-and-robbers](/questions/tagged/cops-and-robbers "show questions tagged 'cops-and-robbers'") challenge. The robbers' thread can be found [here](https://codegolf.stackexchange.com/questions/251451/polyglot-quiz-robbers-thread)*
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:
1. A program which outputs exactly **S** when run in both **A** and **B**.
2. A program which outputs **S** in **A** but not in **B**.
3. A program which outputs **S** in **B** but not in **A**.
4. 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](/questions/tagged/cops-and-robbers "show questions tagged 'cops-and-robbers'")**
Cops' posts here can have 4 different states:
1. Vulnerable
2. Cracked
3. Safe
4. Revealed
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.
## Scoring
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.
  
[Answer]
# A = [HQ9+](https://esolangs.org/wiki/HQ9%2B), B = [Python 3](https://docs.python.org/3/), 291 bytes, [Cracked](https://codegolf.stackexchange.com/a/251464/107310)
**S** is `Hello, world!`
1. Both **A** and **B** work
```
#console.log("Hello, world!")/*
print("hello, world!".capitalize())
#*/
```
2. **A** only
```
console.log("Hello, world!")/*
print("hello, world!")
*/
```
3. **B** only
```
#console.log("Hello, world!")/*
print("Hello, world!")
#*/
```
4. Neither work
```
console.log(String.fromCharCode(49-1)+"ello, world!")/*
print(String.fromCharCode(49-1)+"ello, world!")
*/
```
GG
[Answer]
# [A] and [B], 64 Bytes, [Cracked](https://codegolf.stackexchange.com/a/251462/92689) by @Steffan
S = "Cop"
Both *A* and *B* works
```
main=print"Cop"
```
Works only *A*
```
main=print
 "Cop"
```
Works only *B*
```
main=
print"Cop"
```
None works
```
main=print
"Cop"
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands) and [yup](https://github.com/ConorOBrien-Foxx/yup/wiki), 8 bytes, [Cracked by *@FryAmTheEggman*](https://codegolf.stackexchange.com/a/251649/52210)
\$S\$: `0`
1. Works in \$A\$=05AB1E and \$B\$=yup:
```
0#?
```
2. Works in just \$A\$=05AB1E:
```
0?
```
3. Works in just \$B\$=yup:
```
0#
```
4. Works in neither \$A\$=05AB1E nor \$B\$=yup:
```
0
```
---
**Explanation now that it's cracked:**
```
0#?    # 05AB1E: Push 0; pop and split on spaces (no-op that just pops); print
       # without newline, which implicitly uses the last value that was on the now
       # empty stack, which is the 0
       # yup: Push 0; pop and print it without newline; no-op character '?'
0?     # 05AB1E: Push 0; pop and print it without newline
       # yup: Push 0; no-op character '?', so don't print anything
0#     # 05AB1E: Push 0; no-op pop; implicitly output 0 with trailing newline
       # yup: Push 0; pop and print it without newline
0      # 05AB1E: Push 0; implicitly output 0 with trailing newline
       # yup: Push 0; don't print anything
```
[Answer]
# Hexagony and Labyrinth, 44 bytes, [Cracked](https://codegolf.stackexchange.com/a/251469/78410) by Aiden Chow
**S** = `1234`
1. Works in both A and B
```
"123_1234!@
```
2. Works in A, but not in B
```
123+1
234!@
```
3. Works in B, but not A
```
1234@
;!;!;
```
4. Does not work in A or B
```
;!;!;
1234@
```
[Answer]
# ??? and ???, 69 bytes, vulnerable
S = `A`
1. Both A and B work:
```
:-%~! v
put(97)
.% >`a
```
2. Works in A, but not B:
```
:-%~v!
put(a)
.% >97
```
3. Works in B, but not A:
```
:-%~!<
put a.
.%^97C
```
4. Works in neither A or B:
```
put(97)
```
[Answer]
# [Glypho](https://web.archive.org/web/20060621185740/http://www4.ncsu.edu/%7Ebcthomp2/glypho.txt) and [Somme](https://github.com/ConorOBrien-Foxx/Somme), 747 bytes, revealed
## Explanation
For this approach, I thought it would make sense to choose two languages which cared very little about the actual content of their source codes, and instead cared about some properties the code has.
Glypho is a language who cares about the distinct permutations formed by chunks of 4 bytes. It has 15 commands, and is a stack-based language. For example, the string `UU{u` corresponds to the `push` command, since it is equivalent to `aabc` (in terms of uniqueness).
Somme is a language which is usually a fairly innocuous stack-based language, but once multiple lines are involved, the columns are summed and converted into a corresponding command. (Addition is performed by treating space, 32, as 0, `!` as 1, etc., then taking the result mod 95.)
Hence, the programs consist almost entirely of red herrings.
Recall that
**S** = `owo!owo!owo!owo!owo!owo!owo!owo!`
a string chosen because I thought it was funny.
## Both **[Glypho](https://tio.run/##VY9NSwNBDIbv8yv6theV0g74cXE7mVI8eQjTcRlQbPekHixpDxKKP37N7AoiuQQenrxv3j/Pxw/p@7b9/mJWARGEbVQlb/O2UW0KChvzUqQE1QAHVzk8vANc0qRsAwIt5ot5ZZEi/bqoTEqR0XUYXHh1KOZqGl2iIVfU/XeV/3IHV@G9t7UkPaXKa64IGxONRLHRYK6VVussBUGDji5bZw@Xc04mWyse/wUHBHKzdTfZrJ7v3s6bl7bL@fB0Gy8PXbh@nax2/LC7n9oJTK9ulqfH/cW@738A)** and **[Somme](https://tio.run/##VY9BSwNBDIXv8yv62otKaQfUXtxOphRPHsJ0XAYU273obQlFShB//JrZFURyCXx8eS@f0vfvw9C23xdmFRBB2EZV8iEfGtWmoLAxL0VKUA1wcJXDwzvAJU3KNiDQarlaVhYp0q@LyqQUmVyH0YVXh2KupsklGnNF3X9X@S93dBXee1tL0nOqvOaKsDHRSBQbDeZaabXOUhA06OSydfZwOedksrXi6V9wQCC32HWz/fZl8/G1f227nPvn@3jdd@H2bbY98uPxYW4nML@5W5@fTlenYfgB)** work:
```
UU{uOOwo!??!oOoOowwoSRSR<ww<W!WOOOw0oWoW>ww>!
!
owwo!0!0
!!
QwQwOwOw!?!?.,.,owwo@?@?<ww<W!W!OwOwoWWo>ww>!
!owwo!!0w
!W
QwwQOwOw!???oOoOoow
@?@?<ww<W!W!OwwOoWoW>ww>!
!owww!000
!WQwqQOwwO!?!?ooO!owow@??@<w><W!!WOww0ooW!>w>w!
!owOo!00!
SSSQQwqOwoO!??!oO!O>!>?
#A` C=Z6fyC[U`SSmT5@)m`>3] =^OE^;"owO!"*4/qK_(_
```
This corresponds to the [Glypho (shorthand) program](https://tio.run/##S8@pLMjI1y3OyC8qyUjMS/n/39BQOwUIow1TwHQKEIApbSAw1NVOyU@Bymjn54P4QJ6uthaYBPFjo1MRIPb/fwA) (`[eeeeeeeeeee]` is a loop that never runs):
```
11+d+d+[1d+d+d+dddd+d+dd++++1-+dod1d+d+d++oo1-+d1d+-+*1d+-+o1-+][eeeeeeeeeee]
11+                                                                 stack: 2
   d+d+                                                             stack: 8 (loop counter)
       [                                                    1-+]    loop 8 times
        1d+d+d+                                                     stack: LC, 8
               dddd                                                 stack: LC, 8, 8, 8, 8, 8
                   +d+dd++++                                        stack: LC, 8, 112
                            1-+                                     stack: LC, 8, 111
                               do                                   output and keep 'o'
                                 d1d+d+d++                          stack: LC, 8, 111, 119
                                          oo                        output 'wo'
                                            1-+                     stack: LC, 7
                                               d1d+-+*              stack: LC, 35
                                                      1d+-+         stack: LC, 33
                                                           o        output '!'
                                                            1-+     stack: LC-1
```
In Somme, this corresponds to the following program after the columns are summed:
```
F1+7*1-::8+\3B*m,m,m,m,m,m,m,m,0;!fw'@9AH     `
F                                                   stack: 15
 1+                                                 stack: 16
   7*1-                                             stack: 111
       ::                                           stack: 111, 111, 111
         8+\                                        stack: 111, 119, 111
            3B*                                     stack: 111, 119, 111, 33
               m,                                   map output (,) over stack
                 m,m,m,m,m,m,m,                     ...eight times in total
                               0;                   exit with exit code 0
                                 !fw'@9AH     `     (never executed)
```
## Only **[Glypho](https://tio.run/##Pc0xDgIxDETRPqew444GFy62WOEj5ABRaiiQDNWI0wcrLGuXo6d/f35ej5izdxvO@are0FCiRBAFIoqSxhjWVdF25h0CcRHPEd2s/5xrA1pJllARBUqkw/7O0wk85XJb35yZ3XNcvQxSUPbSKaUbCmj2OJ24C5YDjt7hRG6nU4rDIXsOSK2CGkBUu9j1PdbN@QU)** works:
```
[[4]?!?!?00?OwOw
o
oo  owoo
0 0o]]4[00wO<!!<w#w#?##?owow[44[?!?!?0?0OwwO
oooo 0wo
w0  0]44[00wO<!?<w##w?#?#owow[8[8?!!!??0wOwOw
oo
o o woow0 0 ]44]0ww0<!!!w###??#wowow[ww[?!?!?00wOwOw
##>o o woow00 o]44]0www<!??ww#""#w"owwo"4*4/q]]]]]]
```
This corresponds to the following [Glypho (shorthand) program](https://tio.run/##HYlBCoBADAPfsteGPeQ96kEI2INsRb34@lqWITBkjvO7PPrjcb@@D2VSkGALCWH6yg6rSQrOD4hpVoCIVnVrI/MH):
```
1d+dd+*[11+d+d+dd+\1-+*1-+dddo1d+d+d++oo1d+d*d*d+1+o!1-+]!n
1d+dd+*                                                       stack: 8
       [                                             1-+]     loop 8 times
        11+d+d+dd+                                            stack: LC, 8, 16
                  \1-+*1-+dd                                  stack: LC, 8, 111, 111, 111
                            do                                output and keep 'o'
                              1d+d+d++                        stack: LC, 8, 111, 111, 119
                                      oo                      output 'wo'
                                        1d+d*d*d+1+           stack: LC, 8, 111, 33
                                                   o          output '!'
                                                    !         discard 111
                                                     1-+      stack: LC-1
                                                         !n   discard; no-op
```
And also to the (gibberish) [Somme program](https://tio.run/##Pc0xDgMxCETR3qcA06UJBcUWq3AEH8BymXKFohRzfAc5TqAcPf13XNdzzt5tOOerekNDiRJBFIgoShpjWFdFO5lPCMRFPEd0s/51rg1oJVlCRRQokQ77OU8n8JTLHf1wZnbPcfUySEHZS6eUbiig2eN04i5YDti97UQef6cU2yF7DkitghpAVLvZ/TXWzfkB):
```
u>B-t$?@+@@v)IUnX'PFK;~{k**bj2Q1J02is?F}zRC/)mmU-U-w
```
This errors out immediately because `u` is not a command that exists.
## Only **[Somme](https://tio.run/##K87PzU39/z8zTaGgKDOvREMpv9xfSVOhJCM1z0pBOYxLASbuX56vpMmVmpfCpZxqYK1V52qXklTo6FtVq@1elGhbaRWQmcqVlFpSnpqap5CamJyhkF9aUlBaopCcmJOjo5CSb4UwShFoAQjkRcc4mOVUWykYgM0tSi1ITSxRKCnPTE7liojWSjcycFDKDteoNvHRLQrOVinXM6nVrNOy9ga6FwA)** works:
```
if print("owO") then: #V
  print("Owo")
end
#e0;*~E>dbqAMz}+Gra=y:Pie
between each output call, do:
  print("!")     n[\@6l{: 0
end
repeat twice
X[*g20@"kW({4L-rSk$w.4})~*;Ke
```
This corresponds to the following Somme program:
```
F1+7*1-::8+\3B*r`,{`FF+2+*0;
F1+7*1-::8+\3B*                 same as previous
               r                reverse stack
                `,{`            push this string
                    FF+2+       push 32
                         *      execute that string 32 times
                                (once for each character)
                          0;    exit with exit code 0
```
And to the (gibberish) [Glypho (shorthand) program](https://tio.run/##S8@pLMjI1y3OyC8qyUjMS/n/PxUMtFLhQFcRiFMNgTA6D8SPjYXJ/P8PAA):
```
eeeeee*eeeeeeeeee-!ee-e1e1e[neeee]]eeeeeeee
```
This errors out immediately due to `e` (execute) having no parameters.
## Neither **[A]** nor **[B]** work:
Didn't need to spend too much time here, since the answer was probably fine without it.
```
print("owo!"*8)
#&7("owo!"-1)
```
Thanks for reading!
[Answer]
# [Python](https://www.python.org/) and [PARI/GP](https://pari.math.u-bordeaux.fr/), 48 bytes, [Cracked](https://codegolf.stackexchange.com/a/251466/9288) by @Steffan
An easy one.
**S** is `Cop`
1. Both **A** and **B** work
```
print("Cop")
```
2. **A** only
```
print('Cop')
```
3. **B** only
```
print('Cop)'
```
4. Neither work
```
print("Cop)"
```
[Answer]
# ??? and ???, 54 bytes
String: `8356830650`
Works in A and B (hex):
```
00000000: 300b 3366 b87e 0b00 247e e239 2a83 2a3b  0.3f.~..$~.9*.*;
00000010: 0fd6 30                                  ..0
```
Works in A (hex):
```
00000000: a4ac b3bb 762b 3a74 d6                   ....v+:t.
```
Works in B (hex):
```
00000000: 300b 01f9 3033 1f0b 3131 5ee2 8891 5ebb  0...03..11^...^.
00000010: 2d88 7661 8976 0bce 0000 0b2b            -.va.v.....+
```
Works in neither:
```
We're no strangers to love
You know the rules and so do I (do I)
A full commitment's what I'm thinking of
You wouldn't get this from any other guy
I just wanna tell you how I'm feeling
Gotta make you understand
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you
We've known each other for so long
Your heart's been aching, but you're too shy to say it (say it)
Inside, we both know what's been going on (going on)
We know the game and we're gonna play it
And if you ask me how I'm feeling
Don't tell me you're too blind to see
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you
(Ooh, give you up)
(Ooh, give you up)
(Ooh) Never gonna give, never gonna give (give you up)
(Ooh) Never gonna give, never gonna give (give you up)
We've known each other for so long
Your heart's been aching, but you're too shy to say it (to say it)
Inside, we both know what's been going on (going on)
We know the game and we're gonna play it
I just wanna tell you how I'm feeling
Gotta make you understand
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you
Never gonna give you up
Never gonna let you down
Never gonna run around and desert you
Never gonna make you cry
Never gonna say goodbye
Never gonna tell a lie and hurt you
```
Or the empty program.
[Answer]
# [A] and [B], 46 bytes, Cracked by @mousetail
**S** is `0`
1. Both **A** and **B**, 14 bytes
```
print('0')
out
```
2. **A** but not **B**, 15 bytes
```
print('0')
out#
```
3. **B** but not **A**, 17 bytes
```
print('0',)
out #
```
4. Neither **B** nor **A**, 0 bytes
Yeah, I'm not wasting any bytes here `:-)`
[Answer]
# ??? and ???, 300 bytes
S = `A\n` (as in, `A` with a trailing newline)
1. Works in *A* and *B*
```
puts A
n = A[ exit ]
n = 8
m = n - 1
p = m - n
n = 3 * 10
p /= 2
t = p * p
```
2. Works in *A* but not *B*
```
puts 'A'
n = A[ exit ]
n = 8
m = n - 1
p = m - n
n = 3 * 10
p /= 2
t = p * p
```
3. Works in *B* but not *A*.
```
puts A
n = A[exit]
n = 8
m = n - 1
p = m - n
n = 3 * 10
p /= 2
t = p * p
```
4. Works in neither *A* nor *B*
```
n = A[ exit ]
puts A
n = 8
m = n - 1
p = m - n
n = 3 * 10
p /= 2
t = p * p
```
[Answer]
# [A] and [B], ACTUALLY 3 BYTES!!!, [Cracked](https://codegolf.stackexchange.com/questions/251451/polyglot-quiz-robbers-thread/251487#251487)
**S** is `0`
* Both, 0 bytes:
* Only **A**, 1 byte:
```
!
```
* Only **B**, 1 byte:
```
r
```
* Neither, 1 byte:
```
"
```
[Answer]
# [Lightlang](https://esolangs.org/wiki/Lightlang) and [PDAsephone](https://esolangs.org/wiki/PDAsephone), 141 bytes, revealed
## Explanation
My thought process for this approach was to choose two obscure esolangs with interpreters not on TIO. Since there are no interpreters online available, I recommend you download [`lightlang.py`](https://github.com/bangyen/esolangs/blob/master/register-based/lightlang.py) and [`PDASephone.java`](https://esolangs.org/wiki/Talk:PDAsephone).
My strategy with this one was further devious. If you were hurriedly scanning through esolangs, and found this language, the program will not complete immediately. The `_` command in Lightlang sleeps for one second, meaning the program takes about 13 seconds to complete.
Lightlang is a curious language which only has 1 bit of memory, whose implementation clocks in at 35 sloc. My solutions use the "interesting" parts of the language, bouncing, jumping, and conditional skipping, to produce varied output. The program otherwise is just a garden path through toggling a bit on and off and printing it occasionally.
PDAsephone is a language with a PDA (push-down automaton) datatype. Unfortunately, I didn't want to spend bytes (or mental energy) getting a non-trivial PDA functional in the language, especially when the other language is so simple that it would be hard to replicate any meaningfully complex behavior implemented in PDAsephone. Hence, I use it just for its stack-based capabilities, and most of the work done is to make it play nice with Lightlang.
**S** = `0110100`
Both **Lightlang** and **PDAsephone** work:
```
__@;"1_&^"0^!^!.$$:.__/!^#&!^&$$:."0:v..^:..___
```
Only **Lightlang** works:
```
[*)`!$]^|>,=+!+/#(]+|!!-+)$'%)}|^!]>*].==`^{;"|
```
Only **PDAsephone** works:
```
'**"0-'})'"1=/:+?.`/:~'{++:.>.'+*/(:./:-./::'..
```
Neither **Lightlang** nor **PDAsephone** work: (the empty program)
Thanks for reading!
[Answer]
# ??? and ???, 43 bytes, safe
output: `2147483647`
|  |  |
| --- | --- |
| both | `-print /*"\r"%S #*/|2**31-1` |
| only A | `-print %S` |
| only B | `2**31-1` |
| neither |  |
hint:  
none of the languages are esoteric or recreational, both are practical and one of them is even quite popular, the other one is free open source but not available on any service like TIO, it's a script for a domain-specific tool
[Answer]
# ??? and ???, 406 bytes, [cracked by Conor O'Brian](https://codegolf.stackexchange.com/a/251507/91213)
S=`2`
Both A and B:
```
# print("22222222222") //
!\print("22222222222")# 2
\\     ("11111111111")<<n
;;;;;;;;;;;;;;;;;;;;;;;;;
```
## A but not B:
```
# print("11111111110") //
!\print("11111111110")# 2
\\     ("11111111110")<<n
;;;;;;;;;;;;;;;;;;;;;;;;;
```
## B but not A:
```
print("22222222222") //
!\print("22222222222")# 2
\\     ("11111111111")<<n
;;;;;;;;;;;;;;;;;;;;;;;;;
```
## Neither A nor B:
```
# print("11111111111") //
!\print("11111111111")# 1
\\\    ("11111111111")>>n
;;;;;;;;;;;;;;;;;;;;;;;;;
```
[Answer]
# Pyth and V, 11 bytes, [Cracked](https://codegolf.stackexchange.com/questions/251451/polyglot-quiz-robbers-thread/251500#251500) by @Steffan
S = `3`
Both:
```
l"aa3
```
Only A:
```
3
```
Only B:
```
dl3P1é3
```
None: (empty)
]