# Dead and Injured on IOS

Who remembers the game “dead-and-injured”? I don’t remember what the real name is.

I have been playing the game with my colleague on paper and I decided to experiment it on IOS just to put everything I have been learning and reading into good use.

What in this life is dead-and-injured?

It is played between two players. Both players have their secret numbers. The secret numbers are picked by following these rules:

• The numbers have an agreed number of digits, usually four.
• The digits of the number must be unique i.e no repetition

Therefore, 3456 is VALID. 3436 is INVALID because 3 is repeated.

Player A tries to decode the player B’s secret number by using the player’s responses to guess the next set of digits. The response is in the format described below:

Situation Response When digits of the guessed number exactly match the digits of the secret number i.e the same positions Dead When digits of the guessed number exist in the secret number but the positions don’t match Injured

For example, my secret number is 5678.
The following guesses will give the corresponding responses.