This is a popular number guessing game called "Bulls & Cows". On start up a random number is generated. Goal is to guess the number. If a digit matches its place it's a "Bull" if the digit is misplaced then it's a "Cow". For instance if the random number is 259 and you guessed 329, result is 1 Bull (digit 9) and 1 Cow (digit 2).