You and your friends Brutus and April are exploring an ancient temple when you encounter a locked door with a stone keypad next to it numbering 0, 1, 2 and 3.

Out of curiosity you decide to type in an answer.

1321

A booming voice then says,

Three of those numbers are correct in correct position

Your not so intelligent friend Brutus shoves you away and types in:

1333.

Now Zero of those numbers are correct in correct position says the Great Big Voice

Perplexed by this answer your friend April decides to test it by typing:

1322.

Now One of those numbers are correct in correct position says the Voice

Frustrated by the whole encounter Brutus smashes his fist into the keypad typing

1210.

Now One of those numbers are correct in correct position says the Voice.

However, Brutus broke the Zero Key. But no worries, you think for a second and then type the correct answer.

Well, what was it?

Hint:

No Modulo functions required.

Hint 2:

Could you use subtraction? Absolutely!

• Welcome to puzzling SE! If you didn't create this, be sure to give proper attribution. If you did create it, that's great! Also, feel free to take the tour! – North Læraðr Apr 15 '19 at 22:39
• When 1333 entered, why not one number correct in correct position said? Are that’s the puzzle? Please assist, thanks. – Casablanca Kookie Apr 19 '19 at 10:32
• You puzzle is flawed due to the 1st 2 conditions. If 4 are incorrect and 3 correct, 2 cannot be common (and they are - 13xx). Either 1 or 3 from the 13 have to be there to meet the 1st condition but then the 2nd condition cannot be met. – Overmind Apr 19 '19 at 12:38
• No, it's just broken. – Overmind Apr 22 '19 at 5:01
• Has a correct answer been given? If so, please don't forget to $\color{green}{\checkmark \small\text{Accept}}$ it. If not, some responses to the answerers to help steer them in the right direction would be helpful. – Rubio May 7 '19 at 4:47

I think you should type in

132

Reasoning

Your friends names are Brutus and April so perhaps you are Julius (hinting at Caesar cipher).
The four entries in the code might possibly represent four rotors, each of which can occupy four positions. Each button press represents how many spaces the corresponding rotor is to be shifted.

Say, for example, our starting position is labelled 0000.
Then the first code shifts the rotors into relative positions 1321.
Brutus enters his code, 1333, and it shifts the rotors to relative positions 2210 (1+1,3+3,2+3,1+3 mod 4).
When April enters her code, 1322, the rotors are shifted into the relative positions 3132.
Finally, when Brutus enters 1210, the rotors are shifted into relative position 0002.

From the feedback of the booming voice, applied to the relative positions of the rotors, it's not too hard to deduce the correct relative positions to be 1322. The 4th rotor is already in place so you just need to type 132 to align the others.

Edit for mistake

As Hermes pointed out in the comments, I've actually made a mistake in the original argument. In particular, when Brutus enters 1210, the rotors are shifted to relative positions 0302 (not 0002). This would mean that the correct relative positions are either 3321 or 1331 (both feasible given the previous information). Since the zero on the keypad is broken we would have to enter two or three codes to get the rotors back into the right position. First entering 1111 puts the rotors into relative position 1013. The booming voice will tell you either zero or one number is correct.
If zero, then enter 2312.
If one, then enter 1111 followed by 3211

• Not at all a bad answer, wasn't the solution I was looking for simply since, by context, the answer should be four digits. – mrGoldenApple Apr 15 '19 at 23:47
• I love this answer, but you have mistaken the last relative position of the rotors, it would not be 0002, but 0302. – Hermes Apr 23 '19 at 15:57
• @Hermes, yes you are quite right. Thanks, for spotting that I will make an edit with a correction. – hexomino Apr 26 '19 at 10:53

The expected code is

2131

Explanation

I think that the code must be read as abcd and some machinery compute some differences between entered digits.
First try 1321 : 3 numbers are correct (modulo 4):
a-b = 2
a-c = 3
a-d = 0
b-c = 1
b-d = 2
c-d = 1

Second try 1333

a-b = 2
a-c = 2
a-d = 2
b-c = 0
b-d = 0
c-d = 0
So difference between a and b must be ignored since both first codes give the same result.
Third try 1322
a-c = 3 -- same as first
a-d = 3
b-c = 1 -- same as first
b-d = 1
c-d = 0

And last 1210
a-c = 0
a-d = 1
b-c = 1 -- same as first
b-d = 2
c-d = 1 -- same as first

Since b-c is the same in 1st, 3rd and 4th, I should be ignored.
So We can guess that, in first code, a-c, a-d and c-d are correct, b-d has never been good and must be b-d = 3.
So we have 4 variables, 4 equations :
a-c = 3
a-d = 0
b-d = 3
c-d = 1

Knowing that we cannot use 0, we can guess:
a = 2
b = 1
c = 3
d = 1
or 2131

• Does not comply with 1st rule. – Overmind Apr 22 '19 at 5:03

I think it is:

1312

Deduction:

1321. Three of those numbers are correct in correct position

Chose from the three numbers entered above and put them at correct position (hence 0 is not in the password)

1333. Now Zero of those numbers are correct in correct position says the Great Big Voice

0 is at the correct position now, i.e., not entered in the password

1322. Now One of those numbers are correct in correct position says the Voice

1 is at the correct position (first) now. Password deduced so far is 1xxx. We listen to the next clue to find the xs.

1210. Now One of those numbers are correct in correct position says the Voice.

Again, 1 is at the correct position (first and third): 1x1x. Following the first clue, 2 and 3 must be in the password. Since 2 is not in the right position (also, the previous clue tells that 3 can't be in the second position), the only possibility is 1312.

I think it is

2312

Let the numbers be abcd. The reasoning is:

The a in all numbers is 1 and at least one number is always at the wrong place. So this is the wrong one. And in all the numbers, a+c = b and b-d = c

Application:

So position 1 cannot be 1 as in second hidden quote. It cannot be 0 as it is broken. It cannot be 3 as something at position c added to it cannot be typed for position b. So it is 2. Now position c cannot be 2 or 3 as they sum greater than 3 for position b. So it is 1 only. So b is 3. Now d = b-c => 3-1 = 2.

1311

Solution

The first hint...Three is in right postion...So second digit is 3.
Seconcd hint...there is no Zero.
Third hint...1 is the first digit
fourth hint...1 is first and third digit
Process of elimination leave 1311

1313.

Sorry for my incomplete explanation the previous time. At the first attempt the code was 1321. The voice said "Three" of those numbers which I assume 3 among 0,1,2,3. Next time the code was 1333 and the voice said "Zero" of those numbers are correct in their correct position and from this I concluded 0 shouldn't be on the right code too. Further the code was, 1322 and the voice said "One" of those numbers are correct in their correct position so 1 should be the first digit. When the code typed is 1210 the response still persists so 1 should be the third position too.